Skip to content

Commit f3a6b02

Browse files
committed
drm/msm: Rework SQE version check
This check is really about which SQE firmware, rather than which GPU. Rework to match minimum version based on firmware name, so it doesn't need to be updated when adding additional GPUs using the same fw. Signed-off-by: Rob Clark <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Clark <[email protected]>
1 parent 083cc3a commit f3a6b02

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/gpu/drm/msm/adreno/a6xx_gpu.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,7 @@ static bool a6xx_ucode_check_version(struct a6xx_gpu *a6xx_gpu,
762762
{
763763
struct adreno_gpu *adreno_gpu = &a6xx_gpu->base;
764764
struct msm_gpu *gpu = &adreno_gpu->base;
765+
const char *sqe_name = adreno_gpu->info->fw[ADRENO_FW_SQE];
765766
u32 *buf = msm_gem_get_vaddr(obj);
766767
bool ret = false;
767768

@@ -778,8 +779,7 @@ static bool a6xx_ucode_check_version(struct a6xx_gpu *a6xx_gpu,
778779
*
779780
* a660 targets have all the critical security fixes from the start
780781
*/
781-
if (adreno_is_a618(adreno_gpu) || adreno_is_a630(adreno_gpu) ||
782-
adreno_is_a640_family(adreno_gpu)) {
782+
if (!strcmp(sqe_name, "a630_sqe.fw")) {
783783
/*
784784
* If the lowest nibble is 0xa that is an indication that this
785785
* microcode has been patched. The actual version is in dword
@@ -800,7 +800,7 @@ static bool a6xx_ucode_check_version(struct a6xx_gpu *a6xx_gpu,
800800
DRM_DEV_ERROR(&gpu->pdev->dev,
801801
"a630 SQE ucode is too old. Have version %x need at least %x\n",
802802
buf[0] & 0xfff, 0x190);
803-
} else if (adreno_is_a650(adreno_gpu)) {
803+
} else if (!strcmp(sqe_name, "a650_sqe.fw")) {
804804
if ((buf[0] & 0xfff) >= 0x095) {
805805
ret = true;
806806
goto out;
@@ -809,7 +809,7 @@ static bool a6xx_ucode_check_version(struct a6xx_gpu *a6xx_gpu,
809809
DRM_DEV_ERROR(&gpu->pdev->dev,
810810
"a650 SQE ucode is too old. Have version %x need at least %x\n",
811811
buf[0] & 0xfff, 0x095);
812-
} else if (adreno_is_a660_family(adreno_gpu)) {
812+
} else if (!strcmp(sqe_name, "a660_sqe.fw")) {
813813
ret = true;
814814
} else {
815815
DRM_DEV_ERROR(&gpu->pdev->dev,

0 commit comments

Comments
 (0)