From e714b35301a33145399f8939ca864ffd14b49de9 Mon Sep 17 00:00:00 2001 From: Sarah Walker Date: Tue, 23 Aug 2022 10:50:37 +0100 Subject: [PATCH] pvr: Fragment register fb_cdc_zls is feature dependent Signed-off-by: Sarah Walker Reviewed-by: Karmjit Mahil Part-of: --- src/imagination/common/pvr_device_info.c | 6 ++++++ src/imagination/common/pvr_device_info.h | 4 ++++ src/imagination/vulkan/pvr_job_render.c | 6 ++++-- src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv_job_render.c | 6 ++++-- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/imagination/common/pvr_device_info.c b/src/imagination/common/pvr_device_info.c index 85161bb..276480f 100644 --- a/src/imagination/common/pvr_device_info.c +++ b/src/imagination/common/pvr_device_info.c @@ -43,6 +43,7 @@ const struct pvr_device_features pvr_device_features_4_V_2_51 = { .has_compute_morton_capable = true, .has_compute_overlap = true, .has_eight_output_registers = true, + .has_fbcdc_algorithm = true, .has_gs_rta_support = true, .has_isp_max_tiles_in_flight = true, .has_isp_samples_per_pixel = true, @@ -74,6 +75,7 @@ const struct pvr_device_features pvr_device_features_4_V_2_51 = { .has_zls_subtile = true, .common_store_size_in_dwords = 1280U * 4U * 4U, + .fbcdc_algorithm = 2, .isp_max_tiles_in_flight = 4U, .isp_samples_per_pixel = 2U, .max_instances_per_pds_task = 32U, @@ -92,6 +94,8 @@ const struct pvr_device_features pvr_device_features_4_V_2_51 = { .uvs_pba_entries = 320U, .uvs_vtx_entries = 288U, .vdm_cam_size = 256U, + + .has_requires_fb_cdc_zls_setup = true, }; const struct pvr_device_enhancements pvr_device_enhancements_4_40_2_51 = { @@ -210,6 +214,7 @@ const struct pvr_device_features pvr_device_features_36_V_104_796 = { .has_common_store_size_in_dwords = true, .has_compute = true, .has_compute_overlap = true, + .has_fbcdc_algorithm = true, .has_gpu_multicore_support = true, .has_gs_rta_support = true, .has_ipf_creq_pf = true, @@ -251,6 +256,7 @@ const struct pvr_device_features pvr_device_features_36_V_104_796 = { .has_xpu_max_slaves = true, .common_store_size_in_dwords = 1344U * 4U * 4U, + .fbcdc_algorithm = 50U, .isp_max_tiles_in_flight = 6U, .isp_samples_per_pixel = 4U, .max_instances_per_pds_task = 32U, diff --git a/src/imagination/common/pvr_device_info.h b/src/imagination/common/pvr_device_info.h index 8fdb26d..1cb7264 100644 --- a/src/imagination/common/pvr_device_info.h +++ b/src/imagination/common/pvr_device_info.h @@ -255,6 +255,8 @@ struct pvr_device_features { bool has_compute_morton_capable : 1; bool has_compute_overlap : 1; bool has_eight_output_registers : 1; + bool has_fb_cdc_v4 : 1; + bool has_fbcdc_algorithm; bool has_gpu_multicore_support : 1; bool has_gs_rta_support : 1; bool has_ipf_creq_pf : 1; @@ -303,6 +305,7 @@ struct pvr_device_features { bool has_zls_subtile : 1; uint32_t common_store_size_in_dwords; + uint32_t fbcdc_algorithm; uint32_t isp_max_tiles_in_flight; uint32_t isp_samples_per_pixel; uint32_t max_instances_per_pds_task; @@ -325,6 +328,7 @@ struct pvr_device_features { uint32_t xpu_max_slaves; /* Derived features. */ + bool has_requires_fb_cdc_zls_setup : 1; bool has_s8xe : 1; }; diff --git a/src/imagination/vulkan/pvr_job_render.c b/src/imagination/vulkan/pvr_job_render.c index 9e661cc..da9f1f9 100644 --- a/src/imagination/vulkan/pvr_job_render.c +++ b/src/imagination/vulkan/pvr_job_render.c @@ -1170,8 +1170,10 @@ static void pvr_frag_state_stream_init(struct pvr_render_ctx *ctx, } stream_ptr += pvr_cmd_length(CR_ISP_STENCIL_LOAD_BASE); - *(uint64_t *)stream_ptr = 0; - stream_ptr += 2U; + if (PVR_HAS_FEATURE(dev_info, requires_fb_cdc_zls_setup)) { + *(uint64_t *)stream_ptr = 0; + stream_ptr += 2U; + } STATIC_ASSERT(ARRAY_SIZE(job->pbe_reg_words) == 8U); STATIC_ASSERT(ARRAY_SIZE(job->pbe_reg_words[0]) == 3U); diff --git a/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv_job_render.c b/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv_job_render.c index 4fa6dc7..4efa803 100644 --- a/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv_job_render.c +++ b/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv_job_render.c @@ -752,8 +752,10 @@ pvr_srv_fragment_cmd_stream_load(struct rogue_fwif_cmd_3d *const cmd, regs->isp_stencil_load_store_base = *(const uint64_t *)stream_ptr; stream_ptr += pvr_cmd_length(CR_ISP_STENCIL_LOAD_BASE); - regs->fb_cdc_zls = *(const uint64_t *)stream_ptr; - stream_ptr += 2U; + if (PVR_HAS_FEATURE(dev_info, requires_fb_cdc_zls_setup)) { + regs->fb_cdc_zls = *(const uint64_t *)stream_ptr; + stream_ptr += 2U; + } STATIC_ASSERT(ARRAY_SIZE(regs->pbe_word) == 8U); STATIC_ASSERT(ARRAY_SIZE(regs->pbe_word[0]) == 3U); -- 2.7.4