Commit Graph

64 Commits

Author SHA1 Message Date
Dave Murphy
d14f931eab payload can never be NULL 2022-05-02 23:12:56 +01:00
fincs
fc2aaefb0f
framebufferCreate: actually set NWindow dimensions (fix #568) 2021-09-13 19:01:34 +02:00
fincs
076657fd31
Allow user override of dynamic memory allocation functions throughout libnx 2021-01-22 18:37:46 +01:00
Michael Scire
e5ae43f4c2 results: use R_VALUE for comparisons 2020-12-01 02:26:26 +01:00
fincs
970d982e57
Add diagAbortWithResult, see details:
- This is a (weak/overridable) function meant to be called when the
  program encounters an unrecoverable error, but it's not fatal enough
  to bring down the entire system with it.
- The default implementation uses svcBreak, passing the result code
  in the user buffer.
- Replaced all usages of fatalThrow with diagAbortWithResult throughout
  the entire library.
2020-10-29 13:40:35 +01:00
fincs
6535d6f871
Remove U64_MAX in favor of using UINT64_MAX 2020-03-16 16:21:33 +01:00
fincs
ccb79ff4b6
NWindow: don't use bqDetachBuffer as it's unnecessary and in fact does nothing in the place it's called (reported by @Thog) 2020-03-10 00:07:04 +01:00
fincs
4ab2384449
fatal: Rename functions/types to match official names more closely 2019-10-24 23:25:07 +02:00
fincs
e9e392bbe2
binder: Update for new-ipc 2019-10-22 16:11:10 +02:00
fincs
6ad0042147
Introduce new IPC interface wrapper code, see details:
- Service object moved away from sm.h and into its own file (sf/service.h)
- Service object completely redesigned, but a (mostly)
  backwards compatible API was kept
- New low level HIPC request/response code
- New CMIF client-oriented code
- New service IPC dispatch functions
- Pointer buffer size automatically retrieved for all sessions
- Removed previous manual pointer buffer size query code
- SM rewritten with new IPC code
- All other services are still pending IPC rewrite
2019-09-19 03:50:28 +02:00
yellows8
3999ec147e
Use serviceIpcPrepareHeader/serviceIpcParse with binder to support using domains. 2019-08-27 18:32:53 -04:00
yellows8
bde3ae5a77
Added binder_session param to nwindowCreate(), which is now used with the binderInitSession() call instead of a hard-coded Service. Moved the viGetSession_IHOSBinderDriverRelay() call into nwindowCreateFromLayer(), for this new param. 2019-08-25 20:08:22 -04:00
Thomas Guillemard
3f6cf66243 Make it possible to use the binder API with an arbitrary service (#309)
This is useful if you want to connect to "dispdrv" for example.
2019-07-18 19:12:03 +02:00
Thog
c73b8ceeb9 fix parcelReadData size checking 2019-07-18 19:11:48 +02:00
fincs
77f1d357e5 Fix stupid mistake in binderInitSession error cleanup code 2019-06-07 03:14:41 +02:00
fincs
42878b603a Use eventActive instead of manually checking Event::revent 2019-04-30 02:31:47 +02:00
yellows8
966d554e7d Use PACKED for raw in _binderTransactParcelAuto. 2019-03-04 20:21:38 -05:00
fincs
11b7bece4a Change all services except fatal to use hosversion* instead of kernelAboveXYZ 2019-02-18 21:48:49 +01:00
fincs
50baeeaa80 nwindowGetDefault: Explicitly initialize dimensions to 1280x720 because 1.x reports a default size of 1x1 2019-01-04 20:41:05 +01:00
fincs
e708372dca Finally remove deprecated old gfx API 2019-01-03 21:13:20 +01:00
fincs
e7c58fe59e Deprecate old gfx API; scheduled for removal at a later date. 2018-12-19 19:33:31 +01:00
fincs
f37518d848 Add framebufferMakeLinear - linear shadow buffer support 2018-12-19 19:33:31 +01:00
fincs
dbc960a24f NWindow: Internal rework to fix resource leak in nwindowReleaseBuffers 2018-12-19 19:33:31 +01:00
fincs
3a77a7ace8 Introduce nwindowGetDefault 2018-12-19 19:33:31 +01:00
fincs
f381066a43 Add NvColorFormat enum 2018-12-19 19:33:31 +01:00
fincs
b1600c9add gfxGetFramebufferHandle: return id instead of handle 2018-12-19 19:33:31 +01:00
fincs
260f34fa4e NWindow: add several new functions:
- nwindowIsValid
- nwindowGetDimensions
- nwindowSetDimensions
- nwindowSetCrop
- nwindowSetTransform
- nwindowIsConsumerRunningBehind
2018-12-19 19:33:31 +01:00
fincs
bf43284c9f Misc code style fixes, rename NvGraphicBuffer::layers to planes 2018-12-19 19:33:31 +01:00
fincs
4879937946 Introduce Framebuffer, experimental wrapper object around a framebuffer queue for use by software rendering clients 2018-12-19 19:33:31 +01:00
fincs
62aa8e8b23 NWindow: add nwindowReleaseBuffers, which is also done automatically on Close 2018-12-19 19:33:31 +01:00
fincs
c5f8275978 Rename nvMapFree to nvMapClose for consistency reasons 2018-12-19 19:33:31 +01:00
fincs
a9cbd9116a Introduce NWindow, an experimental replacement for the GFX API 2018-12-19 19:33:31 +01:00
fincs
b188f5fb33 gfx.c: fix two single-line bugs 2018-12-19 19:33:31 +01:00
fincs
2af9531f5b Const correctness in bqCancelBuffer 2018-12-19 19:33:31 +01:00
fincs
ec6d878d12 Major buffer producer refactor, see details:
- Introduced NativeHandle (display/types.h)
- Introduced NvGraphicBuffer (nvidia/graphic_buffer.h)
- Renamed BqQueueBufferInput to BqBufferInput
- Renamed BqQueueBufferOutput to BqBufferOutput
- BqGraphicBuffer is now defined and marshalled in a way that matches
  official sw more closely, with a pointer to a NativeHandle instead of
  inline flattened data and other miscellaneous junk
- Const correctness fixes
- bqSetPreallocatedBuffer now has flattening logic for BqGraphicBuffer
- bqRequestBuffer doesn't have this logic for now, passing anything other
  than NULL will fail
- gfx.c updated to use the refactored buffer producer
2018-12-19 19:33:31 +01:00
fincs
d717507541 display/parcel.h: Const correctness fixes 2018-12-19 19:33:31 +01:00
fincs
ae77cbea97 gfx/hid/irs/nv/vi: changes related to sysmodule users, see details:
- Removed hard dependency on applet
- Allow appletGetAppletResourceUserId to fail (using default zero in that case)
- nvInitialize uses nvdrv:s for AppletType_None
- gfx now uses weak global __nx_gfx_vi_service_type for the ViServiceType passed to viInitialize
2018-12-19 19:33:31 +01:00
fincs
3a31df429e gfx: finally get rid of nvgfx, replaced with an NvMap object 2018-12-19 19:33:31 +01:00
fincs
4645ef7004 gfx: Add gfxAppendFence. Remove obsolete comments related to double buffering. 2018-09-16 18:03:35 +02:00
fincs
e3a7187973 gfx: Remove gfxSetDrawFlip. Make 0 the default transform instead of FLIP_V. 2018-08-31 20:14:50 +02:00
fincs
0d1b8bd723 BqQueueBufferInput: add swapInterval field (purpose currently unknown) 2018-08-31 20:11:53 +02:00
fincs
651dd72ac1 Add bqCancelBuffer and use it in gfx.c 2018-08-31 14:14:54 +02:00
fincs
c8ebe8a3b5 buffer_producer: convert Binder error codes to Result values 2018-08-31 14:05:04 +02:00
fincs
a62fae427b Introduce Module_LibnxBinder result codes (based on Android status_t) and binderConvertErrorCode 2018-08-31 13:59:18 +02:00
fincs
819a6f0d89 display/binder.h: refactoring and other changes:
- Removed session_handle/native_handle state
- Consequence of the above: simplified binderCreate/binderInitSession
- Now using viGetSession_IHOSBinderDriverRelay internally
- Changed binderGetNativeHandle to return an Event
- Added readable aliases for binderAdjustRefcount
- gfx: now using async bqDequeueBuffer when the binder event is available
2018-08-31 13:05:23 +02:00
fincs
60cbb68f46 gfx: use new NvFence waiting code 2018-08-31 13:05:23 +02:00
fincs
b26bb6ce76 viGetDisplayVsyncEvent: return an Event instead of a raw handle 2018-08-31 13:05:22 +02:00
fincs
f2f59c75c0 display/gfx.h & buffer_producer.h: Start major refactor, highly WIP 2018-08-31 13:05:22 +02:00
fincs
27f5aecea8 nvgfx: Strip down to bare minimum - remove unused logic 2018-08-31 13:05:22 +02:00
fincs
4e7159ce02 VI service: major revamp, see details:
- Added viOpenDefaultDisplay.
- Replaced viOpenLayer with viCreateLayer.
- NativeWindow parcel data is now parsed by viCreateLayer, and the
  ViLayer struct contains a new igbp_binder_obj_id field.
- LayerFlags/LayerId parameters replaced by weak global variables
  __nx_vi_layer_id/__nx_vi_stray_layer_flags.
- The root vi:* session is closed on startup.
- Simplified corresponding gfx code.
- Misc style fixes
2018-08-31 13:05:22 +02:00