Commit graph

77 commits

Author SHA1 Message Date
Eladash 6210507a37 sys_rsx: Fix tiles on MAIN memory error checking 2020-04-18 10:20:03 +03:00
Eladash e407018bb5 rsx: Write ref+get atomically
May contribute to better FIFO synchronization in some cases.
2020-04-11 21:21:15 +03:00
Eladash d69bec8f59 rsx: Fix vblank thread stop regression 2020-04-11 21:21:15 +03:00
Eladash 504ba8d824 rsx: Fix grammer issue (binded -> bound) 2020-04-11 21:21:15 +03:00
Eladash 8228fa1ece sys_rsx: Warn if RSX is not idle during crucial points 2020-04-11 21:21:15 +03:00
Eladash 1f9f455801 sys_rsx: Implement error checks for Zcull/Tiles binding
* Check zcull/tiles offset if bigger than max MAIN/LOCAL size.
* Check memory mapping of offset if location is MAIN.
* Check pitch/size for 0 as coming from hw tests.
* In addition: fix 'bound' check of tiles, seem to rely on the bits location is in.
* Add locks for zcull/tiles/displaybuffer binding.
2020-04-11 21:21:15 +03:00
Eladash 5ba26e247b sys_rsx: Implement LLE cellGcmSysGetLastVBlankTime 2020-04-11 21:21:15 +03:00
Eladash 995fa63f4c sys_rsx: Fixup after #7978 2020-04-08 11:33:26 +03:00
Eladash f7536bbce0 sys_rsx: Fix gcm events spam
In realhw the events are only sent if they are masked in driver_info->handlers as well.
2020-04-07 20:43:28 +03:00
Eladash 3f48450408 sys_rsx: Minor atomicity fixes 2020-04-07 20:43:28 +03:00
Eladash fdd7f0645d
Some typos (#7908)
* sys_lwcond: replace writer lock with reader lock

* sys_rsx: Typo fix

* sys_net: Fixup for buffer reading
2020-03-31 16:44:50 +03:00
Eladash 29be815302
rsx: Implement DECR memory layout (#7906) 2020-03-31 05:12:30 +01:00
Nekotekina Aux1 250736ece5 Fix warnings in emucore 2020-03-04 21:23:34 +03:00
Megamouse fe75311be2 move config structs to own files and clean up some headers 2020-02-17 15:08:17 +03:00
Eladash bdab26ec09 rsx: rewrite io mappings
Along with some with fixes to cellGcmSys HLE.
2020-02-10 21:39:39 +00:00
Nekotekina 15391f45d0 Modernize RSX logging (rsx_log variable) 2020-02-01 11:52:22 +03:00
Eladash 1ccb3c4492 rsx: Verify local memory offset 2020-01-15 13:23:56 +03:00
Nekotekina 28eacc616a C-style cast cleanup III 2019-12-01 00:32:44 +03:00
Eladash cbecbc264e cellGcm: Fix driver_info->memory_size
based hw test
2019-10-21 15:31:45 +03:00
eladash 730e9cde84 sys_rsx: Improve allocations and error checks
* allow sys_rsx_device_map to be called twice: in this case the DEVICE address retrived from the previous call returned
* Add ENOMEM checks for sys_rsx_memory_allocate and sys_rsx_context_allocate
* add EINVAL check for sys_rsx_context_allocate if memory handle is not found
* Separate sys_rsx_device_map allocation from sys_rsx_context_allocate's
* Implement sys_rsx_memory_free; used by cellGcmInit upon failure
* Added context_id checks
* Throw if sys_rsx_context_allocate was called twice.
2019-10-21 15:31:45 +03:00
Eladash 9e929a25d4 rsx: Default initailize zcull reports padding 2019-10-05 15:00:50 +03:00
Eladash 7f725e0655 sys_rsx: Format special sys_rsx invalid param error, warning fixes 2019-09-28 03:16:01 +03:00
kd-11 2c76f47eec rsx: Restructure flip code and frame scoping
- Add an explicit frame scope marker tied in with the queue_prepare command
  Since queue_prepare is emitted at the end of a frame, it can be used as end-of-frame in games that emit this
- If this command is not emitted, fifo flatenner and frameskip will not work
2019-09-19 23:10:09 +03:00
Nekotekina 38a06c4b14 Use g_fxo for SysRsxConfig
Rename to lv2_rsx_config
2019-08-27 03:50:15 +03:00
Nekotekina f8f3067deb Always check page_allocated in vm::check_addr 2019-08-14 20:28:34 +03:00
Eladash 25e47e0de0 Fix vm::check_addr memory state check 2019-08-10 19:47:37 +03:00
Eladash 997e3046e3 vm/sys_overlay Improvements
- Implement sys_overlay_load_module_by_fd.
- Implement special segment allocation when ppc_seg flag is specified.
2019-07-28 14:23:58 +03:00
Eladash c53f0dd7b5 rsx: Fix gcm unmap events 2019-07-26 21:27:55 +03:00
Eladash d17be2c2ec Fix similar bug in sys_rsx_context_iomap
TODO: Is there an rsxmem unmap event for those cases?
2019-07-22 15:16:43 +03:00
Eladash cf4d715284 typo fix (to squash) 2019-07-22 15:16:43 +03:00
Eladash 2b721b9e29 correctness fix
Not that it really matters because of gcm's lwmutex but just in case the syscall is useb directly.
2019-07-22 15:16:43 +03:00
Eladash 492c9e3c7c Fix sys_rsx_context_iounmap partial unmapping 2019-07-22 15:16:43 +03:00
Eladash c4d8ef4340 rsx: Allow to configure vblank rate
Removed "HLE protection" hack from sys_rsx_context_attribute
2019-07-12 00:19:56 +03:00
Eladash 43f919c04b Fixup after #6143 (#6146)
vm::spu max address was overflowing resulting in issues, so cast to u64 where needed. Fixes #6145.
    Use vm::get_addr instead of manually substructing vm::base(0) from pointer in texture cache code.
    Prefer std::atomic_thread_fence over _mm_?fence(), adjust usage to be more correct.
    Used sequantially consistent ordering in semaphore_release for TSX path as well.
    Improved memory ordering for sys_rsx_context_iounmap/map.
    Fixed sync bugs in HLE gcm because of not using atomic instructions.
    Use release memory barrier in lwsync for PPU LLVM, according to this xbox360 programming guide lwsync is a hw release memory barrier.
    Also use release barrier where lwsync was originally used in liblv2 sys_lwmutex and cellSync.
    Use acquire barrier for isync instruction, see https://devblogs.microsoft.com/oldnewthing/20180814-00/?p=99485
2019-06-29 18:48:42 +03:00
Eladash 1ee7b91646 Refactoring (#6143)
Prefer vm::ptr<>::ptr over vm::get_addr.
    Prefer vm::_ptr/base over vm::g_base_addr with offset.
    Added methods atomic_t<>::bts and atomic_t<>::btr .
    Removed obsolute rsx:🧵:Read/WriteIO32 methods.
    Removed wrong check in semaphore_release.
    Added handling for PUTRx commands for RawSPU MFC proxy.
    Prefer overloaded methods of v128 instead of _mm_... in VPKSHUS ppu interpreter precise.
    Fixed more potential overflows that may result in wrong behaviour.
    Added io/size alignment check for sys_rsx_context_iounmap.
    Added rsx::constants::local_mem_base which represents RSX local memory base address.
    Removed obsolute rsx:🧵:main_mem_addr/ioSize/ioAddress members.
2019-06-29 01:27:49 +03:00
Lassi Hämäläinen c963c51a60 Remove unnecessary header includes
- Manually removed lot of unneeded #includes to clean code and reduce
  compilation time
- Reordered some of the #includes to be in more logical order
2019-06-25 17:11:10 +03:00
Ivan 0fe26f8293 Add sys_rsx_context_iomap workaround
Don't fail with CELL_EINVAL on vm::main.
2019-06-17 01:17:02 +03:00
eladash 6f76e34104 rsx: Fix race on clearing native_ui vs emu_requested flag 2019-04-20 01:04:41 +03:00
eladash f25587d24c rsx: Write vblank semahpre, minor semaphore acquire optimization 2019-04-20 01:04:41 +03:00
eladash 7470388e5a Use error_code in sys_rsx 2019-03-08 23:44:46 +03:00
elad fc253165e2 Correctness fix for RSXIOMem
- Make RSXIOMem volatile.
- Hint the compiler to check only once the address returned.
2019-03-08 23:44:46 +03:00
eladash e38b7aee5a check address in sys_rsx_context_iomap
* Fix 0 vm page flags to behave like 1m flags, follows c8a681e60
* check if address exists and valid for rsx io allcations (must be allocated on 1m pages)
2019-03-05 21:23:24 +03:00
kd-11 504ab5a6d4 rsx: Minor cleanup to silence stupid compiler warnings 2018-12-03 20:01:23 +03:00
kd-11 e01d2f08c9 rsx: Refactor FIFO
- Removes fifo structures from common RSXThread
- Sets up a dedicated FIFO controller
- Allows for configurable queue optimizations
2018-11-30 23:51:25 +03:00
eladash 5ee351234c rsx-capture: unbreak 2018-10-23 18:02:03 +03:00
elad 623f1b35f6 rsx_capture/gcm: Fix tile binding (#5246)
* gcm: Fix tile offset setting

highest bit signifyies location, so ignore that while reading the offset.

* rsx-capture: Fix tile binding

fixes division by zero when dividing by pitch when the tile is not bound.

* rsx-capture: Fix zcull binding
2018-10-12 19:05:08 +03:00
eladash 4174d7274d sys_rsx: fix log spam 2018-10-03 20:57:46 +03:00
kd-11 a3d44b5e1f rsx: Cleanup changes for the flip patch 2018-09-24 16:44:02 +03:00
Jake 699eadc84f rsx: Move render flip from rsx queue command to flip command 2018-09-24 16:44:02 +03:00
eladash 1a6c819176 cellgcm: Fix SET_REFERENCE initial value 2018-09-20 01:05:40 +03:00