Commit Graph

831 Commits

Author SHA1 Message Date
sspacelynx
6135f531ae Add refreshRequired xml attribute in IntegerListPreference
This attribute controls whether a rom list refresh will be triggered when the setting value changes.
2021-09-30 02:19:19 +05:30
sspacelynx
221039084e Make languages setting use IntegerListPreference 2021-09-30 02:19:19 +05:30
sspacelynx
c1a3ddcd1c Implement an IntegerListPreference
Unlike `ListPreference`, this preference class uses integers as its values instead of strings, avoiding unnecessary casting. It also doesn't require an array for values: in that case it will be using the clicked entry position as its value.
2021-09-30 02:19:19 +05:30
sspacelynx
fdc7e1238a Implement language support for rom loaders 2021-09-30 02:19:19 +05:30
sspacelynx
3c5509e52a Update available languages to those post 10.1.0
Brazilian Portuguese has been added in firmware version 10.1.0
2021-09-30 02:19:19 +05:30
sspacelynx
3fffde3061 Rework OS to allow passing a language 2021-09-30 02:19:19 +05:30
Billy Laws
a4a6511177 Address feedback 2021-09-30 02:11:19 +05:30
Billy Laws
a18f1aa889 Address feedback 2021-09-30 02:11:19 +05:30
Billy Laws
8db2cf29f2 Implement AsGpu::FreeSpace and clean up locking and debug prints 2021-09-30 02:11:19 +05:30
Billy Laws
d3dc0bddc4 Cleanup IStorageAccessor validation code 2021-09-30 02:11:19 +05:30
Billy Laws
39faa739b9 Optimise GPFIFO command processing for higher throughput
Using a u32 for the loop index prevents masking on all increments,
giving a moderate performance increase.

