drm/msm/a5xx: really check for A510 in a5xx_gpu_init
Subsystems (4)
RFC PATCH 1/1 drm/msm/a5xx: really check for A510 in a5xx_gpu_init
The commit 010c8bbad2cb ("drm: msm: adreno: Disable preemption on Adreno 510") added special handling for a510 (this SKU doesn't seem to support preemption, so the driver should clamp nr_rings to 1). However the gpu->revn is not yet set (it is set later, in adreno_gpu_init()) and thus the condition is always false. Check config->rev instead.
--- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/msm/adreno/a5xx_gpu.c +2 -1
@@ -1743,6 +1743,7 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev) {struct msm_drm_private *priv = dev->dev_private;struct platform_device *pdev = priv->gpu_pdev; +struct adreno_platform_config *config = pdev->dev.platform_data;struct a5xx_gpu *a5xx_gpu =NULL ;struct adreno_gpu *adreno_gpu;struct msm_gpu *gpu;
@@ -1769,7 +1770,7 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev) nr_rings =4 ; -if (adreno_is_a510 (adreno_gpu)) +if (adreno_cmp_rev (ADRENO_REV (5 ,1 ,0 ,ANY_ID ), config->rev)) nr_rings =1 ; ret =adreno_gpu_init (dev, pdev, adreno_gpu, &funcs, nr_rings);
Signature · 1 line
2.30.2
Quoted 26 lines · Dmitry Baryshkov
The commit
010c8bbad2cb("drm: msm: adreno: Disable preemption on Adreno 510") added special handling for a510 (this SKU doesn't seem to support preemption, so the driver should clampnr_ringsto 1). However thegpu->revnis not yet set (it is set later, inadreno_gpu_init()) and thus the condition is always false. Checkconfig->revinstead.Fixes 010c8bbad2cb ("drm: msm: adreno: Disable preemption on Adreno 510")Reported-by Adam Skladowski <[email protected]>Signed-off-by Dmitry Baryshkov <[email protected]>--- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/msm/adreno/a5xx_gpu.c +1
-0@@ -1743,6 +1743,7 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev) {struct msm_drm_private *priv = dev->dev_private;struct platform_device *pdev = priv->gpu_pdev; +struct adreno_platform_config *config = pdev->dev.platform_data;struct a5xx_gpu *a5xx_gpu =NULL ;struct adreno_gpu *adreno_gpu;struct msm_gpu *gpu;
drivers/gpu/drm/msm/adreno/a5xx_gpu.c struct msm_gpu *a5xx_gpu_init(struct drm_device *dev) · line 1776
Quoted 8 lines
drivers/gpu/drm/msm/adreno/a5xx_gpu.c +1
-1@@ -1769,7 +1770,7 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev) nr_rings =4 ; -if (adreno_is_a510 (adreno_gpu)) +if (adreno_cmp_rev (ADRENO_REV (5 ,1 ,0 ,ANY_ID ), config->rev)) nr_rings =1 ; ret =adreno_gpu_init (dev, pdev, adreno_gpu, &funcs, nr_rings);
After testing on Leeco S2 it appears to work as intended now, thanks.
Quoting Dmitry Baryshkov (2023-04-08 18:13:29)
Quoted 10 lines
The commit
010c8bbad2cb("drm: msm: adreno: Disable preemption on Adreno 510") added special handling for a510 (this SKU doesn't seem to support preemption, so the driver should clampnr_ringsto 1). However thegpu->revnis not yet set (it is set later, inadreno_gpu_init()) and thus the condition is always false. Checkconfig->revinstead.Fixes 010c8bbad2cb ("drm: msm: adreno: Disable preemption on Adreno 510")Reported-by Adam Skladowski <[email protected]>Signed-off-by Dmitry Baryshkov <[email protected]>---
Maybe as a followup you can put a WARN_ON_ONCE() inside a new function that gets gpu->revn and warns if the value is 0?
Quoted 8 lines · Stephen Boyd
Quoting Dmitry Baryshkov (2023-04-08 18:13:29)
Quoted 6 lines
The commit
010c8bbad2cb("drm: msm: adreno: Disable preemption on Adreno 510") added special handling for a510 (this SKU doesn't seem to support preemption, so the driver should clampnr_ringsto 1). However thegpu->revnis not yet set (it is set later, inadreno_gpu_init()) and thus the condition is always false. Checkconfig->revinstead.
Quoted 7 lines
Quoted 4 lines
Fixes 010c8bbad2cb ("drm: msm: adreno: Disable preemption on Adreno 510")Reported-by Adam Skladowski <[email protected]>Signed-off-by Dmitry Baryshkov <[email protected]>---
Maybe as a followup you can put a
WARN_ON_ONCE()inside a new function that getsgpu->revnand warns if the value is 0?
Sounds like a good idea.
Signature · 2 lines
With best wishes Dmitry