summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nvdrv/devices (unfollow)
Commit message (Collapse)AuthorFilesLines
2023-10-25nvdrv: rework to remove memcpyLiam16-225/+243
2023-10-25nvdrv: fix up remaining copy callsLiam3-17/+22
2023-10-25nvdrv: convert nvmapLiam2-40/+19
2023-10-25nvdrv: convert codec devicesLiam6-34/+29
2023-10-25nvdrv: convert nvhost_gpuLiam2-76/+49
2023-10-25nvdrv: convert nvhost_ctrlLiam2-34/+29
2023-10-25nvdrv: convert nvhost_ctrl_gpuLiam2-97/+43
2023-10-25nvdrv: add ioctl command serialization, convert nvhost_as_gpuLiam5-71/+152
2023-10-01service: nvnflinger: Implement shared bufferNarr the Reg1-7/+7
Co-authored-by: Liam <byteslice@airmail.cc>
2023-08-25nvhost_as_gpu: ensure mappings are aligned to big page size when deallocatedLiam1-1/+3
2023-07-15k_process: PageTable -> GetPageTableLiam1-2/+2
2023-06-22Remove memory allocations in some hot pathsKelebek121-200/+199
2023-06-08nvnflinger: allow locking framerate during video playbackLiam1-2/+2
2023-06-08nvdisp: Fix SingleCore frametime reportingMorph1-1/+1
2023-03-24memory: rename global memory references to application memoryLiam2-4/+4
2023-03-12general: fix spelling mistakesLiam2-2/+2
2023-03-01nvnflinger: fix nameLiam1-2/+2
2023-02-14general: rename CurrentProcess to ApplicationProcessLiam2-4/+4
2023-02-03Revert "Merge pull request #9718 from yuzu-emu/revert-9508-hle-ipc-buffer-span"ameerj21-196/+194
This reverts commit 25fc5c0e1158cb8e81cbc769b24ad84032a1fbfd, reversing changes made to af20e25081f97d55b451606c87922e2b49f0d363.
2023-02-02Revert "hle_ipc: Use std::span to avoid heap allocations/copies when calling ReadBuffer"liamwhite21-194/+196
2022-12-29nvdrv: Use std::span for inputsameerj21-196/+194
Allows the use of HLERequestContext::ReadBufferSpan
2022-11-14Add break for default casesKyle Kienapfel2-6/+4
Visual Studio has an option to search all files in a solution, so I did a search in there for "default:" looking for any missing break statements. I've left out default statements that return something, and that throw something, even if via ThrowInvalidType. UNREACHABLE leads towards throw R_THROW macro leads towards a return
2022-11-04core: hle: kernel: k_memory_manager: Refresh.bunnei1-2/+4
2022-10-27nvnflinger: release queued handles immediately on disconnectionLiam1-4/+6
2022-10-19core: hle: kernel: k_page_table: Impl. LockForUn/MapDeviceAddressSpace, cleanup.bunnei1-1/+2
2022-10-17video_core: Implement memory manager page kindFengChen1-4/+8
2022-10-13kernel: remove KWritableEventLiam1-3/+2
2022-10-06General: address feedbackFernando Sahmkow10-50/+39
2022-10-06general: rework usages of UNREACHABLE macroLiam1-5/+5
2022-10-06nvdisp: End system frame after requesting to swap buffersMorph1-1/+1
Fixes frametime reporting
2022-10-06address_space: Address feedbackMorph1-4/+4
2022-10-06general: Format licenses as per SPDX guidelinesMorph4-16/+12
2022-10-06NvHostChannels: improve hack for supporting multiple channels.Fernando Sahmkow2-2/+11
2022-10-06Address Feedback from bylaws.Fernando Sahmkow1-1/+1
2022-10-06Core: Fix get nvmap object random crashVonChenPlus2-17/+0
2022-10-06NvDec: Fix regressions.Fernando Sahmkow3-4/+16
2022-10-06General: Fix compilation for GCCLiam White5-9/+12
2022-10-06NVDRV: Further improvements.Fernando Sahmkow7-59/+62
2022-10-06VideoCore: Refactor fencing system.Fernando Sahmkow2-3/+5
2022-10-06MemoryManager: initial multi paging system implementation.Fernando Sahmkow3-20/+36
2022-10-06NVDRV: Further refactors and eliminate old code.Fernando Sahmkow3-27/+8
2022-10-06NVDRV: Refactor Host1xFernando Sahmkow1-26/+11
2022-10-06VideoCore: Refactor syncing.Fernando Sahmkow4-10/+25
2022-10-06Texture cache: Fix the remaining issues with memory mnagement and unmapping.Fernando Sahmkow1-0/+3
2022-10-06VideoCore: Extra Fixes.Fernando Sahmkow1-1/+3
2022-10-06NVDRV: Remake ASGPUFernando Sahmkow2-235/+388
2022-10-06NVDRV: Update copyright notices.Fernando Sahmkow4-7/+13
2022-10-06NvHostCtrl: Fix merge of nvflinger.Fernando Sahmkow1-1/+2
2022-10-06NVHOST_CTRl: Implement missing method and fix some stuffs.Fernando Sahmkow2-6/+29
2022-10-06VideoCore: implement channels on gpu caches.Fernando Sahmkow5-29/+64
2022-10-06NVASGPU: Fix Remap.Fernando Sahmkow1-0/+8
2022-10-06NVDRV: Fix clearing when destroying.Fernando Sahmkow1-6/+7
2022-10-06NVMAP: Fix the Free return parameters.Fernando Sahmkow1-14/+14
2022-10-06NVDRV: Fix Open/Close and make sure each device is correctly created.Fernando Sahmkow10-52/+200
2022-10-06NVDRV: Implement new NvMapFernando Sahmkow15-210/+228
2022-10-06NVDRV: Refactor and add new NvMap.Fernando Sahmkow10-22/+44
2022-10-06NVDRV: Cleanup.Fernando Sahmkow1-1/+3
2022-10-06NVDRV: Implement QueryEvent.Fernando Sahmkow7-6/+100
2022-10-06NvHost: Remake Ctrl Implementation.Fernando Sahmkow2-84/+141
2022-10-06NvHost: Try a different approach to blocking.Fernando Sahmkow1-9/+6
2022-10-06NvHost: Fix some regressions and correct signaling on timeout.Fernando Sahmkow1-25/+19
2022-09-04Don't stall with nvdecKelebek11-1/+6
2022-09-01Demote services from warning/info to debug to reduce log spam:Kelebek11-2/+2
GetCurrentFocusState SetClockSpeed EnableSixAxisSensorUnalteredPassthrough IsSixAxisSensorUnalteredPassthroughEnabled Get, GetOld SetAndWait, SetAndWaitOld IocParam IocFree
2022-06-14kernel: implement KProcess suspensionLiam1-2/+2
2022-04-23general: Convert source file copyright comments over to SPDXMorph21-63/+42
This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
2022-03-29nvhost_ctrl: Only mark EventState::Busy as BadParameterameerj1-1/+1
Fixes an svc break in Kirby and the Forgotten Land with async GPU enabled.
2022-03-25hle: nvflinger: Move BufferTransformFlags to its own header.bunnei1-1/+1
2022-03-25hle: nvdrv: Rename Fence to NvFence to avoid naming conflicts.bunnei2-8/+9
2022-03-25hle: nvflinger: Move PixelFormat to its own header.bunnei2-8/+7
2022-03-19common: Reduce unused includesameerj2-0/+3
2021-12-04Address feedbackFeng Chen4-13/+22
2021-12-02Support multiple videos playingFeng Chen4-9/+21
2021-11-04core: Remove unused includesameerj8-11/+0
2021-10-24Fixup channel submit IOCTL syncpoint parametersBilly Laws2-21/+9
The current arguments worked by happenstance as games only ever submit one syncpoint and request one fence back, if a game were to do something other than this then the arguments would've been parsed entirely wrong.
2021-10-16NvHost/Core: Address Feedback.Fernando Sahmkow1-3/+5
2021-10-16Suspend temporallyFernandoS271-1/+2
2021-10-16NVHost_Ctrl: Force wait if the gpu falls behind too long.FernandoS271-0/+11
2021-10-03nvhost_ctrl: Refactor usage of gpu.LockSync()ameerj1-15/+15
This seems to only be used to protect a later gpu function call. So we can move the lock into that call instead.
2021-10-03gpu: Migrate implementation to the cpp fileameerj2-5/+13
2021-09-29style: Remove extra space preceding the :: operatorMorph1-1/+1
2021-09-07nvflinger: Use external surface format for framebuffer creationameerj1-5/+4
The format member the IGBPBuffer may not always specify the correct desired format. Using the external format member ensures a valid format is provided when creating the framebuffer. Fixes homebrew using the wrong framebuffer format.
2021-08-07nvhost_nvdec_common: Remove BufferMapameerj2-76/+0
This was mainly used to keep track of mapped buffers for later unmapping. Since unmap is no longer implemented, this no longer seves a valuable purpose.
2021-08-07nvhost_nvdec_common: Stub UnmapBuffer Ioctlameerj1-23/+4
Skip unmapping nvdec buffers to avoid breaking the continuity of the VP9 reference frame addresses, and the risk of invalidating data before the async GPU thread is done with it.
2021-07-24general: Rename "Frame Limit" references to "Speed Limit"ameerj1-1/+1
This setting is best referred to as a speed limit, as it involves the limits of all timing based aspects of the emulator, not only framerate. This allows us to differentiate it from the fps unlocker setting.
2021-07-15nvhost_nvdec_common: Read Submit ioctl data from object addrameerj1-8/+2
Fixes Mario Golf intro video decoding.
2021-07-15nvhost_nvdec_common: Fix {Slice/Write}Vectors returnameerj1-37/+38
Plus some minor cleanup for consistency.
2021-05-16core: Make variable shadowing a compile-time errorLioncash3-13/+13
Now that we have most of core free of shadowing, we can enable the warning as an error to catch anything that may be remaining and also eliminate this class of logic bug entirely.
2021-05-16perf_stats: Rework FPS counter to be more accurateameerj1-1/+0
The FPS counter was based on metrics in the nvdisp swapbuffers call. This metric would be accurate if the gpu thread/renderer were synchronous with the nvdisp service, but that's no longer the case. This commit moves the frame counting responsibility onto the concrete renderers after their frame draw calls. Resulting in more meaningful metrics. The displayed FPS is now made up of the average framerate between the previous and most recent update, in order to avoid distracting FPS counter updates when framerate is oscillating between close values. The status bar update frequency was also changed from 2 seconds to 500ms.
2021-05-06hle: kernel: Migrate KReadableEvent and KWritableEvent to KAutoObject.bunnei1-3/+3
2021-05-06hle: kernel: Migrate KEvent to KAutoObject.bunnei1-1/+1
2021-05-04service: Resolve cases of member field shadowingLioncash20-39/+40
Now all that remains is for kernel code to be 'shadow-free' and then -Wshadow can be turned into an error.
2021-04-25nvhost_vic: Fix device closureameerj2-10/+8
Implements the OnClose method of the nvhost_vic device, and removes the remnants of an older implementation. Also cleans up some of the surrounding code.
2021-04-05nvhost_nvdec_common: Avoid memcpy with null pointerslat9nq1-6/+11
Avoid sending null pointer to memcpy as reported by Undefined Behavious Sanitizer. Co-authored-by: LC <mathew1800@gmail.com>
2021-04-05nvhost_ctrl_gpu: Avoid sending null pointer to memcpylat9nq1-1/+7
Undefined Behaviour Sanitizer reports a null pointer is being sent to memcpy, thought it's "guaranteed to never be null". Guard it with an if statement, and log when the action has been averted.
2021-03-30nvdrv: Cleanup CDMA Processor on device closureChloe Marcec1-6/+4
Brings us a step closer to unifying all channels to share a common interface.
2021-03-25nvdrv: Pass device fd and handle device create methods for device opening and closingChloe Marcec19-75/+154
We pass the fd to the ioctl as well as alert the device when it's opened or closed to allow for fd unique actions to take place
2021-03-22nvdrv: Change InitializeEx to AllocAsExChloe Marcec2-27/+49
Wee also report the correct "big page size" now in GetVARegions & fix up the struct for IoctlAllocAsEx
2021-02-13Address PR feedbackameerj2-4/+2
Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>
2021-02-13nvdec cleanupameerj1-1/+7
2021-02-05hle: kernel: Reimplement KReadableEvent and KWritableEvent.bunnei1-4/+4
2021-02-05hle: kernel: Rename WritableEvent to KWritableEvent.bunnei1-1/+1
2021-02-05hle: kernel: Rename ReadableEvent to KReadableEvent.bunnei1-1/+1
2021-01-23Simplify conditionChloe Marcec1-2/+1
2021-01-23nvdrv: Unregister already registered eventsChloe Marcec1-1/+8
2021-01-07fix for nvdec disabled, cleanup host1xameerj1-11/+14
2021-01-07nvdec syncpt incorporationameerj6-18/+39
laying the groundwork for async gpu, although this does not fully implement async nvdec operations
2020-12-29hle: service: nvdrv: Revert #4981 to remove usage of SleepClientThread.bunnei19-106/+66
- Note, this always processes the ioctl right away, which fixes BotW 1.0.0 issues.
2020-12-07nvdrv: Remove useless re-declaration of pure virtual methods that were already declared in the superclasscomex1-33/+0
2020-11-24nvservices: Reintroducee IoctlCtrlChloe Marcec20-72/+110
Fixes regression caused by #4907 which caused games like Breath of the Wild 1.0.0 not to boot.
2020-11-10Addressed issuesChloe Marcec6-1/+71
2020-11-10core: Make nvservices more standardizedChloe Marcec21-784/+867
2020-11-07video_core: dma_pusher: Remove integrity check on command lists.bunnei1-1/+0
- This seems to cause softlocks in Breath of the Wild.
2020-11-01fixup! hle service: nvdrv: nvhost_gpu: Update to use SyncpointManager and other improvements.bunnei2-3/+11
2020-11-01 hle service: nvdrv: nvhost_gpu: Update to use SyncpointManager and other improvements.bunnei2-45/+104
- Refactor so that SubmitGPFIFO and KickoffPB use shared functionality. - Implement add_wait and add_increment flags.
2020-11-01hle service: nvdrv: nvhost_ctrl: Update to use SyncpointManager.bunnei2-8/+29
2020-11-01Rename to align with switchbrew and remove gpu function (#4714)Levi Behunin2-16/+10
* Rename to align with switchbrew * Rename to align with switchbrew and remove gpu function that checks if clearing should be done.
2020-10-30video_core: unbreak -Werror in NVDEC with ClangJan Beich1-1/+1
src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp:41:15: error: unused variable 'OutOfMemory' [-Werror,-Wunused-const-variable] constexpr u32 OutOfMemory{static_cast<u32>(-12)}; ^
2020-10-27video_core: NVDEC Implementationameerj7-286/+466
This commit aims to implement the NVDEC (Nvidia Decoder) functionality, with video frame decoding being handled by the FFmpeg library. The process begins with Ioctl commands being sent to the NVDEC and VIC (Video Image Composer) emulated devices. These allocate the necessary GPU buffers for the frame data, along with providing information on the incoming video data. A Submit command then signals the GPU to process and decode the frame data. To decode the frame, the respective codec's header must be manually composed from the information provided by NVDEC, then sent with the raw frame data to the ffmpeg library. Currently, H264 and VP9 are supported, with VP9 having some minor artifacting issues related mainly to the reference frame composition in its uncompressed header. Async GPU is not properly implemented at the moment. Co-Authored-By: David <25727384+ogniK5377@users.noreply.github.com>
2020-10-21Revert "core: Fix clang build"bunnei3-38/+30
2020-10-18core: Fix clang buildLioncash3-30/+38
Recent changes to the build system that made more warnings be flagged as errors caused building via clang to break. Fixes #4795
2020-10-13hle: service: nvdrv: Implement nvhost_as_gpu::FreeSpace.bunnei2-0/+25
- This is used by Super Mario 3D All-Stars.
2020-09-22General: Make use of std::nullopt where applicableLioncash1-2/+2
Allows some implementations to avoid completely zeroing out the internal buffer of the optional, and instead only set the validity byte within the structure. This also makes it consistent how we return empty optionals.
2020-08-14core: Resolve several -Wextra-semi warningsLioncash1-1/+2
We can amend one of the cascade macros to require semicolons in order to compile. In other cases, we can just remove the superfluous semicolons.
2020-07-28Update src/core/hle/service/nvdrv/devices/nvmap.cppbunnei1-1/+1
Co-authored-by: LC <mathew1800@gmail.com>
2020-07-26hle: nvdrv: Rewrite of GPU memory management.bunnei4-93/+227
2020-06-27FrameLimiting: Enable frame limiting for single core.Fernando Sahmkow1-0/+1
2020-06-27NVDRV: Remove frame limiting as Host Timing already takes care.Fernando Sahmkow1-1/+0
2020-06-27General: Recover Prometheus project from harddrive failure Fernando Sahmkow1-2/+1
This commit: Implements CPU Interrupts, Replaces Cycle Timing for Host Timing, Reworks the Kernel's Scheduler, Introduce Idle State and Suspended State, Recreates the bootmanager, Initializes Multicore system.
2020-06-10nvdrv: Fix GetTPCMasks for ioctl3David Marcec2-21/+22
Fixes animal crossing svcBreak on launch
2020-06-05service: nvhost_vic: Ignore Submit commands.bunnei2-1/+18
2020-06-05nvdrv: Stub nvdec/vic ioctls to bypass nvdec moviesZach Hilman4-3/+239
2020-05-01nvdrv: Fix GetGpuTime stack corruptionDavid Marcec1-2/+3
IoctlGetGpuTime should be 16 bytes, not 8.
2020-02-16nvhost_gpu: implement ChannelSetTimeslicenamkazy2-0/+20
2019-12-25NvServices: Correct Ioctl Remap.Fernando Sahmkow2-3/+5
This commit corrects a padding value in Ioctl Remap that was actually an offset to the mapping address.
2019-11-27core/memory: Migrate over Read{8, 16, 32, 64, Block} to the Memory classLioncash1-2/+2
With all of the trivial parts of the memory interface moved over, we can get right into moving over the bits that are used. Note that this does require the use of GetInstance from the global system instance to be used within hle_ipc.cpp and the gdbstub. This is fine for the time being, as they both already rely on the global system instance in other functions. These will be removed in a change directed at both of these respectively. For now, it's sufficient, as it still accomplishes the goal of de-globalizing the memory code.
2019-10-05Nvdrv: Correct Event setup in NvdrvFernando Sahmkow1-22/+11
Events are supposed to be cleared on quering. This fixes that issue.
2019-10-05Nvdrv: Do framelimiting only in the CPU ThreadFernando Sahmkow1-0/+4
2019-10-05service/nvdrv: Silence -WswitchReinUsesLisp4-4/+10
2019-09-21Mark KickOffPb & SubmitGPFIFO as traceDavid Marcec1-4/+4
These functions are not stubbed and are called fairly often. Due to the nature of how often they're called, we should keep them marked as LOG_TRACE instead of LOG_DEBUG or LOG_WARNING
2019-09-19Initial implementation of Ioctl2 & Ioctl3David Marcec19-48/+82
Purpose of Ioctl2 and Ioctl3 is to prevent the passing of raw pointers through ioctls
2019-08-21gpu: Change optional<reference_wrapper<T>> to T* for FramebufferConfigReinUsesLisp1-1/+1
2019-07-05Nv_Host_Ctrl: Correct difference calculationFernando Sahmkow1-5/+7
2019-07-05NVServices: Address FeedbackFernando Sahmkow3-10/+14
2019-07-05NVServices: Styling, define constructors as explicit and correctionsFernando Sahmkow13-21/+15
2019-07-05NVFlinger: Correct GCC compile errorFernando Sahmkow3-6/+5
2019-07-05NVServices: Make NVEvents Automatic according to documentation.Fernando Sahmkow1-2/+5
2019-07-05NVServices: Correct CtrlEventWaitSync to block the ipc until timeout.Fernando Sahmkow19-24/+56
2019-07-05GPU: Correct Interrupts to interrupt on syncpt/value instead of event, mirroring hardwareFernando Sahmkow1-4/+1
2019-07-05nv_services: Deglobalize NvServicesFernando Sahmkow19-31/+41
2019-07-05nv_host_ctrl: Make Sync GPU variant always return synced result.Fernando Sahmkow1-0/+5
2019-07-05nvhost_ctrl: Corrections to event handlingFernando Sahmkow1-7/+11
2019-07-05Gpu: Mark areas as protected.Fernando Sahmkow1-0/+6
2019-07-05nv_services: Stub CtrlEventSignalFernando Sahmkow2-12/+34
2019-07-05nv_services: Implement NvQueryEvent, NvCtrlEventWait, NvEventRegister, NvEventUnregisterFernando Sahmkow2-11/+87
2019-07-05nv_services: Create GPU channels correctlyFernando Sahmkow2-2/+5
2019-07-05video_core: Implement GPU side SyncpointsFernando Sahmkow2-7/+31
2019-07-05nv_services: Correct buffer queue fencing and GPFifo fencingFernando Sahmkow2-15/+15
2019-06-05core/core_timing_util: Amend casing of cyclesTo* functionsLioncash1-1/+1
Makes the casing consistent with all of our general function naming conventions.
2019-06-05core/core_timing_util: Use std::chrono types for specifying time unitsLioncash1-1/+2
Makes the interface more type-safe and consistent in terms of return values.
2019-04-04core: Add missing override specifiers where applicableLioncash1-1/+1
Applies the override specifier where applicable. In the case of destructors that are defaulted in their definition, they can simply be removed. This also removes the unnecessary inclusions being done in audin_u and audrec_u, given their close proximity.
2019-03-21gpu: Rewrite virtual memory manager using PageTable.bunnei1-10/+2
2019-03-21gpu: Move GPUVAddr definition to common_types.bunnei1-2/+2
2019-03-15gpu: Use host address for caching instead of guest address.bunnei1-1/+2
2019-03-07gpu: Move command processing to another thread.bunnei1-1/+1
2019-03-07gpu: Refactor command and swap buffers interface for asynch.bunnei2-13/+3
2019-02-27common/math_util: Move contents into the Common namespaceLioncash2-2/+2
These types are within the common library, so they should be within the Common namespace.
2019-02-16core_timing: Convert core timing into a classLioncash1-1/+2
Gets rid of the largest set of mutable global state within the core. This also paves a way for eliminating usages of GetInstance() on the System class as a follow-up. Note that no behavioral changes have been made, and this simply extracts the functionality into a class. This also has the benefit of making dependencies on the core timing functionality explicit within the relevant interfaces.
2019-02-12core_timing: Rename CoreTiming namespace to Core::TimingLioncash1-1/+1
Places all of the timing-related functionality under the existing Core namespace to keep things consistent, rather than having the timing utilities sitting in its own completely separate namespace.
2019-02-08nvdisp_disp0: change drawing message log level from Warning to TraceTobias1-3/+3
This is a leftover from the early yuzu days. We shouldn't log every time when we are drawing by default, so let's change the log level to Trace.
2019-02-06remove all occurance of specifying endianness inside BitFieldWeiyi Wang1-5/+5
This commit it automatically generated by command in zsh: sed -i -- 's/BitField<\(.*\)_le>/BitField<\1>/g' **/*(D.) BitField is now aware to endianness and default to little endian. It expects a value representation type without storage specification for its template parameter.
2018-12-15nvhost_gpu: Skip empty GPU command lists.bunnei1-0/+4
2018-11-28dma_pushbuffer: Optimize to avoid loop and copy on Push.bunnei1-8/+6
2018-11-27gpu: Rewrite GPU command list processing with DmaPusher class.bunnei1-3/+10
- More accurate impl., fixes Undertale (among other games).
2018-11-26Improved error messages in AM, HwOpus and NvMapDavid Marcec1-12/+14
2018-11-26Changed logging to be "Log before execution", Added more error logging, all services should now log on some levelDavid Marcec7-0/+36
2018-11-21nvhost_ctrl_gpu: Implement IoctlGetGpuTime.bunnei2-0/+19
- Used by Undertale.
2018-10-12Returned an error before processing other remapsDavid Marcec1-6/+2
2018-10-12Made the minimum alignment more clearDavid Marcec1-2/+3
2018-10-11Added error codes for nvmapDavid Marcec1-12/+59
2018-10-11Passing an invalid nmap handle to Remap should throw an errorDavid Marcec1-3/+14
Added error for invalid nmap handles
2018-10-11nvhost_as_gpu: Flush CPU VAddr on UnmapBuffer.bunnei1-3/+4
2018-10-08Unmapping an unmapped buffer should succeedDavid Marcec1-1/+6
Hardware tests show that trying to unmap an unmapped buffer already should always succeed. Hardware test was tested up to 32 iterations of attempting to unmap
2018-09-15Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi1-1/+1
2018-09-11hle/service: Default constructors and destructors in the cpp file where applicableLioncash18-19/+47
When a destructor isn't defaulted into a cpp file, it can cause the use of forward declarations to seemingly fail to compile for non-obvious reasons. It also allows inlining of the construction/destruction logic all over the place where a constructor or destructor is invoked, which can lead to code bloat. This isn't so much a worry here, given the services won't be created and destroyed frequently. The cause of the above mentioned non-obvious errors can be demonstrated as follows: ------- Demonstrative example, if you know how the described error happens, skip forwards ------- Assume we have the following in the header, which we'll call "thing.h": \#include <memory> // Forward declaration. For example purposes, assume the definition // of Object is in some header named "object.h" class Object; class Thing { public: // assume no constructors or destructors are specified here, // or the constructors/destructors are defined as: // // Thing() = default; // ~Thing() = default; // // ... Some interface member functions would be defined here private: std::shared_ptr<Object> obj; }; If this header is included in a cpp file, (which we'll call "main.cpp"), this will result in a compilation error, because even though no destructor is specified, the destructor will still need to be generated by the compiler because std::shared_ptr's destructor is *not* trivial (in other words, it does something other than nothing), as std::shared_ptr's destructor needs to do two things: 1. Decrement the shared reference count of the object being pointed to, and if the reference count decrements to zero, 2. Free the Object instance's memory (aka deallocate the memory it's pointing to). And so the compiler generates the code for the destructor doing this inside main.cpp. Now, keep in mind, the Object forward declaration is not a complete type. All it does is tell the compiler "a type named Object exists" and allows us to use the name in certain situations to avoid a header dependency. So the compiler needs to generate destruction code for Object, but the compiler doesn't know *how* to destruct it. A forward declaration doesn't tell the compiler anything about Object's constructor or destructor. So, the compiler will issue an error in this case because it's undefined behavior to try and deallocate (or construct) an incomplete type and std::shared_ptr and std::unique_ptr make sure this isn't the case internally. Now, if we had defaulted the destructor in "thing.cpp", where we also include "object.h", this would never be an issue, as the destructor would only have its code generated in one place, and it would be in a place where the full class definition of Object would be visible to the compiler. ---------------------- End example ---------------------------- Given these service classes are more than certainly going to change in the future, this defaults the constructors and destructors into the relevant cpp files to make the construction and destruction of all of the services consistent and unlikely to run into cases where forward declarations are indirectly causing compilation errors. It also has the plus of avoiding the need to rebuild several services if destruction logic changes, since it would only be necessary to recompile the single cpp file.
2018-09-10video_core: Move command buffer loop.Markus Wick2-31/+12
This moves the hot loop into video_core. This refactoring shall reduce the CPU overhead of calling ProcessCommandList.
2018-08-31gl_renderer: Cache textures, framebuffers, and shaders based on CPU address.bunnei1-0/+1
2018-08-31core: Make the main System class use the PImpl idiomLioncash1-1/+2
core.h is kind of a massive header in terms what it includes within itself. It includes VFS utilities, kernel headers, file_sys header, ARM-related headers, etc. This means that changing anything in the headers included by core.h essentially requires you to rebuild almost all of core. Instead, we can modify the System class to use the PImpl idiom, which allows us to move all of those headers to the cpp file and forward declare the bulk of the types that would otherwise be included, reducing compile times. This change specifically only performs the PImpl portion.
2018-08-28gpu: Make memory_manager privateLioncash1-6/+6
Makes the class interface consistent and provides accessors for obtaining a reference to the memory manager instance. Given we also return references, this makes our more flimsy uses of const apparent, given const doesn't propagate through pointers in the way one would typically expect. This makes our mutable state more apparent in some places.
2018-08-13Added missing channel devicesDavid Marcec4-0/+140
2018-08-08nvhost_gpu: Don't over copy IoctlSubmitGpfifo.bunnei1-1/+1
2018-08-07nvdrv: Get rid of indirect inclusionsLioncash10-12/+17
2018-08-04renderer_base: Make Rasterizer() return the rasterizer by referenceLioncash1-2/+2
All calling code assumes that the rasterizer will be in a valid state, which is a totally fine assumption. The only way the rasterizer wouldn't be is if initialization is done incorrectly or fails, which is checked against in System::Init().
2018-08-04video_core: Eliminate the g_renderer global variableLioncash2-8/+9
We move the initialization of the renderer to the core class, while keeping the creation of it and any other specifics in video_core. This way we can ensure that the renderer is initialized and doesn't give unfettered access to the renderer. This also makes dependencies on types more explicit. For example, the GPU class doesn't need to depend on the existence of a renderer, it only needs to care about whether or not it has a rasterizer, but since it was accessing the global variable, it was also making the renderer a part of its dependency chain. By adjusting the interface, we can get rid of this dependency.
2018-07-31nvhost_gpu: Added checks to ensure we don't read past the end of the entries when handling a GPU command list.Subv1-3/+6
2018-07-31nvhost_ctrl_gpu: Only read the input parameters if they are actually there.Subv1-3/+11
Passing nullptr to memcpy is undefined behavior.
2018-07-21GPU: Implement the NVGPU_IOCTL_CHANNEL_KICKOFF_PB ioctl2 command.Subv2-5/+33
This behaves quite similarly to the SubmitGPFIFO command. Referenced from Ryujinx. Many thanks to @gdkchan for investigating this!
2018-07-19hle/service: Make constructors explicit where applicableLioncash3-3/+3
Prevents implicit construction and makes these lingering non-explicit constructors consistent with the rest of the other classes in services.
2018-07-18vi: Partially implement buffer crop parameters.bunnei2-3/+7
2018-07-10NvOsGetConfigU32 production implDavid Marcec1-17/+2
Settings are only used when RMOS_SET_PRODUCTION_MODE is set to 0. If production mode is set, the error code 0x30006 is returned instead
2018-07-08nvhost_ctrl: Fix NvOsGetConfigU32 for Snipper Clips.bunnei1-1/+1
2018-07-03Update clang formatJames Rowe6-27/+27
2018-07-03Rename logging macro back to LOG_*James Rowe7-43/+43
2018-07-01GPU: Remove a surface from the cache when its backing memory is being unmapped from the GPU's MMU.Subv1-0/+5
2018-07-01nvmap: Return the address of the nvmap object when Freeing it for the last time.Subv2-4/+11
This behavior is confirmed by reverse engineering.
2018-06-20Build: Fixed some MSVC warnings in various parts of the code.Subv1-1/+2
2018-06-06nvdrv/devices/nvidia_ctrl_gpu : add IoctlCommands with their params (#524)greggameplayer2-0/+53
* add IoctlCommands with their params in nvidia_ctrl_gpu.h * add function related to the changes done previously * fix clang-format * delete trailing whitespace * correct mistake
2018-06-04Nvdrv/devices/nvhost_gpu : Add some IoctlCommands with their params (#511)greggameplayer1-0/+47
* Add some IoctlCommand with their params to nvhost_gpu * fix clang-format * delete trailing whitespace * fix some clang-format * delete one other trailing whitespace * last clang-format fix
2018-05-30Services/nvdrv: add '/dev/nvhost-nvdec' devicemailwl2-0/+70
2018-05-30nvhost_ctrl: Stub out IocCtrlEventRegister.bunnei2-0/+10
2018-05-30nvhost_ctrl: Stub out IocCtrlEventWaitAsyncCommand.bunnei2-5/+9
2018-05-27NvOsGetConfigU32 should return null instead of 0 for default outputDavid Marcec1-1/+1
2018-05-25Stubbed NVGPU_GPU_IOCTL_ZBC_SET_TABLE (#463)David2-0/+22
We have no clue on what this actually does yet so stubbing it since it's just input only should be fine for now
2018-05-24Stub NVGPU_IOCTL_CHANNEL_SET_TIMEOUTmailwl2-0/+16
Used in Nintendo Labo ToyCon 1&2
2018-05-23change some functionsgreggameplayer1-6/+6
according to the changes made previously
2018-05-23correct placement and add size checkgreggameplayer1-21/+25
2018-05-23Add ioctl commands with their params and size checkgreggameplayer1-2/+86
2018-05-22Implemented NVHOST_IOCTL_CHANNEL_GET_WAITBASE (#440)David2-1/+20
* Implemented NVHOST_IOCTL_CHANNEL_GET_WAITBASE struct + 4 seems to be hard coded at 0 and struct + 0 seems to be ignored? * IocGetWaitbase -> IocChannelGetWaitbaseCommand * Added super late fixes
2018-05-20GPU: Implemented the nvmap Free ioctl.Subv2-1/+48
It releases a reference to an nvmap object
2018-05-20GPU: Implemented nvhost-as-gpu's UnmapBuffer ioctl.Subv2-0/+50
It removes a mapping previously created with the MapBufferEx ioctl.
2018-05-11More accurate GetTPCMasks implDavid Marcec2-4/+8
2018-05-02general: Make formatting of logged hex values more straightforwardLioncash5-7/+7
This makes the formatting expectations more obvious (e.g. any zero padding specified is padding that's entirely dedicated to the value being printed, not any pretty-printing that also gets tacked on).
2018-05-01GPU: Don't write to invalid memory locations when handling ioctls that don't have an output.Subv2-5/+0
2018-04-24nvdrv: Move logging macros over to new fmt-compatible onesLioncash6-53/+54
2018-04-23NvDrv/nvhost-as-gpu: Ensure that the object passed to MapBufferEx has already been allocated.Subv1-0/+10
Also added a consistency check and a comment for the case when the object id is different than its handle. The real nvservices doesn't make a distinction between ids and handles, each object gets an unique handle which doubles as its id.
2018-04-23Nvdrv/nvhost-as-gpu: Implemented the ioctl REMAP command.Subv2-0/+47
It takes a previously-reserved (AllocateSpace) GPU memory address and maps it to the address of the nvmap object passed to Remap.
2018-04-23Nvdrv: Assert when receiving an unimplemented ioctl in the nv* handlers.Subv5-5/+5
2018-04-23GetIUserInterface->CreateUserInterface, Added todos and stub logs. Playreport->PlayReport.David Marcec1-1/+1
2018-04-22Implemented GetIUserInterface properly, Playreport and SSL::SetInterfaceVersion. Fixed ipc issues with IAudioDevice(wrong ids)David Marcec1-0/+1
2018-04-20service: Use nested namespace specifiers where applicableLioncash13-78/+27
Tidies up namespace declarations
2018-03-23renderer_opengl: Fixes for properly flushing & rendering the framebuffer.bunnei1-6/+0
2018-03-23renderer_opengl: Better handling of framebuffer transform flags.bunnei1-3/+1
2018-03-23nvdisp_disp0: Always flush and invalidate framebuffer region.bunnei1-0/+7
- Workaround for texture forwarding until we have a better place.
2018-03-23video_core: Move FramebufferInfo to FramebufferConfig in GPU.bunnei1-3/+3
2018-03-19Clang FixesN00byKing1-2/+2
2018-03-19Clean Warnings (?)N00byKing1-1/+1
2018-02-17nvmap: Make IocFromId return the same existing handle instead of creating a new one.Subv1-5/+2
Games like Puyo Puyo Tetris and BOTW seem to depend on the buffer always having the same handle
2018-02-15nvhost-ctrl: Stub NVHOST_IOCTL_CTRL_EVENT_WAIT.Subv2-0/+25
2018-02-14nvmap: Silence formatting specifier warningsLioncash1-1/+2
2018-02-14nvhost_gpu: Silence formatting specifier warningsLioncash1-6/+8
2018-02-14nvhost_ctrl: Silence formatting specifier warningsLioncash1-2/+2
2018-02-14nvhost_ctrl_gpu: Silence formatting specifier warningsLioncash1-3/+4
2018-02-14nvhost_as_gpu: Silence formatting specifier warningsLioncash1-5/+7
2018-02-12Make a GPU class in VideoCore to contain the GPU state.Subv4-16/+13
Also moved the GPU MemoryManager class to video_core since it makes more sense for it to be there.
2018-02-12GPU: Added a command processor to decode the GPU pushbuffers and forward the commands to their respective engines.Subv3-3/+5
2018-02-12nvdrv: Make the GPU memory manager available to nvhost-gpu.Subv2-4/+11
2018-02-12vi: Parse IGBPQueueBufferRequestParcel params and expose buffer flip vertical.bunnei2-3/+7
2018-02-09nvhost_ctrl_gpu: Implement ZCullGetInfo.bunnei1-2/+14
2018-02-08nvhost_as_gpu: Implement AllocateSpace and MapBufferEx.bunnei2-10/+33
2018-02-08nvmap: Refactor to expose nvmap objects.bunnei2-19/+22
2018-02-08nvhost_as_gpu: Add nvmap as a class member.bunnei2-1/+8
2018-02-06Extra nvdrv support (#162)David13-18/+708
* FinishInitalize needed for 3.0.1+ games * nvdrv:s and nvdrv:t both use NVDRV * Most settings return 0 on hardware, disabled NV_MEMORY_PROFILER for now. NVN_THROUGH_OPENGL & NVRM_GPU_PREVENT_USE are a few interesting settings to look at. Carefully choosing settings can help with drawing graphics later on * Initial /dev/nvhost-gpu support * ZCullBind * Stubbed SetErrorNotifier * Fixed SetErrorNotifier log, Added SetChannelPriority * Allocate GPFIFO Ex2, Allocate Obj Ctx, Submit GPFIFO * oops * Fixed up naming/structs/enums. Used vector instead of array for "gpfifo_entry" * Added missing fixes * /dev/nvhost-ctrl-gpu * unneeded struct * Forgot u32 in enum class * Automatic descriptor swapping for ioctls, fixed nvgpu_gpu_get_tpc_masks_args being incorrect size * nvdrv#QueryEvent * Renamed logs for nvdrv * Refactor ioctl so nv_result isn't needed * /dev/nvhost-as-gpu * Fixed Log service naming, CtxObjects now u32, renamed all structs, added static_asserts to structs, used INSERT_PADDING_WORDS instead of u32s * nvdevices now uses "Ioctl" union, * IoctlGpfifoEntry now uses bit field * final changes
2018-02-04logger: Use Service_NVDRV category where applicable.bunnei1-5/+5
2018-01-21Added nvmemp, Added /dev/nvhost-ctrl, SetClientPID now stores pid (#114)David2-0/+94
* Added nvmemp, Added /dev/nvhost-ctrl, SetClientPID now stores pid * used clang-format-3.9 instead * lowercase pid * Moved nvmemp handlers to cpp * Removed unnecessary logging for NvOsGetConfigU32. Cleaned up log and changed to LOG_DEBUG * using std::arrays instead of c arrays * nvhost get config now uses std::array completely * added pid logging back * updated cmakelist * missing includes * added array, removed memcpy * clang-format6.0
2018-01-21nvmap: Add a return 0 underneath the UNIMPLEMENTED macroLioncash1-0/+1
This macro resolves to an empty macro in release builds.
2018-01-21nvmap: Make IoctlCommands an enum classLioncash2-12/+12
Prevents the enum values from polluting the surrounding scope
2018-01-17UI: Fix frame rate perf statsJames Rowe1-0/+3
Adds in a missing EndGameFrame when nvdrv swaps buffers
2018-01-17NV: Move the nvdrv classes into the Nvidia namespace, and move the functionality to a s single module that services call.Subv7-14/+14
2018-01-13yuzu: Update license text to be consistent across project.bunnei7-7/+7
2018-01-12core: Include <algorithm> where used.bunnei1-0/+2
2018-01-12nv: Fix more broken asserts.bunnei2-3/+3
2018-01-12nvdisp_disp0: Fix broken assert.bunnei1-1/+1
2018-01-11nvdisp_disp0: Call SwapBuffers to render framebuffer.bunnei1-0/+7
2018-01-11NV: Move the nv device nodes to their own directory and namespace.Subv7-0/+402