Skip to contentSkip to conversation

drm/msm/a8xx: Add missing preempt_record_size

PATCH In review Rob Clark 3 participants 3 messages Nov 23

Subsystems (4)
lore
Share & tools
lore

Rob Clark

author maintainer
#0 lore raw

PATCH v2 1/1 drm/msm/a8xx: Add missing preempt_record_size

Somehow this got overlooked, and Glymur/Mahua were falling back to the default 4MB. Which is way too small for the amount of GMEM on these devices, causing faults in cases where preemption needs to save GMEM contents.

Fixes 7fad33097e67 ("drm/msm/a6xx: Enable Preemption on X2-85")

---
v2: Fix typo in commit msg

 drivers/gpu/drm/msm/adreno/a8xx_catalog.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/msm/adreno/a8xx_catalog.c +2 -0
index 0c6dde3cbea9..20fe93b83c0b 100644
@@ -1337,6 +1337,7 @@ static const struct adreno_info a8xx_gpus[] = {
 				{ /* sentinel */ },
 			},
 		},
+		.preempt_record_size = 23088 * SZ_1K,
 		.speedbins = ADRENO_SPEEDBINS(
 			{ 0,   0 },
 			{ 388, 1 },
@@ -1469,6 +1470,7 @@ static const struct adreno_info a8xx_gpus[] = {
 				{ /* sentinel */ },
 			},
 		},
+		.preempt_record_size = 17712 * SZ_1K,
 		.speedbins = ADRENO_SPEEDBINS(
 			{ 0,   0 },
 			{ 388, 1 },
Signature · 1 line
2.56.1
reviewer Reviewed-by on v2 1/1
#1 lore raw
Quoted 9 lines · Rob Clark

Somehow this got overlooked, and Glymur/Mahua were falling back to the default 4MB. Which is way too small for the amount of GMEM on these devices, causing faults in cases where preemption needs to save GMEM contents.

Fixes 7fad33097e67 ("drm/msm/a6xx: Enable Preemption on X2-85")

I think it is a good idea to add a WARN_ONCE when the default size is used.

-Akhil.

Quoted 26 lines

---
v2: Fix typo in commit msg

 drivers/gpu/drm/msm/adreno/a8xx_catalog.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/msm/adreno/a8xx_catalog.c +2 -0
index 0c6dde3cbea9..20fe93b83c0b 100644
@@ -1337,6 +1337,7 @@ static const struct adreno_info a8xx_gpus[] = {
 				{ /* sentinel */ },
 			},
 		},
+		.preempt_record_size = 23088 * SZ_1K,
 		.speedbins = ADRENO_SPEEDBINS(
 			{ 0,   0 },
 			{ 388, 1 },
@@ -1469,6 +1470,7 @@ static const struct adreno_info a8xx_gpus[] = {
 				{ /* sentinel */ },
 			},
 		},
+		.preempt_record_size = 17712 * SZ_1K,
 		.speedbins = ADRENO_SPEEDBINS(
 			{ 0,   0 },
 			{ 388, 1 },
#2 lore raw
Quoted 9 lines · Akhil P Oommen
Quoted 5 lines · Rob Clark

Somehow this got overlooked, and Glymur/Mahua were falling back to the default 4MB. Which is way too small for the amount of GMEM on these devices, causing faults in cases where preemption needs to save GMEM contents.

Quoted 8 lines
Quoted 4 lines
Fixes 7fad33097e67 ("drm/msm/a6xx: Enable Preemption on X2-85")

I think it is a good idea to add a WARN_ONCE when the default size is used.

More generally, we should probably just warn if the preemption record size is less than gmem size.. (we could probably also make the preemption record size smaller on ring0, I think?)

BR,
-R

Quoted 29 lines

-Akhil.

Quoted 26 lines

---
v2: Fix typo in commit msg

 drivers/gpu/drm/msm/adreno/a8xx_catalog.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/msm/adreno/a8xx_catalog.c +2 -0
index 0c6dde3cbea9..20fe93b83c0b 100644
@@ -1337,6 +1337,7 @@ static const struct adreno_info a8xx_gpus[] = {
                              { /* sentinel */ },
                      },
              },
+             .preempt_record_size = 23088 * SZ_1K,
              .speedbins = ADRENO_SPEEDBINS(
                      { 0,   0 },
                      { 388, 1 },
@@ -1469,6 +1470,7 @@ static const struct adreno_info a8xx_gpus[] = {
                              { /* sentinel */ },
                      },
              },
+             .preempt_record_size = 17712 * SZ_1K,
              .speedbins = ADRENO_SPEEDBINS(
                      { 0,   0 },
                      { 388, 1 },