Skip to content

Commit 083cc3a

Browse files
committed
drm/msm: Add adreno_is_a640_family()
Combine adreno_is_a640() and adreno_is_a680(). Signed-off-by: Rob Clark <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Clark <[email protected]>
1 parent 061a9ae commit 083cc3a

File tree

4 files changed

+12
-19
lines changed

4 files changed

+12
-19
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -521,8 +521,7 @@ static void a6xx_gmu_rpmh_init(struct a6xx_gmu *gmu)
521521

522522
if (adreno_is_a650(adreno_gpu) || adreno_is_a660_family(adreno_gpu))
523523
pdc_in_aop = true;
524-
else if (adreno_is_a618(adreno_gpu) || adreno_is_a640(adreno_gpu) ||
525-
adreno_is_a680(adreno_gpu))
524+
else if (adreno_is_a618(adreno_gpu) || adreno_is_a640_family(adreno_gpu))
526525
pdc_address_offset = 0x30090;
527526
else
528527
pdc_address_offset = 0x30080;
@@ -1527,7 +1526,7 @@ int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node)
15271526
SZ_16M - SZ_16K, 0x04000);
15281527
if (ret)
15291528
goto err_memory;
1530-
} else if (adreno_is_a640(adreno_gpu) || adreno_is_a680(adreno_gpu)) {
1529+
} else if (adreno_is_a640_family(adreno_gpu)) {
15311530
ret = a6xx_gmu_memory_alloc(gmu, &gmu->icache,
15321531
SZ_256K - SZ_16K, 0x04000);
15331532
if (ret)

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ static void a6xx_set_ubwc_config(struct msm_gpu *gpu)
698698
if (adreno_is_a618(adreno_gpu))
699699
return;
700700

701-
if (adreno_is_a640(adreno_gpu) || adreno_is_a680(adreno_gpu))
701+
if (adreno_is_a640_family(adreno_gpu))
702702
amsbc = 1;
703703

704704
if (adreno_is_a650(adreno_gpu) || adreno_is_a660(adreno_gpu)) {
@@ -779,7 +779,7 @@ static bool a6xx_ucode_check_version(struct a6xx_gpu *a6xx_gpu,
779779
* a660 targets have all the critical security fixes from the start
780780
*/
781781
if (adreno_is_a618(adreno_gpu) || adreno_is_a630(adreno_gpu) ||
782-
adreno_is_a640(adreno_gpu) || adreno_is_a680(adreno_gpu)) {
782+
adreno_is_a640_family(adreno_gpu)) {
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
@@ -919,8 +919,8 @@ static int a6xx_hw_init(struct msm_gpu *gpu)
919919
a6xx_set_hwcg(gpu, true);
920920

921921
/* VBIF/GBIF start*/
922-
if (adreno_is_a640(adreno_gpu) || adreno_is_a650_family(adreno_gpu) ||
923-
adreno_is_a680(adreno_gpu)) {
922+
if (adreno_is_a640_family(adreno_gpu) ||
923+
adreno_is_a650_family(adreno_gpu)) {
924924
gpu_write(gpu, REG_A6XX_GBIF_QSB_SIDE0, 0x00071620);
925925
gpu_write(gpu, REG_A6XX_GBIF_QSB_SIDE1, 0x00071620);
926926
gpu_write(gpu, REG_A6XX_GBIF_QSB_SIDE2, 0x00071620);
@@ -958,8 +958,8 @@ static int a6xx_hw_init(struct msm_gpu *gpu)
958958
gpu_write(gpu, REG_A6XX_UCHE_FILTER_CNTL, 0x804);
959959
gpu_write(gpu, REG_A6XX_UCHE_CACHE_WAYS, 0x4);
960960

961-
if (adreno_is_a640(adreno_gpu) || adreno_is_a650_family(adreno_gpu) ||
962-
adreno_is_a680(adreno_gpu))
961+
if (adreno_is_a640_family(adreno_gpu) ||
962+
adreno_is_a650_family(adreno_gpu))
963963
gpu_write(gpu, REG_A6XX_CP_ROQ_THRESHOLDS_2, 0x02000140);
964964
else
965965
gpu_write(gpu, REG_A6XX_CP_ROQ_THRESHOLDS_2, 0x010000c0);
@@ -976,8 +976,7 @@ static int a6xx_hw_init(struct msm_gpu *gpu)
976976
*/
977977
if (adreno_is_a650(adreno_gpu) || adreno_is_a660(adreno_gpu))
978978
gpu_write(gpu, REG_A6XX_PC_DBG_ECO_CNTL, 0x00300200);
979-
else if (adreno_is_a640(adreno_gpu) || adreno_is_a680(adreno_gpu) ||
980-
adreno_is_7c3(adreno_gpu))
979+
else if (adreno_is_a640_family(adreno_gpu) || adreno_is_7c3(adreno_gpu))
981980
gpu_write(gpu, REG_A6XX_PC_DBG_ECO_CNTL, 0x00200200);
982981
else if (adreno_is_a650(adreno_gpu) || adreno_is_a660(adreno_gpu))
983982
gpu_write(gpu, REG_A6XX_PC_DBG_ECO_CNTL, 0x00300200);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ static int a6xx_hfi_send_bw_table(struct a6xx_gmu *gmu)
458458

459459
if (adreno_is_a618(adreno_gpu))
460460
a618_build_bw_table(&msg);
461-
else if (adreno_is_a640(adreno_gpu) || adreno_is_a680(adreno_gpu))
461+
else if (adreno_is_a640_family(adreno_gpu))
462462
a640_build_bw_table(&msg);
463463
else if (adreno_is_a650(adreno_gpu))
464464
a650_build_bw_table(&msg);

drivers/gpu/drm/msm/adreno/adreno_gpu.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,9 @@ static inline int adreno_is_a630(struct adreno_gpu *gpu)
241241
return gpu->revn == 630;
242242
}
243243

244-
static inline int adreno_is_a640(struct adreno_gpu *gpu)
244+
static inline int adreno_is_a640_family(struct adreno_gpu *gpu)
245245
{
246-
return gpu->revn == 640;
246+
return (gpu->revn == 640) || (gpu->revn == 680);
247247
}
248248

249249
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)
274274
adreno_is_a660_family(gpu);
275275
}
276276

277-
static inline int adreno_is_a680(struct adreno_gpu *gpu)
278-
{
279-
return gpu->revn == 680;
280-
}
281-
282277
int adreno_get_param(struct msm_gpu *gpu, uint32_t param, uint64_t *value);
283278
const struct firmware *adreno_request_fw(struct adreno_gpu *adreno_gpu,
284279
const char *fwname);

0 commit comments

Comments
 (0)