diff --git a/src/panfrost/include/panfrost-quirks.h b/src/panfrost/include/panfrost-quirks.h index e3aae4f5b40..3c476789154 100644 --- a/src/panfrost/include/panfrost-quirks.h +++ b/src/panfrost/include/panfrost-quirks.h @@ -78,7 +78,7 @@ #define BIFROST_QUIRKS (IS_BIFROST | NO_BLEND_PACKS | MIDGARD_NO_AFBC) static inline unsigned -panfrost_get_quirks(unsigned gpu_id) +panfrost_get_quirks(unsigned gpu_id, unsigned gpu_revision) { switch (gpu_id) { case 0x600: diff --git a/src/panfrost/lib/pan_props.c b/src/panfrost/lib/pan_props.c index 0553d5f3959..334c36e6872 100644 --- a/src/panfrost/lib/pan_props.c +++ b/src/panfrost/lib/pan_props.c @@ -77,6 +77,12 @@ panfrost_query_gpu_version(int fd) return panfrost_query_raw(fd, DRM_PANFROST_PARAM_GPU_PROD_ID, true, 0); } +static unsigned +panfrost_query_gpu_revision(int fd) +{ + return panfrost_query_raw(fd, DRM_PANFROST_PARAM_GPU_REVISION, true, 0); +} + static unsigned panfrost_query_core_count(int fd) { @@ -218,7 +224,8 @@ panfrost_open_device(void *memctx, int fd, struct panfrost_device *dev) dev->core_count = panfrost_query_core_count(fd); dev->thread_tls_alloc = panfrost_query_thread_tls_alloc(fd, dev->arch); dev->kernel_version = drmGetVersion(fd); - dev->quirks = panfrost_get_quirks(dev->gpu_id); + unsigned revision = panfrost_query_gpu_revision(fd); + dev->quirks = panfrost_get_quirks(dev->gpu_id, revision); dev->compressed_formats = panfrost_query_compressed_formats(fd); if (dev->quirks & HAS_SWIZZLES) diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c index 475cc73464d..ead025a1e26 100644 --- a/src/panfrost/midgard/midgard_compile.c +++ b/src/panfrost/midgard/midgard_compile.c @@ -2830,7 +2830,7 @@ midgard_compile_shader_nir(void *mem_ctx, nir_shader *nir, NIR_PASS_V(nir, nir_lower_var_copies); NIR_PASS_V(nir, nir_lower_vars_to_ssa); - unsigned pan_quirks = panfrost_get_quirks(inputs->gpu_id); + unsigned pan_quirks = panfrost_get_quirks(inputs->gpu_id, 0); NIR_PASS_V(nir, pan_lower_framebuffer, inputs->rt_formats, inputs->is_blend, pan_quirks);