Commit graph

53 commits

Author SHA1 Message Date
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
kd-11 ee009ec99c rsx: Robustness fixes
- Track last working state and reset to it if RSX starts to desync
-- This is especially useful when running vulkan since the renderer will easily outpace the rest of the system when merely recording draw commands
- Ignore empty sets
-- Mark empty/invalid IB sets as having 0 element counts.
2018-01-02 21:17:56 +03:00
kd-11 0d0821e914 rsx: Pause FIFO queue when changing ctrl registers 2017-12-18 10:45:37 +03:00
Jake e0d1ac676e rsx: invalidate surface store address when tile is unbound 2017-10-28 12:46:20 +03:00
Jake 626b9f93c4 rsx: make dmactrl get 'readonly' 2017-10-28 12:46:20 +03:00
Robbie d5fb7180d0 HGA calls sys_rsx_context_attribute before calling sys_rsx_memory_allocate. This inevitably causes RPCS3 to crash. Add nullptr check to prevent this. 2017-09-18 21:24:13 +01:00
kd-11 8358bda133 gl/rsx: Fixes to zcull pixel counting 2017-08-26 21:53:54 +03:00
kd-11 fcb7072fee Implement hardware zcull emulation
rsx/gl: Support s1 immediate values; ogl minor refactoring
2017-08-06 14:29:42 +03:00
Jake 21dd715b42 sys_rsx: implement support for lle-gcm 2017-08-02 01:33:12 +03:00
Nekotekina 88fef183a3 config.yml: Log section optimized 2017-05-15 14:37:05 +03:00
scribam 49ba4bbfb5 Typo 2017-04-10 02:39:52 +03:00