summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nvflinger/nvflinger.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* vi: implement CloseDisplayLiam2022-10-271-0/+13
|
* core: barrier service thread shutdownLiam2022-10-231-4/+8
|
* Core: Fix get nvmap object random crashVonChenPlus2022-10-061-1/+1
|
* VideoCore: Refactor fencing system.Fernando Sahmkow2022-10-061-12/+3
|
* VideoCore: Refactor syncing.Fernando Sahmkow2022-10-061-2/+7
|
* NVDRV: Fix Open/Close and make sure each device is correctly created.Fernando Sahmkow2022-10-061-1/+6
|
* common: remove "yuzu:" prefix from thread namesLiam2022-10-041-1/+1
|
* service: vi: Retrieve vsync event once per displayMorph2022-09-261-3/+4
| | | | | | The display vsync event can only be retrieved once per display. Returns VI::ResultPermissionDenied if we attempt to retrieve the vsync event for the same display. Prevents games such as .hack//G.U. Last Recode from consuming all the handles in the handle table by spamming vsync event retrievals and allows it to go in game.
* Rework multi-core vsyncKelebek12022-08-021-16/+26
|
* hle: service: nvflinger: Fix implicit conversion.bunnei2022-07-171-1/+4
|
* yuzu: settings: Remove framerate cap and merge unlocked framerate setting.bunnei2022-07-171-8/+10
| | | | - These were all somewhat redundant.
* hle: service: nvflinger: Factor speed limit into frame time calculation.bunnei2022-07-171-1/+8
| | | | | - This allows the %-based "Limit Speed Percent" setting to work with MC emulation. - This is already supported for SC emulation.
* PRKelebek12022-07-101-3/+3
|
* Rework CoreTimingKelebek12022-07-101-7/+6
|
* general: Convert source file copyright comments over to SPDXMorph2022-04-231-1/+1
| | | | | 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.
* hle: service: nvflinger: Use correct logger namespace.bunnei2022-04-021-2/+2
|
* hle: nvflinger: Use std::chrono for present_ns.bunnei2022-03-251-1/+1
|
* hle: vi: Integrate new NVFlinger and HosBinderDriverServer service.bunnei2022-03-251-42/+39
|
* Remove invalid assertion statementFeng Chen2021-12-281-3/+0
|
* nvflinger: Use jthread and stop_token for VSync threadameerj2021-10-031-23/+6
| | | | Avoids a destruction data race that may occur on the vsync thread
* Merge pull request #6981 from ameerj/nvflinger-hb-formatFernando S2021-09-111-1/+1
|\ | | | | nvflinger: Use external surface format for framebuffer creation
| * nvflinger: Use external surface format for framebuffer creationameerj2021-09-071-1/+1
| | | | | | | | | | | | 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.
* | core: hle: service: buffer_queue: Improve management of KEvent.bunnei2021-09-051-1/+1
|/
* core: hle: service: nvflinger/vi: Improve management of KEvent.bunnei2021-09-041-6/+7
|
* Revert "kernel: Various improvements to scheduler"bunnei2021-08-261-8/+7
|
* core: hle: service: buffer_queue: Improve management of KEvent.bunnei2021-08-071-1/+1
|
* core: hle: service: nvflinger/vi: Improve management of KEvent.bunnei2021-08-071-6/+7
|
* config, nvflinger: Add FPS cap settingameerj2021-07-241-5/+6
| | | | Allows finer tuning of the FPS limit.
* nvflinger: Add toggle to disable buffer swap interval limitsameerj2021-06-171-0/+3
| | | | | Enabling this setting will allow some titles to present more frames to the screen as they become available in the nvflinger buffer queue.
* Merge pull request #6284 from ameerj/shantae-fixbunnei2021-05-161-4/+26
|\ | | | | nvflinger: Create layers when they are queried but not found
| * nvflinger: Create layers when they are queried but not foundameerj2021-05-061-4/+26
| | | | | | | | Fixes Shantae softlock on boot.
* | core: Make variable shadowing a compile-time errorLioncash2021-05-161-1/+1
| | | | | | | | | | | | 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.
* | hle: kernel: Migrate KReadableEvent and KWritableEvent to KAutoObject.bunnei2021-05-061-3/+3
| |
* | hle: kernel: Migrate KEvent to KAutoObject.bunnei2021-05-061-2/+2
|/
* service: Eliminate cases of member shadowingLioncash2021-04-261-7/+7
| | | | | Resolves a few localized instances of member variable shadowing. Brings us a little closer to turning shadowing warnings into errors.
* common: Move settings to common from core.bunnei2021-04-151-1/+1
| | | | - Removes a dependency on core and input_common from common.
* hle: kernel: Rename ReadableEvent to KReadableEvent.bunnei2021-02-051-2/+2
|
* core: hle: Add missing calls to MicroProfileOnThreadExit.bunnei2021-01-111-0/+4
|
* service: nvflinger: Improve synchronization for BufferQueue.bunnei2020-12-291-4/+9
| | | | | - Use proper mechanisms for blocking on DequeueBuffer. - Ensure service thread terminates on emulation Shutdown.
* hle: service: nvflinger: Refactor locking and interfaces.bunnei2020-12-291-10/+13
|
* service: hle: nvflinger: Fix potential shutdown crash when GPU is destroyed.bunnei2020-11-011-0/+4
|
* Revert "core: Fix clang build"bunnei2020-10-211-1/+1
|
* core: Fix clang buildLioncash2020-10-181-1/+1
| | | | | | | Recent changes to the build system that made more warnings be flagged as errors caused building via clang to break. Fixes #4795
* General: Make use of std::nullopt where applicableLioncash2020-09-221-3/+3
| | | | | | | | 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.
* core_timing: Make use of uintptr_t to represent user_dataLioncash2020-07-281-1/+1
| | | | Makes the interface future-proofed for supporting other platforms in the event we ever support platforms with differing pointer sizes. This way, we have a type in place that is always guaranteed to be able to represent a pointer exactly.
* nvflinger: Use return value of Lock()Lioncash2020-07-261-1/+1
| | | | | comex reported in #4424 that we were incorrectly discarding the return value of Lock() which is correct.
* core_timing: Make TimedCallback take std::chrono::nanosecondsLioncash2020-07-161-3/+3
| | | | Enforces our desired time units directly with a concrete type.
* core_timing: Make use of std::chrono with ScheduleEventLioncash2020-07-161-6/+9
|
* Services/NvFlinger: Do vSync in a sepparate thread on Multicore.Fernando Sahmkow2020-06-271-3/+46
|
* NVFlinger: Lock race condition between CPU, Host Timing, VSync.Fernando Sahmkow2020-06-271-0/+2
|
* General: Recover Prometheus project from harddrive failure Fernando Sahmkow2020-06-271-7/+6
| | | | | | | 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.
* NVFlinger: Do the microprofile Flip after processing a valid frame.Fernando Sahmkow2020-03-121-2/+2
|
* Core: Set all hardware emulation constants in a single file.Fernando Sahmkow2020-02-121-3/+4
|
* Merge pull request #3272 from bunnei/vi-close-layerbunnei2020-01-071-0/+6
|\ | | | | service: vi: Implement CloseLayer.
| * service: vi: Implement CloseLayer.bunnei2020-01-041-0/+6
| | | | | | | | - Needed for Undertale.
* | video_core: Block in WaitFence.Markus Wick2019-12-301-1/+1
|/ | | | | | | This function is called rarely and blocks quite often for a long time. So don't waste power and let the CPU sleep. This might also increase the performance as the other cores might be allowed to clock higher.
* core_timing: Use better reference tracking for EventType. (#3159)bunnei2019-11-271-2/+2
| | | | | | | * core_timing: Use better reference tracking for EventType. - Moves ownership of the event to the caller, ensuring we don't fire events for destroyed objects. - Removes need for unique names - we won't be using this for save states anyways.
* kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for kernel objects. (#3154)bunnei2019-11-251-1/+1
| | | | | | * kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for kernel objects. - See https://github.com/citra-emu/citra/pull/4710 for details.
* Merge pull request #2912 from FernandoS27/async-fixesbunnei2019-10-161-3/+7
|\ | | | | General fixes to Async GPU
| * NvFlinger: Remove leftover from corrections and clang format.Fernando Sahmkow2019-10-051-4/+0
| |
| * NVFlinger: Reverse the change that only signaled events on buffer acquire.Fernando Sahmkow2019-10-051-18/+1
| | | | | | | | | | This has been hardware tested and it seems that NVFlinger will still signal even if there are no buffers to present.
| * NvFlinger: Don't swap buffers if a frame is missing and always trigger event in sync gpu.Fernando Sahmkow2019-10-051-1/+3
| |
| * GPU_Async: Correct fences, display events and more.Fernando Sahmkow2019-10-051-2/+19
| | | | | | | | | | | | | | This commit uses guest fences on vSync event instead of an articial fake fence we had. It also corrects to keep signaling display events while loading the game as the OS is suppose to send buffers to vSync during that time.
| * Nvdrv: Correct Async regression and avoid signaling empty buffer vsyncsFernando Sahmkow2019-10-051-1/+7
| |
* | nvflinger/buffer_queue: Remove use of a global system accessorLioncash2019-10-121-1/+1
|/
* RebaseDavid Marcec2019-09-221-11/+12
|
* Deglobalize System: ViDavid Marcec2019-09-221-5/+5
|
* Deglobalize System: NvFlingerDavid Marcec2019-09-221-5/+4
|
* NVServices: Styling, define constructors as explicit and correctionsFernando Sahmkow2019-07-051-4/+3
|
* NVFlinger: Correct GCC compile errorFernando Sahmkow2019-07-051-8/+8
|
* nvflinger: Make the force 30 fps still force 30 fpsFernando Sahmkow2019-07-051-1/+1
|
* nvflinger: Implement swap intervalsFernando Sahmkow2019-07-051-4/+10
|
* added a toggle to force 30fps modezarroboogs2019-04-091-6/+10
|
* core/core_timing: Make callback parameters consistentLioncash2019-03-241-2/+2
| | | | | | | | | | | In some cases, our callbacks were using s64 as a parameter, and in other cases, they were using an int, which is inconsistent. To make all callbacks consistent, we can just use an s64 as the type for late cycles, given it gets rid of the need to cast internally. While we're at it, also resolve some signed/unsigned conversions that were occurring related to the callback registration.
* gpu: Refactor command and swap buffers interface for asynch.bunnei2019-03-071-1/+1
|
* service/nvflinger: Store BufferQueue instances as regular data membersLioncash2019-02-221-5/+12
| | | | | | | The NVFlinger service is already passed into services that need to guarantee its lifetime, so the BufferQueue instances will already live as long as they're needed. Making them std::shared_ptr instances in this case is unnecessary.
* service/vi/vi_layer: Convert Layer struct into a classLioncash2019-02-211-4/+4
| | | | | | | Like the previous changes made to the Display struct, this prepares the Layer struct for changes to its interface. Given Layer will be given more invariants in the future, we convert it into a class to better signify that.
* service/nvflinger: Move display specifics over to vi_displayLioncash2019-02-211-33/+20
| | | | | | | | | With the display and layer structures relocated to the vi service, we can begin giving these a proper interface before beginning to properly support the display types. This converts the display struct into a class and provides it with the necessary functions to preserve behavior within the NVFlinger class.
* service/nvflinger: Relocate definitions of Layer and Display to the vi serviceLioncash2019-02-201-25/+19
| | | | | | | | | | | | | | | | | | | | | | These are more closely related to the vi service as opposed to the intermediary nvflinger. This also places them in their relevant subfolder, as future changes to these will likely result in subclassing to represent various displays and services, as they're done within the service itself on hardware. The reasoning for prefixing the display and layer source files is to avoid potential clashing if two files with the same name are compiled (e.g. if 'display.cpp/.h' or 'layer.cpp/.h' is added to another service at any point), which MSVC will actually warn against. This prevents that case from occurring. This also presently coverts the std::array introduced within f45c25aabacc70861723a7ca1096a677bd987487 back to a std::vector to allow the forward declaration of the Display type. Forward declaring a type within a std::vector is allowed since the introduction of N4510 (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4510.html) by Zhihao Yuan.
* core_timing: Convert core timing into a classLioncash2019-02-161-5/+5
| | | | | | | | | | | 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.
* core_timing: Rename CoreTiming namespace to Core::TimingLioncash2019-02-121-5/+5
| | | | | | 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.
* service/nvflinger,service/vi: Handle failure cases with exposed APILioncash2019-02-061-27/+63
| | | | | | | Converts many of the Find* functions to return a std::optional<T> as opposed to returning the raw return values directly. This allows removing a few assertions and handles error cases like the service itself does.
* service/nvflinger: Mark FindVsyncEvent() as a const member functionLioncash2019-02-051-1/+1
| | | | | This member function doesn't actually modify instance state, so it can be marked as a const member function.
* service/nvflinger: Rename GetVsyncEvent() to FindVsyncEvent()Lioncash2019-02-051-1/+1
| | | | | This was missed within #2075. Renames the member function to make it consistent with the rest of the Find* functions.
* service/nvflinger: Make FindBufferQueueId() a const member functionLioncash2019-01-301-1/+19
| | | | | This member function doesn't actually modify instance state, so it can be const-qualified.
* service/nvflinger: Rename Get prefix on function to FindLioncash2019-01-301-8/+8
| | | | | This more accurately describes what the function is actually attempting to do (it's not a simple trivial getter).
* nvflinger: Change log message in OpenDisplay to be a debug log instead of a warningLioncash2019-01-301-1/+1
| | | | | | | | | Opening a display isn't really a thing to warn about. It's an expected thing, so this can be a debug log. This also alters the string to indicate the display name better. Opening "Default" display reads a little nicer compared to Opening display Default.
* nvflinger: Remove unnecessary header inclusionsLioncash2019-01-301-2/+0
|
* nvflinger: Mark locals const where applicableLioncash2019-01-301-11/+11
| | | | Makes non-mutable state more explicit.
* nvflinger: Use a std::array for the available displays instead of std::vectorLioncash2019-01-301-6/+0
| | | | | The built-in set of displays is fixed, so we can utilize an array instead of a vector here.
* Fixed botw deadlock(and possibly 30 fps games rendering too fast? needs testing to confirm)David Marcec2019-01-031-1/+1
| | | | Upon investigating the issue with #1878, I found that games are the ones who handle the vsync event resetting and not us.
* kernel/event: Reference ReadableEvent from WritableEventZach Hilman2018-11-291-6/+4
|
* core: Port all current usages of Event to Readable/WritableEventZach Hilman2018-11-291-4/+9
|
* global: Use std::optional instead of boost::optional (#1578)Frederic L2018-10-301-6/+6
| | | | | | | | | | | | | | | | * get rid of boost::optional * Remove optional references * Use std::reference_wrapper for optional references * Fix clang format * Fix clang format part 2 * Adressed feedback * Fix clang format and MacOS build
* Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi2018-09-151-1/+1
|
* hle/service: Default constructors and destructors in the cpp file where applicableLioncash2018-09-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* core: Make the main System class use the PImpl idiomLioncash2018-08-311-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.
* kernel: Eliminate kernel global stateLioncash2018-08-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | As means to pave the way for getting rid of global state within core, This eliminates kernel global state by removing all globals. Instead this introduces a KernelCore class which acts as a kernel instance. This instance lives in the System class, which keeps its lifetime contained to the lifetime of the System class. This also forces the kernel types to actually interact with the main kernel instance itself instead of having transient kernel state placed all over several translation units, keeping everything together. It also has a nice consequence of making dependencies much more explicit. This also makes our initialization a tad bit more correct. Previously we were creating a kernel process before the actual kernel was initialized, which doesn't really make much sense. The KernelCore class itself follows the PImpl idiom, which allows keeping all the implementation details sealed away from everything else, which forces the use of the exposed API and allows us to avoid any unnecessary inclusions within the main kernel header.
* nvdrv: Get rid of global std::weak_ptrLioncash2018-08-081-3/+4
| | | | | Rather than use global state, we can simply pass the instance into the NVFlinger instance directly.
* Merge pull request #957 from lioncash/eventbunnei2018-08-071-1/+1
|\ | | | | nvflinger: Correct typo in name of composition event
| * nvflinger: Correct typo in name of composition eventLioncash2018-08-071-1/+1
| |
* | nvflinger: Get rid of indirect inclusionsLioncash2018-08-071-0/+3
| |
* | nvflinger: Use std::string_view in OpenDisplay()Lioncash2018-08-071-1/+1
|/ | | | | | We don't need to use a std::string here, given all that's done is comparing the character sequence against another. This allows passing regular const char* without needing to heap allocate.
* video_core: Eliminate the g_renderer global variableLioncash2018-08-041-2/+4
| | | | | | | | | | | | | | 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.
* core_timing: Split off utility functions into core_timing_utilMerryMage2018-07-241-0/+1
|
* nvflinger: Emplace Display instances directlyLioncash2018-07-191-9/+4
| | | | | | | We can use emplace_back to construct the Display instances directly, instead of constructing them separately and copying them, avoiding the need to copy std::string and std::vector instances that are part of the Display struct.
* vi: Partially implement buffer crop parameters.bunnei2018-07-181-1/+2
|
* nvflinger: Fix for BufferQueue event handling.bunnei2018-07-171-3/+0
|
* Rename logging macro back to LOG_*James Rowe2018-07-031-1/+1
|
* core_timing: Namespace all functions and constants in core_timing's headerLioncash2018-04-301-1/+1
| | | | All of these variables and functions are related to timings and should be within the namespace.
* nvflinger: Move logging macros over to new fmt-compatible onesLioncash2018-04-241-1/+1
|
* service: Use nested namespace specifiers where applicableLioncash2018-04-201-4/+2
| | | | Tidies up namespace declarations
* nvflinger: Call MicroProfileFlip on NVFlinger::Compose.bunnei2018-04-191-0/+3
|
* Vi: Signal the BufferQueue's Native Handle right after ReleaseBuffer is called.Subv2018-03-031-0/+3
| | | | | This prevents a thread starvation issue in Puyo Puyo Tetris. We should hwtest this behavior and figure out where exactly this event is signaled.
* Fix fps counter to correctly measure frame end when there was no frame to drawJames Rowe2018-02-141-0/+2
|
* vi: Parse IGBPQueueBufferRequestParcel params and expose buffer flip vertical.bunnei2018-02-121-1/+1
|
* VI: Move BufferQueue and NVFlinger to their own folder/namespace.Subv2018-01-221-0/+161