drm/msm: Add adreno_is_a640_family()
Subsystems (4)
PATCH 1/2 drm/msm: Add adreno_is_a640_family()
From: Rob Clark <[email protected]>
Combine adreno_is_a640() and adreno_is_a680().
Signed-off-by Rob Clark <[email protected]>
--- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 5 ++--- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 15 +++++++-------- drivers/gpu/drm/msm/adreno/a6xx_hfi.c | 2 +- drivers/gpu/drm/msm/adreno/adreno_gpu.h | 9 ++------- 4 files changed, 12 insertions(+), 19 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +2 -3
@@ -521,8 +521,7 @@ static void a6xx_gmu_rpmh_init(struct a6xx_gmu *gmu)if (adreno_is_a650 (adreno_gpu) ||adreno_is_a660_family (adreno_gpu)) pdc_in_aop = true; -else if (adreno_is_a618 (adreno_gpu) ||adreno_is_a640 (adreno_gpu) || -adreno_is_a680 (adreno_gpu)) +else if (adreno_is_a618 (adreno_gpu) ||adreno_is_a640_family (adreno_gpu)) pdc_address_offset =0x30090 ;else pdc_address_offset =0x30080 ;
@@ -1527,7 +1526,7 @@ int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node) SZ_16M - SZ_16K, 0x04000);if (ret) goto err_memory; - }else if (adreno_is_a640 (adreno_gpu) ||adreno_is_a680 (adreno_gpu)) { + }else if (adreno_is_a640_family (adreno_gpu)) { ret =a6xx_gmu_memory_alloc (gmu, &gmu->icache,SZ_256K -SZ_16K ,0x04000 );if (ret)
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +7 -8
@@ -683,7 +683,7 @@ static void a6xx_set_ubwc_config(struct msm_gpu *gpu)if (adreno_is_a618 (adreno_gpu))return ; -if (adreno_is_a640 (adreno_gpu) ||adreno_is_a680 (adreno_gpu)) +if (adreno_is_a640_family (adreno_gpu)) amsbc =1 ;if (adreno_is_a650 (adreno_gpu) ||adreno_is_a660 (adreno_gpu)) {
@@ -764,7 +764,7 @@ static bool a6xx_ucode_check_version(struct a6xx_gpu *a6xx_gpu,* a660 targets have all the critical security fixes from the start */ if (adreno_is_a618 (adreno_gpu) ||adreno_is_a630 (adreno_gpu) || -adreno_is_a640 (adreno_gpu) ||adreno_is_a680 (adreno_gpu)) { +adreno_is_a640_family (adreno_gpu)) {/* * If the lowest nibble is 0xa that is an indication that this * microcode has been patched. The actual version is in dword
@@ -904,8 +904,8 @@ static int a6xx_hw_init(struct msm_gpu *gpu)a6xx_set_hwcg (gpu, true);/* VBIF/GBIF start*/ -if (adreno_is_a640 (adreno_gpu) ||adreno_is_a650_family (adreno_gpu) || -adreno_is_a680 (adreno_gpu)) { +if (adreno_is_a640_family (adreno_gpu) || +adreno_is_a650_family (adreno_gpu)) {gpu_write (gpu,REG_A6XX_GBIF_QSB_SIDE0 ,0x00071620 );gpu_write (gpu,REG_A6XX_GBIF_QSB_SIDE1 ,0x00071620 );gpu_write (gpu,REG_A6XX_GBIF_QSB_SIDE2 ,0x00071620 );
@@ -943,8 +943,8 @@ static int a6xx_hw_init(struct msm_gpu *gpu)gpu_write (gpu,REG_A6XX_UCHE_FILTER_CNTL ,0x804 );gpu_write (gpu,REG_A6XX_UCHE_CACHE_WAYS ,0x4 ); -if (adreno_is_a640 (adreno_gpu) ||adreno_is_a650_family (adreno_gpu) || -adreno_is_a680 (adreno_gpu)) +if (adreno_is_a640_family (adreno_gpu) || +adreno_is_a650_family (adreno_gpu))gpu_write (gpu,REG_A6XX_CP_ROQ_THRESHOLDS_2 ,0x02000140 );else gpu_write (gpu,REG_A6XX_CP_ROQ_THRESHOLDS_2 ,0x010000c0 );
@@ -961,8 +961,7 @@ static int a6xx_hw_init(struct msm_gpu *gpu)*/ if (adreno_is_a650 (adreno_gpu) ||adreno_is_a660 (adreno_gpu))gpu_write (gpu,REG_A6XX_PC_DBG_ECO_CNTL ,0x00300200 ); -else if (adreno_is_a640 (adreno_gpu) ||adreno_is_a680 (adreno_gpu) || -adreno_is_7c3 (adreno_gpu)) +else if (adreno_is_a640_family (adreno_gpu) ||adreno_is_7c3 (adreno_gpu))gpu_write (gpu,REG_A6XX_PC_DBG_ECO_CNTL ,0x00200200 );else if (adreno_is_a650 (adreno_gpu) ||adreno_is_a660 (adreno_gpu))gpu_write (gpu,REG_A6XX_PC_DBG_ECO_CNTL ,0x00300200 );
drivers/gpu/drm/msm/adreno/a6xx_hfi.c +1 -1
@@ -458,7 +458,7 @@ static int a6xx_hfi_send_bw_table(struct a6xx_gmu *gmu)if (adreno_is_a618 (adreno_gpu))a618_build_bw_table (&msg); -else if (adreno_is_a640 (adreno_gpu) ||adreno_is_a680 (adreno_gpu)) +else if (adreno_is_a640_family (adreno_gpu))a640_build_bw_table (&msg);else if (adreno_is_a650 (adreno_gpu))a650_build_bw_table (&msg);
drivers/gpu/drm/msm/adreno/adreno_gpu.h +2 -7
@@ -241,9 +241,9 @@ static inline int adreno_is_a630(struct adreno_gpu *gpu)return gpu->revn ==630 ; } -static inline int adreno_is_a640 (struct adreno_gpu *gpu) +static inline int adreno_is_a640_family (struct adreno_gpu *gpu) { -return gpu->revn ==640 ; +return (gpu->revn ==640 ) || (gpu->revn ==680 ); }static inline int adreno_is_a650 (struct adreno_gpu *gpu)
@@ -274,11 +274,6 @@ static inline int adreno_is_a650_family(struct adreno_gpu *gpu)adreno_is_a660_family (gpu); } -static inline int adreno_is_a680 (struct adreno_gpu *gpu) -{ -return gpu->revn ==680 ; -} -int adreno_get_param (struct msm_gpu *gpu,uint32_t param,uint64_t *value);const struct firmware *adreno_request_fw (struct adreno_gpu *adreno_gpu,const char *fwname);
Signature · 1 line
2.31.1
PATCH 2/2 drm/msm: Rework SQE version check
From: Rob Clark <[email protected]>
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]>
--- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +4 -4
@@ -747,6 +747,7 @@ static bool a6xx_ucode_check_version(struct a6xx_gpu *a6xx_gpu, {struct adreno_gpu *adreno_gpu = &a6xx_gpu->base;struct msm_gpu *gpu = &adreno_gpu->base; +const char *sqe_name = adreno_gpu->info->fw[ADRENO_FW_SQE ];u32 *buf =msm_gem_get_vaddr (obj);bool ret = false;
@@ -763,8 +764,7 @@ static bool a6xx_ucode_check_version(struct a6xx_gpu *a6xx_gpu,* * a660 targets have all the critical security fixes from the start */ -if (adreno_is_a618 (adreno_gpu) ||adreno_is_a630 (adreno_gpu) || -adreno_is_a640_family (adreno_gpu)) { +if (!strcmp (sqe_name,"a630_sqe.fw" )) {/* * If the lowest nibble is 0xa that is an indication that this * microcode has been patched. The actual version is in dword
@@ -785,7 +785,7 @@ static bool a6xx_ucode_check_version(struct a6xx_gpu *a6xx_gpu,DRM_DEV_ERROR (&gpu->pdev->dev,"a630 SQE ucode is too old. Have version %x need at least %x\n" , buf[0 ] &0xfff ,0x190 ); - }else if (adreno_is_a650 (adreno_gpu)) { + }else if (!strcmp (sqe_name,"a650_sqe.fw" )) {if ((buf[0 ] &0xfff ) >=0x095 ) { ret = true; goto out;
@@ -794,7 +794,7 @@ static bool a6xx_ucode_check_version(struct a6xx_gpu *a6xx_gpu,DRM_DEV_ERROR (&gpu->pdev->dev,"a650 SQE ucode is too old. Have version %x need at least %x\n" , buf[0 ] &0xfff ,0x095 ); - }else if (adreno_is_a660_family (adreno_gpu)) { + }else if (!strcmp (sqe_name,"a660_sqe.fw" )) { ret = true; }else { DRM_DEV_ERROR(&gpu->pdev->dev,
Signature · 1 line
2.31.1