Passing methods as u32 parameters and stopping subChannel being passed
gives quite a significant increase when combined with the inlining
allowed by subchannel based engine selection.
2021-09-30 02:11:19 +05:30
Billy Laws
3d538a29da Misc code cleanup and more comments in AS map 2021-09-30 02:11:19 +05:30
Billy Laws
30d41252f7 Use IPC raw data size to calculate C Buffer offset
Some games don't have a u16 size array, the code for this is also kinda
pointless when we can use the raw data size too.
2021-09-30 02:11:19 +05:30
Billy Laws
d03b288db6 NEEDS CLEANUP: Reimplement GPU VMM and rewrite nvdrv VM impl 2021-09-30 02:11:19 +05:30
Billy Laws
020aa0e43a Add support for Ioctl2/3 and improve debug logging 2021-09-30 02:11:19 +05:30
Billy Laws
15db64671f Update CMakeLists for nvdrv rework 2021-09-30 02:11:19 +05:30
Billy Laws
9bda574a4e Move nvhost-ctrl-gpu to new device API 2021-09-30 02:11:19 +05:30
Billy Laws
39492d9365 Move nvhost-gpu to new device API
The implementation of GPU channels and Host1X channels will be split up
as it allows a much cleaner implementation and less undefined behaviour
potential.
2021-09-30 02:11:19 +05:30
Billy Laws
3d4f7d9b44 Move nvhost-as-gpu to new device API 2021-09-30 02:11:19 +05:30
Billy Laws
1149158198 Make GraphicBufferProducer use the new nvmap API 2021-09-30 02:11:19 +05:30
Billy Laws
c97f5a9315 Entirely rewrite nvmap to separate global and per device state.
This will be required later for NVDEC/SMMU support and fixes many
significant issues in the previous implementation.
Based off of my 2.0.0/12.0.0 nvdrv REs.
2021-09-30 02:11:19 +05:30
Billy Laws
78356fa789 Migrate syncpoint management over to the new device API
The syncpoint manager has beeen given convinience functions for fences
which remove the need to access the raw id/threshold most of the time
and various accuracy fixes and cleanups to match HOS 12.0.0 have also
been done.
2021-09-30 02:11:19 +05:30
Billy Laws
a19bf973b1 Rework the nvdrv core for accuracy and support new deserialisation
Devices will need to be moved over in order to support this new
interface, IOCTL2/3 support will be added in a later commit.
2021-09-30 02:11:19 +05:30
Billy Laws
db2abe2290 Use concepts for Backing::Read over enable_if 2021-09-30 02:11:19 +05:30
Billy Laws
3340c74332 Implement efficient template based IOCTL deserialisation
This moves IOCTLs from frozen to a template based parser, this allows
IOCTL lookup to be performed much more optimally and some IOCTLs to be
inlined.
2021-09-30 02:11:19 +05:30
Billy Laws
75a67dcfa5 Allow supplying a custom ResultValue result type and optimise span
This allows PosixResultValue to be created easily.
2021-09-30 02:11:19 +05:30
Billy Laws
3d3c13f90c Add common PosixResult and PosixResultValue types
Many services like bsd and nvdrv use these to represent the result
values of functions so add a common type for these as an alternative to
the macros.
2021-09-30 02:11:19 +05:30
sspacelynx
14dc42b991 Add IntegerFor template class + Update GenerateUuidV4 2021-09-22 06:24:05 +05:30
sspacelynx
ea3c7301b1 Make UUID::GenerateUuidV4 use util::GetRandomBytes 2021-09-22 06:24:05 +05:30
sspacelynx
10d43c88c9 csrng service implementation
Implements the 'csrng:' service using C++ <random>'s Mersenne Twister, this does make it insecure for cryptographic purposes but it is pointless to attempt to do this regardless as we cannot ensure that the guest will run in a secure environment which cannot be mutated by an attacker. Used by Prison Princess, Pokemon Cafe Mix, Paint your Pet and more.
2021-09-22 06:24:05 +05:30
sspacelynx
9d4aee57a5 Add runConfigurations to gitignore 2021-07-19 02:07:12 +05:30
sspacelynx
06674b3d07 hwopus decoder service implementation 2021-07-19 02:07:12 +05:30
sspacelynx
3de4c3e32e Add Opus submodule 2021-07-19 02:07:12 +05:30
PixelyIon
b533801bbe Fix Scheduler Core Migration Deadlock
Encountered in 不如帰大乱 when `HOS-3` is awoken at the same time as `HOS-0` called `SvcSetThreadCoreMask` resulting in a deadlock where `HOS-0` owns `HOS-3`'s `coreMigrationMutex` while `HOS-3` owns the core mutex with the both of them attempting to lock the other mutex
2021-07-12 21:27:49 +05:30
PixelyIon
dba99ce542 Implement IApplicationDisplayService::ConvertScalingMode
Utilized by アイリス魔法学園
2021-07-12 21:27:49 +05:30
PixelyIon
1ad5ea6867 Move Mbed TLS to submodule + Update Java Libraries
We've moved from using an AAR for Mbed TLS to a submodule as the AAR was packaged manually and used from a local repository which ended up being very hacky and resulted in Linter errors, it could also not be updated with ease as it would need to be repackaged. All of these issues have been solved by moving to a git submodule tied to the official Mbed TLS GitHub repository.
2021-07-12 21:27:49 +05:30
PixelyIon
ec1da1b3f5 Address CR Comments + Increase minSdkVersion to 29 (Android 10) 2021-07-12 21:27:49 +05:30
PixelyIon
19be9f4b66 Support Sticky Transforms + Minor Formatting Fixes
Sticky transforms have been stubbed, as they are on HOS/Android. Certain titles like Xenoblade Chronicles end up setting the sticky transform even if it doesn't do anything, as a result of this we cannot throw an exception for it and stub it without an exception (Aside from the cases where the value isn't recognized).
2021-07-12 21:27:49 +05:30
PixelyIon
9f967862bd Implement additional IGraphicBufferProducer transactions
The following GraphicBufferProducer transactions were implemented:
* `SetBufferCount`
* `DetachBuffer`
* `DetachNextBuffer`
* `AttachBuffer`
It should be noted that `preallocatedBufferCount` (previously `hasBufferCount`) and `activeSlotCount` were adapted accordingly with how they were effectively the same value as all active buffers were preallocated prior but now there can be a non-preallocated active slot. 
Additionally, a bug has been fixed where `SetPreallocatedBuffer` has the graphic buffer as an optional argument whereas it was treated as a mandatory argument prior and could lead to a SEGFAULT if an application were to not pass in a buffer.
2021-07-12 21:27:49 +05:30
PixelyIon
0d6d90c4cd Implement SvcUnmapSharedMemory + Remove Redundant [[unlikely]] 2021-07-12 21:27:49 +05:30
PixelyIon
f1433ad0d9 Rework VI + IHOSBinder
VI/IHOSBinder suffered from major inaccuracies in their function due to being quickly thrown together initially with little concern for accuracy, this has now been fixed with them being substantially more accurate now.
2021-07-12 21:27:49 +05:30
PixelyIon
ca4744c603 Improve ENUM_STRING + Fix Host1X Syncpoints
`ENUM_STRING` now has a unified implementation in <common/macros.h> with a documented format and can be used throughout the codebase. 

