| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
[audio_core] Rework audio output
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
| |
GetCurrentFocusState
SetClockSpeed
EnableSixAxisSensorUnalteredPassthrough
IsSixAxisSensorUnalteredPassthroughEnabled
Get, GetOld
SetAndWait, SetAndWaitOld
IocParam
IocFree
|
| |
|
|
|
|
|
| |
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.
|
|
|
|
| |
Fixes an svc break in Kirby and the Forgotten Land with async GPU enabled.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
| |
This seems to only be used to protect a later gpu function call. So we can move the lock into that call instead.
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
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.
|
|
|
|
| |
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.
|
|
|
|
|
| |
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.
|
|
|
|
| |
Fixes Mario Golf intro video decoding.
|
|
|
|
| |
Plus some minor cleanup for consistency.
|
|\
| |
| | |
perf_stats: Rework FPS counter to be more accurate
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|/
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
| |
Now all that remains is for kernel code to be 'shadow-free' and then
-Wshadow can be turned into an error.
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
nvdrv: Cleanup CDMA Processor on device closure
|
| |
| |
| |
| | |
Brings us a step closer to unifying all channels to share a common interface.
|
|\ \
| | |
| | | |
nvhost_nvdec_common: Avoid memcpy with null pointers
|
| |/
| |
| |
| |
| |
| |
| | |
Avoid sending null pointer to memcpy as reported by Undefined Behavious
Sanitizer.
Co-authored-by: LC <mathew1800@gmail.com>
|
|/
|
|
|
|
| |
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.
|
|
|
|
| |
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
|
|
|
|
| |
Wee also report the correct "big page size" now in GetVARegions & fix up the struct for IoctlAllocAsEx
|
|
|
|
| |
Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
laying the groundwork for async gpu, although this does not fully implement async nvdec operations
|
|
|
|
| |
- Note, this always processes the ioctl right away, which fixes BotW 1.0.0 issues.
|
| |
|
|
|
|
| |
Fixes regression caused by #4907 which caused games like Breath of the Wild 1.0.0 not to boot.
|
| |
|
| |
|
|
|
|
| |
- This seems to cause softlocks in Breath of the Wild.
|
| |
|
|
|
|
|
| |
- Refactor so that SubmitGPFIFO and KickoffPB use shared functionality.
- Implement add_wait and add_increment flags.
|
| |
|
|
|
|
|
| |
* Rename to align with switchbrew
* Rename to align with switchbrew and remove gpu function that checks if clearing should be done.
|
|
|
|
|
|
| |
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)};
^
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|\
| |
| | |
core: Fix clang build
|
| |
| |
| |
| |
| |
| |
| | |
Recent changes to the build system that made more warnings be flagged as
errors caused building via clang to break.
Fixes #4795
|
|/
|
|
| |
- This is used by Super Mario 3D All-Stars.
|
|\
| |
| | |
nvdrv: Stub nvdec/vic ioctls to bypass nvdec movies
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| | |
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.
|
| |
| |
| | |
Co-authored-by: LC <mathew1800@gmail.com>
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
|/
|
|
| |
Fixes animal crossing svcBreak on launch
|
|
|
|
| |
IoctlGetGpuTime should be 16 bytes, not 8.
|
| |
|
|
|
|
|
| |
This commit corrects a padding value in Ioctl Remap that was actually an
offset to the mapping address.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
General fixes to Async GPU
|
| |
| |
| |
| | |
Events are supposed to be cleared on quering. This fixes that issue.
|
| | |
|
|/ |
|
|\
| |
| | |
Initial implementation of Ioctl2 & Ioctl3
|
| |
| |
| |
| | |
Purpose of Ioctl2 and Ioctl3 is to prevent the passing of raw pointers through ioctls
|
|/
|
|
| |
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
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Makes the casing consistent with all of our general function naming
conventions.
|
|
|
|
|
| |
Makes the interface more type-safe and consistent in terms of return
values.
|
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
gpu: Rewrite MemoryManager based on the VMManager implementation.
|
| | |
|
| | |
|
|\ \
| |/
|/| |
Port citra-emu/citra#4244 and citra-emu/citra#4599: Changes to BitField
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
These types are within the common library, so they should be within the
Common namespace.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| | |
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.
|
|/
|
|
|
| |
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.
|
| |
|
|\
| |
| | |
Changed logging to be "Log before execution", Added more error logging, all services/svc should now log on some level
|
| | |
|
| | |
|
| | |
|
|/
|
|
| |
- More accurate impl., fixes Undertale (among other games).
|
|
|
|
| |
- Used by Undertale.
|
|\
| |
| | |
Passing an invalid nmap handle to Remap should throw an error
|
| | |
|
| |
| |
| |
| | |
Added error for invalid nmap handles
|
|\ \
| | |
| | | |
Added error codes for nvmap
|
| | | |
|
| |/ |
|
|/ |
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This moves the hot loop into video_core. This refactoring shall reduce the CPU overhead of calling ProcessCommandList.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
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().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Passing nullptr to memcpy is undefined behavior.
|
|
|
|
|
| |
This behaves quite similarly to the SubmitGPFIFO command. Referenced from Ryujinx.
Many thanks to @gdkchan for investigating this!
|
|
|
|
|
| |
Prevents implicit construction and makes these lingering non-explicit
constructors consistent with the rest of the other classes in services.
|
| |
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This behavior is confirmed by reverse engineering.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|\
| |
| | |
Services/nvdrv: add '/dev/nvhost-nvdec' device
|
| | |
|
| | |
|
|/ |
|
| |
|
|\
| |
| | |
Stub NVGPU_IOCTL_CHANNEL_SET_TIMEOUT
|
| |
| |
| |
| | |
Used in Nintendo Labo ToyCon 1&2
|
|/
|
| |
We have no clue on what this actually does yet so stubbing it since it's just input only should be fine for now
|
|
|
| |
according to the changes made previously
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
It releases a reference to an nvmap object
|
|
|
|
| |
It removes a mapping previously created with the MapBufferEx ioctl.
|
| |
|
|
|
|
|
|
| |
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).
|
| |
|
|\ |
|
| | |
|
| |\
| | |
| | | |
Nvdrv/nvhost-as-gpu: Implemented the ioctl REMAP command.
|
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | | |
It takes a previously-reserved (AllocateSpace) GPU memory address and maps it to the address of the nvmap object passed to Remap.
|
| |/ |
|
| | |
|
|/ |
|
|
|
|
| |
Tidies up namespace declarations
|
| |
|
| |
|
|
|
|
| |
- Workaround for texture forwarding until we have a better place.
|
| |
|
| |
|
| |
|
|
|
|
| |
Games like Puyo Puyo Tetris and BOTW seem to depend on the buffer always having the same handle
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
GPU: Added a command processor to decode the GPU pushbuffers and forward the commands to their respective engines
|
| |
| |
| |
| | |
Also moved the GPU MemoryManager class to video_core since it makes more sense for it to be there.
|
| | |
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|\
| |
| | |
nvmap: Make IoctlCommands an enum class
|
| |
| |
| |
| | |
This macro resolves to an empty macro in release builds.
|
| |
| |
| |
| | |
Prevents the enum values from polluting the surrounding scope
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
Adds in a missing EndGameFrame when nvdrv swaps buffers
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|