Commit graph

63 commits

Author SHA1 Message Date
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
Nekotekina 7bccdbf157 Make vm::var unmoveable
Fix bugs with discarding vm::make_var result
2018-09-03 21:40:36 +03:00
Nekotekina 363811981d Reintroduce LOG_CHANNEL
Groundwork for further improvements
2018-08-25 15:39:00 +03:00
eladash 158019b50f Rsx: fix translation when address is negative
move address shift to where it should be, extend io table to catch all possible values.
2018-08-22 12:20:31 +03:00
Nekotekina aa4040bb7b Implement vm::find_map; improve memory allocation
Add vm::user64k and vm::user1m constants
Remove vm::user_space, unreserve it
2018-08-14 15:14:06 +03:00
eladash 449888b9db Rsx/vm: fix base addresses 2018-08-13 16:16:34 +03:00
eladash f349695a75 Rsx: rewrite address translation 2018-08-13 16:16:34 +03:00
eladash 745ed8331c Fix sys_rsx_context_iounmap args 2018-08-11 18:14:35 +04:00
eladash b456955688 rsx: fix hardcoded rsx allocation address 2018-06-24 10:57:30 +03:00
eladash 23b380eb41 allow deallocations to unmap rsx mapped memory 2018-05-29 19:57:28 +03:00
eladash 97515a0941 sys_rsx/cellgcm: return EINVAL if the io map requast's size is 0 2018-05-29 19:57:28 +03:00
eladash 0a7902d313 sys_rsx: fix mem_handle id 2018-05-29 19:57:28 +03:00
eladash 8eab9fe36c sys_rsx: fix unused pointer dereferencing 2018-05-29 19:57:28 +03:00
kd-11 8fcd5c1e5a rsx: Texture cache fixes
1. rsx: Rework section synchronization using the new memory mirrors
2. rsx: Tweaks
    - Simplify peeking into the current rsx::thread instance.
      Use a simple rsx::get_current_renderer instead of asking fxm for the same
    - Fix global rsx super memory shm block management
3. rsx: Improve memory validation. test_framebuffer() and
tag_framebuffer() are simplified due to mirror support
4. rsx: Only write back confirmed memory range to avoid overapproximation errors in blit engine
5. rsx: Explicitly mark clobbered flushable sections as dirty to have them
removed
6. rsx: Cumulative fixes
    - Reimplement rsx::buffered_section management routines
    - blit engine subsections are not hit-tested against confirmed/committed memory range
      Not all applications are 'honest' about region bounds, making the real cpu range useless for blit ops
2018-05-23 19:07:08 +03:00
Nekotekina cce0ad0c35 Clean vm::ps3 namespace use 2018-02-09 17:49:37 +03:00