From 9bce479efc72212bae92766ee549ce5ce5d55000 Mon Sep 17 00:00:00 2001 From: Oskar Rundgren Date: Thu, 4 May 2023 18:34:42 +0100 Subject: pvr: Transfer fix blit with multiple emits The PBE state words for second emit are at wrong offset. Add new define ROGUE_NUM_PBESTATE_REG_WORDS_FOR_TRANSFER to fix the offset. The last word is always 0. Signed-off-by: Oskar Rundgren Reviewed-by: Frank Binns Part-of: --- src/imagination/include/hwdef/rogue_hw_defs.h | 5 +++++ src/imagination/vulkan/pvr_job_transfer.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/imagination/include/hwdef/rogue_hw_defs.h b/src/imagination/include/hwdef/rogue_hw_defs.h index f238b67c9cc..b040e01809e 100644 --- a/src/imagination/include/hwdef/rogue_hw_defs.h +++ b/src/imagination/include/hwdef/rogue_hw_defs.h @@ -84,6 +84,11 @@ /* Number of PBESTATE_REG_WORD values that need setting up. */ #define ROGUE_NUM_PBESTATE_REG_WORDS 3U +/* Number of PBESTATE_REG_WORD used in transfer. + * The last word is not used. + */ +#define ROGUE_NUM_PBESTATE_REG_WORDS_FOR_TRANSFER 2U + /* Number of PBESTATE_STATE_WORD values that need setting up. */ #define ROGUE_NUM_PBESTATE_STATE_WORDS 2U diff --git a/src/imagination/vulkan/pvr_job_transfer.c b/src/imagination/vulkan/pvr_job_transfer.c index 5af859c3024..87f06d7c448 100644 --- a/src/imagination/vulkan/pvr_job_transfer.c +++ b/src/imagination/vulkan/pvr_job_transfer.c @@ -1201,12 +1201,14 @@ static VkResult pvr_pbe_setup(const struct pvr_transfer_cmd *transfer_cmd, uint32_t *pbe_words; /* Ensure the access into the pbe_wordx_mrty is made within its bounds. */ - assert(i * ROGUE_NUM_PBESTATE_REG_WORDS < + assert(i * ROGUE_NUM_PBESTATE_REG_WORDS_FOR_TRANSFER < ARRAY_SIZE(state->regs.pbe_wordx_mrty)); /* Ensure the access into pbe_setup_words is made within its bounds. */ assert(i * ROGUE_NUM_PBESTATE_STATE_WORDS < ARRAY_SIZE(pbe_setup_words)); - pbe_regs = &state->regs.pbe_wordx_mrty[i * ROGUE_NUM_PBESTATE_REG_WORDS]; + pbe_regs = + &state->regs + .pbe_wordx_mrty[i * ROGUE_NUM_PBESTATE_REG_WORDS_FOR_TRANSFER]; pbe_words = &pbe_setup_words[i * ROGUE_NUM_PBESTATE_STATE_WORDS]; if (PVR_HAS_ERN(dev_info, 42064)) -- cgit v1.2.1