Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull upstream #24

Merged
merged 3 commits into from
Nov 16, 2024
Merged

Pull upstream #24

merged 3 commits into from
Nov 16, 2024

Conversation

andressbarajas
Copy link
Collaborator

Pull latest master changes from KallistiOS Proper

pcercuei and others added 3 commits November 15, 2024 22:49
* mmu: Add function mmu_enabled()

This function can be used to know whether or not the MMU is in use.

* mmu: Support address translation of store queues

Reserve the last two TLB entries and map a 1 MiB page each for use
with the SQ area.

Add the function mmu_set_sq_addr(), which will overwrite the physical
address that the SQ area points to in the TLB.

* sq: Update sq_lock() prototype to work with MMU

Change its prototype: it now returns a pointer, which is the translated
address of the source pointer. In non-MMU use, it's returns the same
value as SQ_MASK_DEST(src).

When MMU is enabled, sq_lock() will reset the address translation for
the SQ memory area, and convert the source address as an offset to that
memory area, making it possible to use SQs when MMU is enabled.

The caveat is that we only map one megabyte of SQ memory area for
simplicity, and therefore the SQ memory window is reduced.
This should be fine though, as apart from e.g. a whole-VRAM clear,
nobody will ever need such a big window.

* sq: Update sq_cpy() to work with MMU

When using the MMU the SQ area is a 1 MiB page, so we must not copy data
outside this area.

* sq: Update sq_set32() to work with MMU

When using the MMU the SQ area is a 1 MiB page, so we must not copy data
outside this area.

* mmu: Remove mmu_disable() / mmu_restore()

Now that SQs work with MMU, those two functions aren't useful anymore
and can be dropped.

---------

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
- Rather than asserting and crashing, which isn't really warranted,
  modified pvr_mem_available() and snd_mem_available() to gracefully
return 0 when called before PVR/Sound RAM has been initialized.
- This way profilers and monitors in other threads can still boot up and
  show proper stats while things are being initialized, rather than
simply crashing in debug builds and returning garbage in release builds.
@andressbarajas andressbarajas merged commit 1555bb4 into master Nov 16, 2024
1 check passed
@andressbarajas andressbarajas deleted the pull_upstream branch November 16, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants