Commit graph

83 commits

Author SHA1 Message Date
Nekotekina 87af905018 Enable -Wunused-parameter 2021-03-06 18:07:08 +03:00
Nekotekina 038148bf06 Fix almost all GCC warnings 2021-02-17 22:59:04 +03:00
Eladash f43260bd58
Atomic waiting refactoring (#9208)
* Use atomic waitables instead instead of global thread wait as often as possible.
* Add ::is_stopped() and and ::is_paued() which can be used in atomic loops and with atomic wait. (constexpr cpu flags test functions)
* Fix notification bug of sys_spu_thread_group_exit/terminate. (old bug, enhanced by #9117)
* Function time statistics at Emu.Stop() restored. (instead of current "X syscall failed with 0x00000000 : 0")
2021-02-13 17:50:07 +03:00
Nekotekina d0126f0fa0 Fix freezes in HLE Vdec and SPU LLVM precompilation.
Freezes could accidentally occur on close or ingame.
Deprecate range-for loop on lf_queue.
This is a part of PR #9208

Co-authored-by: Eladash <elad3356p@gmail.com>
2021-02-01 19:14:01 +03:00
Nekotekina db8e6fe7a7 Enable -Wunused-variable 2021-01-12 14:34:14 +03:00
Megamouse 36159c2bd4 Add comment for deprecated avcodec_register_all
Apparently this is now done automatically and doesn't even need to be called at all
2021-01-08 14:36:49 +03:00
Nekotekina eec11bfba9 Move align helpers to util/asm.hpp
Also add some files:
GLTextureCache.cpp
VKTextureCache.cpp
2020-12-18 18:07:42 +03:00
Nekotekina 36c8654fb8 Remove HERE macro
Some cleanup.
Add location to some functions.
2020-12-10 12:30:22 +03:00
Nekotekina e055d16b2c Replace verify() with ensure() with auto src location.
Expression ensure(x) returns x.
Using comma operator removed.
2020-12-09 15:43:38 +03:00
RipleyTom af8c661a64 Remove BOM markers 2020-12-06 15:30:12 +03:00
scribam f37adc4188 Add fallthrough attribute 2020-04-14 17:06:58 +03:00
Eladash 7e224c5585 cellVdecClose: Followup fix to #7663
Avoid executing sys_interrupt_thread_disestablish on different ppu thread with the same ID.
2020-03-16 21:06:33 +03:00
Eladash c16124f0d9 idm: Fix minor race in cellVdecClose, sys_raw_spu_destroy...
Because of racing removal of IDs vs the shared pointer owned object
2020-03-14 18:30:14 +02:00
Nekotekina 1dc2eb1cc8 Avoid deprecated av_register_all with version check. 2020-02-23 20:58:02 +03:00
Emmanuel Gil Peyrot 1a702de9e4 cellVdec: replace deprecated ffmpeg function
avcodec_decode_video2() is deprecated, now replaced with
avcodec_send_packet() and avcodec_receive_frame().
2020-02-23 20:21:59 +03:00
Nekotekina f1241c572c Fix some deprecation warnings (plunder cellAdec btw) 2020-02-23 20:21:59 +03:00
Nekotekina 92e3eaf3ff Fix signed-unsigned comparisons and mark warning as error (part 2). 2020-02-19 22:54:58 +03:00
Megamouse fe75311be2 move config structs to own files and clean up some headers 2020-02-17 15:08:17 +03:00
Eladash 49e11b7cfd cellVdecQueryAttrEx: Add some error checks for MPEG2 2020-02-05 05:01:07 +00:00
Eladash 6a32ceaab5 cellVdecQueryAttrEx: Add workaround for codec specific info 2020-02-05 05:01:07 +00:00
Eladash acc7320cae Fix cellVdecGetPicItem
Fix potential overflow, race condition and correctness fixes for picInfo_addr
2020-02-05 05:01:07 +00:00
Eladash e57c01907e cellVdec: Improve cellVdecQuery and cellVdecOpen 2020-02-02 09:01:32 +03:00
Eladash 949cfa7fdb Fix cellVdecSetFrameRate error check 2020-01-21 16:45:41 +03:00
Megamouse 5ef3465f65 cellVdec: (experimental) allow AV_PIX_FMT_YUVJ420P 2020-01-20 00:33:25 +01:00
Megamouse 9a27cc9442 cellVdec: improve error checks 2020-01-20 00:33:25 +01:00
Eladash 9084209cfc Update cellVdecSetFrameRate error checking 2020-01-15 23:29:32 +01:00
Megamouse ef6f565dbd silence some annoying warnings 2019-12-28 15:40:57 +01:00
Eladash db4041e079 Implement rounded_div
Round-to-nearest integral based division, optimized for unsigned integral.
Used in sceNpTrophyGetGameProgress.
Do not allow signed values for aligned_div(), align().
2019-12-20 14:47:04 +03:00
Nekotekina 835892aa51 C-style cast cleanup VII 2019-12-05 02:10:15 +03:00
Nekotekina 185c067d5b C-style cast cleanup V 2019-12-03 17:23:00 +03:00
MSuih f3ed26e9db Small warnings cleanup (#6671)
* Ignore more warnings

These are intentional

* Signed/unsigned mismatch when comparing

* Explictly cast values

* Intentionally discard a nodiscard value

* Change ppu_tid to u32

* Do not use POSIX function name on Windows

* Qt: Use horizontalAdvance instead of width

* Change progress variables to u32
2019-10-25 13:32:21 +03:00
Nekotekina ac712bf4e3 lf_queue: remove explicit notify(), notify in push() instead
Should be cheap enough now if there are no waiters.
2019-10-12 22:45:17 +03:00
Nekotekina 5624b001ae lf_queue: add range-for support (endless loop with waiting) 2019-10-12 22:37:52 +03:00
Nekotekina 16dd72b3e3 Replace some uses of Emu.IsStopped()
Poll thread state instead.
2019-10-12 21:12:47 +03:00
Nekotekina b91661ae71 Remove timeout support from lf_queue::wait
Add notify method and use atomic wait
2019-09-10 19:25:39 +03:00
Megamouse aa262889f2 cellVdec: add error_code 2019-09-08 20:54:43 +03:00
Eladash a4896eb6df Fix race on cellVdecClose TLS cleanup 2019-08-13 04:56:00 +03:00
Eladash 30c72b105e Fix race on notifying vdec thread in cellVdecGetPicture
Can dereference nullptr if cellVdecClose was called simultaneously.
2019-08-13 04:56:00 +03:00
Eladash 96527eee5b idm: Fix bug in ID searching
* ID checking now checks if (id % step) == 0
* Extend possible ID range to allow UINT32_MAX (as long as base is non-zero)
2019-08-11 21:43:13 +03:00
Nekotekina 31994dd3b2 Rename cond_one to unique_cond
Remove redundant in_cv in cellVdec
2019-06-02 23:22:16 +03:00
Nekotekina f40320bcae Fix cellVdecOpen
Use pseudo-address in sys_ppu_thread_create calls
2019-04-11 21:20:22 +03:00
scribam f30af3ccd2 hle: Add more missing functions 2019-04-07 23:31:15 +03:00
eladash 1ed2055ec1 Fix cellVdecGetPicItem element popping behaviour 2019-03-31 14:57:21 +03:00
eladash f2bbae9db4 Remove handle in cellVdecClose 2019-03-31 14:57:21 +03:00
eladash 8eb59271a5 Improve error checking of cellVdecOpen
Those are the initial argument checks done by the firmware
2019-03-31 14:57:21 +03:00
Nekotekina c5026f7109 cellVdec: fix minor race 2019-01-14 01:24:05 +03:00
Nekotekina 435f60d503 lf_queue: add iterator support
Allow range-for loop over an object returned by `pop_all()`
2019-01-13 14:45:36 +03:00
RipleyTom f4fb5200a0 cellVdecGetPicture accurate error checking 2018-11-15 20:06:49 +03:00
Nekotekina 6104685ad6 Implement cond_one sync primitive
Change futex() args to use unsigned int
2018-11-05 13:14:11 +03:00
Nekotekina 1b37e775be Migration to named_thread<>
Add atomic_t<>::try_dec instead of fetch_dec_sat
Add atomic_t<>::try_inc
GDBDebugServer is broken (needs rewrite)
Removed old_thread class (former named_thread)
Removed storing/rethrowing exceptions from thread
Emu.Stop doesn't inject an exception anymore
task_stack helper class removed
thread_base simplified (no shared_from_this)
thread_ctrl::spawn simplified (creates detached thread)
Implemented overrideable thread detaching logic
Disabled cellAdec, cellDmux, cellFsAio
SPUThread renamed to spu_thread
RawSPUThread removed, spu_thread used instead
Disabled deriving from ppu_thread
Partial support for thread renaming
lv2_timer... simplified, screw it
idm/fxm: butchered support for on_stop/on_init
vm: improved allocation structure (added size)
2018-10-19 22:22:35 +03:00