Skip to contentSkip to conversation

drm/msm/a6xx: Correct the highestbank configuration

PATCH In review Akhil P Oommen 3 participants 5 messages Jan 24, 2020 – Feb 11, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/msm/a6xx: Correct the highestbank configuration

Highest bank bit configuration is different for a618 gpu. Update it with the correct configuration which is the reset value incidentally.

---
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +6 -4
index daf0780..536d196 100644
@@ -470,10 +470,12 @@ static int a6xx_hw_init(struct msm_gpu *gpu)
 	/* Select CP0 to always count cycles */
 	gpu_write(gpu, REG_A6XX_CP_PERFCTR_CP_SEL_0, PERF_CP_ALWAYS_COUNT);
 
-	gpu_write(gpu, REG_A6XX_RB_NC_MODE_CNTL, 2 << 1);
-	gpu_write(gpu, REG_A6XX_TPL1_NC_MODE_CNTL, 2 << 1);
-	gpu_write(gpu, REG_A6XX_SP_NC_MODE_CNTL, 2 << 1);
-	gpu_write(gpu, REG_A6XX_UCHE_MODE_CNTL, 2 << 21);
+	if (adreno_is_a630(adreno_gpu)) {
+		gpu_write(gpu, REG_A6XX_RB_NC_MODE_CNTL, 2 << 1);
+		gpu_write(gpu, REG_A6XX_TPL1_NC_MODE_CNTL, 2 << 1);
+		gpu_write(gpu, REG_A6XX_SP_NC_MODE_CNTL, 2 << 1);
+		gpu_write(gpu, REG_A6XX_UCHE_MODE_CNTL, 2 << 21);
+	}
 
 	/* Enable fault detection */
 	gpu_write(gpu, REG_A6XX_RBBM_INTERFACE_HANG_INT_CNTL,
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Akhil P Oommen

Highest bank bit configuration is different for a618 gpu. Update it with the correct configuration which is the reset value incidentally.

Thanks, this fixes the UBWC issues on a618

Fixes e812744c5f95 ("drm: msm: a6xx: Add support for A618")
Quoted 26 lines
---
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +6 -5
index daf0780..536d196 100644
@@ -470,10 +470,12 @@ static int a6xx_hw_init(struct msm_gpu *gpu)
        /* Select CP0 to always count cycles */
        gpu_write(gpu, REG_A6XX_CP_PERFCTR_CP_SEL_0, PERF_CP_ALWAYS_COUNT);
 
-       gpu_write(gpu, REG_A6XX_RB_NC_MODE_CNTL, 2 << 1);
-       gpu_write(gpu, REG_A6XX_TPL1_NC_MODE_CNTL, 2 << 1);
-       gpu_write(gpu, REG_A6XX_SP_NC_MODE_CNTL, 2 << 1);
-       gpu_write(gpu, REG_A6XX_UCHE_MODE_CNTL, 2 << 21);
+       if (adreno_is_a630(adreno_gpu)) {
+               gpu_write(gpu, REG_A6XX_RB_NC_MODE_CNTL, 2 << 1);
+               gpu_write(gpu, REG_A6XX_TPL1_NC_MODE_CNTL, 2 << 1);
+               gpu_write(gpu, REG_A6XX_SP_NC_MODE_CNTL, 2 << 1);
+               gpu_write(gpu, REG_A6XX_UCHE_MODE_CNTL, 2 << 21);
+       }
 
        /* Enable fault detection */
        gpu_write(gpu, REG_A6XX_RBBM_INTERFACE_HANG_INT_CNTL,
--
Quoted 5 lines

2.7.4
_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
In reply to Akhil P Oommen
Quoted 17 lines · Akhil P Oommen

Highest bank bit configuration is different for a618 gpu. Update it with the correct configuration which is the reset value incidentally.

---
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +0 -0
index daf0780..536d196 100644
@@ -470,10 +470,12 @@ static int a6xx_hw_init(struct msm_gpu *gpu)
 	/* Select CP0 to always count cycles */
 	gpu_write(gpu, REG_A6XX_CP_PERFCTR_CP_SEL_0, PERF_CP_ALWAYS_COUNT);
 

drivers/gpu/drm/msm/adreno/a6xx_gpu.c static int a6xx_hw_init(struct msm_gpu *gpu) · line 478

Quoted 10 lines
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +6 -4
-	gpu_write(gpu, REG_A6XX_RB_NC_MODE_CNTL, 2 << 1);
-	gpu_write(gpu, REG_A6XX_TPL1_NC_MODE_CNTL, 2 << 1);
-	gpu_write(gpu, REG_A6XX_SP_NC_MODE_CNTL, 2 << 1);
-	gpu_write(gpu, REG_A6XX_UCHE_MODE_CNTL, 2 << 21);
+	if (adreno_is_a630(adreno_gpu)) {
+		gpu_write(gpu, REG_A6XX_RB_NC_MODE_CNTL, 2 << 1);
+		gpu_write(gpu, REG_A6XX_TPL1_NC_MODE_CNTL, 2 << 1);
+		gpu_write(gpu, REG_A6XX_SP_NC_MODE_CNTL, 2 << 1);
+		gpu_write(gpu, REG_A6XX_UCHE_MODE_CNTL, 2 << 21);
+	}

it shouldn't come as a surprise that everything in the a6xx family is going to have a highest bank bit setting. Even though the a618 uses the reset value, I think it would be less confusing to future folks if we explicitly program it:

if (adreno_is_a630(adreno_dev))
hbb = 2;
else
hbb = 0;

....

Jordan

Signature · 6 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw
Quoted 32 lines · Jordan Crouse
Quoted 17 lines · Akhil P Oommen

Highest bank bit configuration is different for a618 gpu. Update it with the correct configuration which is the reset value incidentally.

---
  drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 10 ++++++----
  1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +0 -0
index daf0780..536d196 100644
@@ -470,10 +470,12 @@ static int a6xx_hw_init(struct msm_gpu *gpu)
  	/* Select CP0 to always count cycles */
  	gpu_write(gpu, REG_A6XX_CP_PERFCTR_CP_SEL_0, PERF_CP_ALWAYS_COUNT);
 

drivers/gpu/drm/msm/adreno/a6xx_gpu.c static int a6xx_hw_init(struct msm_gpu *gpu) · line 478

Quoted 10 lines
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +6 -4
-	gpu_write(gpu, REG_A6XX_RB_NC_MODE_CNTL, 2 << 1);
-	gpu_write(gpu, REG_A6XX_TPL1_NC_MODE_CNTL, 2 << 1);
-	gpu_write(gpu, REG_A6XX_SP_NC_MODE_CNTL, 2 << 1);
-	gpu_write(gpu, REG_A6XX_UCHE_MODE_CNTL, 2 << 21);
+	if (adreno_is_a630(adreno_gpu)) {
+		gpu_write(gpu, REG_A6XX_RB_NC_MODE_CNTL, 2 << 1);
+		gpu_write(gpu, REG_A6XX_TPL1_NC_MODE_CNTL, 2 << 1);
+		gpu_write(gpu, REG_A6XX_SP_NC_MODE_CNTL, 2 << 1);
+		gpu_write(gpu, REG_A6XX_UCHE_MODE_CNTL, 2 << 21);
+	}

it shouldn't come as a surprise that everything in the a6xx family is going to have a highest bank bit setting. Even though the a618 uses the reset value, I think it would be less confusing to future folks if we explicitly program it:

Quoted 4 lines

if (adreno_is_a630(adreno_dev))
hbb = 2;
else
hbb = 0;

I think it would be better if we keep this in the adreno_info. Yes, this would waste a tiny bit of space for other gpu entries in the gpulist. It is also possible to move this to a separate struct and keep a pointer to it in the adreno_info. But that is something we should try when there are more a6xx specific configurations in future.

I have a new patch, but testing it is taking longer that I expected. I will share it as soon as possible.

Quoted 4 lines

....

Jordan

Akhil

Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
#4 lore raw
Quoted 46 lines · Akhil P Oommen
Quoted 32 lines · Jordan Crouse
Quoted 17 lines · Akhil P Oommen

Highest bank bit configuration is different for a618 gpu. Update it with the correct configuration which is the reset value incidentally.

---
  drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 10 ++++++----
  1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +0 -0
index daf0780..536d196 100644
@@ -470,10 +470,12 @@ static int a6xx_hw_init(struct msm_gpu *gpu)
     /* Select CP0 to always count cycles */
     gpu_write(gpu, REG_A6XX_CP_PERFCTR_CP_SEL_0, PERF_CP_ALWAYS_COUNT);
 

drivers/gpu/drm/msm/adreno/a6xx_gpu.c static int a6xx_hw_init(struct msm_gpu *gpu) · line 478

Quoted 10 lines
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +6 -4
-    gpu_write(gpu, REG_A6XX_RB_NC_MODE_CNTL, 2 << 1);
-    gpu_write(gpu, REG_A6XX_TPL1_NC_MODE_CNTL, 2 << 1);
-    gpu_write(gpu, REG_A6XX_SP_NC_MODE_CNTL, 2 << 1);
-    gpu_write(gpu, REG_A6XX_UCHE_MODE_CNTL, 2 << 21);
+    if (adreno_is_a630(adreno_gpu)) {
+            gpu_write(gpu, REG_A6XX_RB_NC_MODE_CNTL, 2 << 1);
+            gpu_write(gpu, REG_A6XX_TPL1_NC_MODE_CNTL, 2 << 1);
+            gpu_write(gpu, REG_A6XX_SP_NC_MODE_CNTL, 2 << 1);
+            gpu_write(gpu, REG_A6XX_UCHE_MODE_CNTL, 2 << 21);
+    }

it shouldn't come as a surprise that everything in the a6xx family is going to have a highest bank bit setting. Even though the a618 uses the reset value, I think it would be less confusing to future folks if we explicitly program it:

Quoted 4 lines

if (adreno_is_a630(adreno_dev))
hbb = 2;
else
hbb = 0;

I think it would be better if we keep this in the adreno_info. Yes, this would waste a tiny bit of space for other gpu
entries in the gpulist. It is also possible to move this to a separate struct and keep a pointer to it in the adreno_info.
But that is something we should try when there are more a6xx specific configurations in future.

Quoted 3 lines

I have a new patch, but testing it is taking longer that I expected. I will share it as soon as possible.

I'm going to pull this in as-is for msm-fixes. Please rebase the change that you haven't posted yet on top of this patch, and send it as a cleanup for the next cycle. Thanks

BR,
-R