A major performance regression was added in the Host1X Syncpoint revamp as it did a syscall if there were any waiters during `Increment` even if they would just be woken up and go back to sleep as the threshold wasn't hit. It has now been optimized to only do a wake if any waiting thread needs to be awoken. 

There was also a bug concerning increment where it would perform actions corresponding to the previous increment rather than the current one which has also been fixed.
2021-07-12 21:27:49 +05:30
PixelyIon
6595670a5d Rework Performance Statistics
We used instantaneous values for FPS previously which led to a lot of variation in it and the inability to determine a proper FPS value due to constant fluctuations. All FPS values are now averaged to allow reading out a stable value and a deviation statistic has been added for the frame-time to judge judder and frame-pacing which allows for a significantly better measure of overall performance. The formatting for all the floating-point numbers is now fixed-point to prevent shifting of position due to decimal digits becoming 0.
2021-07-12 21:27:49 +05:30
PixelyIon
ce804254ab Support Swap Interval + Cropping + Transforms and more for QueueBuffer
Support for the following parameters was added to `QueueBuffer`:
* Earliest Present Timestamp
* Swap Interval
* Crop
* Scaling Mode
* Transform
* Frame ID (Not returned to guest yet)
We utilize ANativeWindow APIs directly to achieve all of this in an efficient manner since HWC will be used directly for it, we do plan to introduce Vulkan equivalents for all of these operations later down the line for a port to non-Android platforms.
2021-07-12 21:27:49 +05:30
PixelyIon
2e8ce2cbaf Update C++ Libraries 2021-07-12 21:27:49 +05:30
PixelyIon
6854e07356 Replace LogActivity with "Share Logs" + Add Timestamp to Logger 2021-07-12 21:27:49 +05:30
PixelyIon
e511e158e3 Implement Display Settings + Attach Texture to FenceCycle 2021-07-12 21:27:49 +05:30
PixelyIon
b2bb855a02 Revamp Host1X Syncpoint + Address Review Comments 2021-07-12 21:27:49 +05:30
PixelyIon
216e5cee81 Separate Guest and Host Presentation + AChoreographer V-Sync Event
We had issues when combining host and guest presentation since certain configurations in guest presentation such as double buffering were very unoptimal for the host and would significantly affect the FPS. As a result of this, we've now made host presentation have its own presentation textures which are copied into from the guest at presentation time, allowing us to change parameters of the host presentation independently of the guest.

We've implemented the infrastructure for this which includes being able to create images from host GPU memory using VMA, an optimized linear texture sync and a method to do on-GPU texture-to-texture copies.

We've also moved to driving the V-Sync event using AChoreographer on its on thread in this PR, which more accurately encapsulates HOS behavior and allows games such as ARMS to boot as they depend on the V-Sync event being signalled even when the game isn't presenting.
2021-07-12 21:27:49 +05:30
PixelyIon
36547cd5dc Redesign Texture Class + Improve Presentation Engine
This commit reworks the `Texture` class to include a Vulkan Image backing that can be optionally owning or non-owning and swapped in with consideration for Vulkan image layout, it also adds CPU-sided synchronization for the texture objects with FenceCycle. It also makes the appropriate changes to `PresentationEngine` and `GraphicBufferProducer` to work with the new `Texture` class while setting the groundwork for supporting swapchain recreation. It also fixes a log in `IpcResponse` and improves the display mode selection algorithm by further weighing refresh rate.
2021-07-12 21:27:49 +05:30