From: falcovorbis <fal...@us...> - 2024-10-21 05:46:51
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 63ee447e3b4bcd2b48e15ed289e1c82a80145ff7 (commit) from f5c0a4c7ce9325a5969319afa17903436f50d4e1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 63ee447e3b4bcd2b48e15ed289e1c82a80145ff7 Author: Paul Cercueil <pa...@cr...> Date: Mon Oct 21 07:46:29 2024 +0200 pvr: Add new function pvr_send_to_ta() (#817) This function can be used to upload a 32-byte payload to the Tile Accelerator. The difference with the Direct Rendering approach is that the SQs are not used, and therefore can be used for anything else. Signed-off-by: Paul Cercueil <pa...@cr...> Co-authored-by: Falco Girgis <gyr...@gm...> ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/hardware/pvr/Makefile | 3 ++ .../arch/dreamcast/hardware/pvr/pvr_send_to_ta.s | 43 ++++++++++++++++++++++ kernel/arch/dreamcast/include/dc/pvr.h | 11 ++++++ 3 files changed, 57 insertions(+) create mode 100644 kernel/arch/dreamcast/hardware/pvr/pvr_send_to_ta.s diff --git a/kernel/arch/dreamcast/hardware/pvr/Makefile b/kernel/arch/dreamcast/hardware/pvr/Makefile index 1eda21b1..3d9f1a77 100644 --- a/kernel/arch/dreamcast/hardware/pvr/Makefile +++ b/kernel/arch/dreamcast/hardware/pvr/Makefile @@ -13,6 +13,9 @@ OBJS += pvr_buffers.o pvr_irq.o # Init / Shutdown / Globals / Misc OBJS += pvr_init_shutdown.o pvr_globals.o pvr_misc.o +# Fast Tile Accelerator upload function +OBJS += pvr_send_to_ta.o + # Fog OBJS += pvr_fog.o diff --git a/kernel/arch/dreamcast/hardware/pvr/pvr_send_to_ta.s b/kernel/arch/dreamcast/hardware/pvr/pvr_send_to_ta.s new file mode 100644 index 00000000..11629bab --- /dev/null +++ b/kernel/arch/dreamcast/hardware/pvr/pvr_send_to_ta.s @@ -0,0 +1,43 @@ +! KallistiOS ##version## +! +! arch/dreamcast/hardware/pvr/pvr_send_to_ta.s +! Copyright (C) 2024 Paul Cercueil +! +! Fast function to upload geometry to the Tile Accelerator without SQs +! + +.globl _pvr_send_to_ta + +_pvr_send_to_ta: + fschg + mov.l _irq_and,r1 + mov #0x78,r2 + mov.l _ta_addr,r3 + stc sr,r0 + and r0,r1 + fmov @r4+,dr0 + shll r2 + fmov @r4+,dr2 + or r2,r1 + fmov @r4+,dr4 + fmov @r4+,dr6 + ldc r1,sr + + movca.l r0,@r3 + add #32,r3 + fmov dr6,@-r3 + fmov dr4,@-r3 + fmov dr2,@-r3 + fmov dr0,@-r3 + fschg + + ldc r0,sr + + rts + ocbp @r3 + +.align 2 +_irq_and: + .long 0xefffff0f +_ta_addr: + .long 0x90000000 diff --git a/kernel/arch/dreamcast/include/dc/pvr.h b/kernel/arch/dreamcast/include/dc/pvr.h index eb2ac36f..7ec55b35 100644 --- a/kernel/arch/dreamcast/include/dc/pvr.h +++ b/kernel/arch/dreamcast/include/dc/pvr.h @@ -2006,6 +2006,17 @@ void pvr_dr_init(pvr_dr_state_t *vtx_buf_ptr); */ void pvr_dr_finish(void); +/** \brief Upload a 32-byte payload to the Tile Accelerator + + Upload the given payload to the Tile Accelerator. The difference with the + Direct Rendering approach above is that the Store Queues are not used, and + therefore can be used for anything else. + + \param data A pointer to the 32-byte payload. + The pointer must be aligned to 8 bytes. +*/ +void pvr_send_to_ta(void *data); + /** @} */ /** \brief Submit a primitive of the given list type. hooks/post-receive -- A pseudo Operating System for the Dreamcast. |