drm/msm/a3xx: Pass the revision information
Subsystems (3)
PATCH 1/3 drm/msm/a3xx: Pass the revision information
From: Fabio Estevam <[email protected]>
Commit cc943f43ece7 ("drm/msm/adreno: warn if chip revn is verified before being set") exposes the need of setting the GPU revision fields prior to using the adreno_is_xxx() functions.
Pass the GPU revision information to avoid run-time warning.
---
Build-tested only.
drivers/gpu/drm/msm/adreno/a3xx_gpu.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
drivers/gpu/drm/msm/adreno/a3xx_gpu.c +21 -0
@@ -530,6 +530,8 @@ struct msm_gpu *a3xx_gpu_init(struct drm_device *dev)struct msm_gpu *gpu;struct msm_drm_private *priv = dev->dev_private;struct platform_device *pdev = priv->gpu_pdev; +struct adreno_platform_config *config = pdev->dev.platform_data; +const struct adreno_info *info;struct icc_path *ocmem_icc_path;struct icc_path *icc_path;int ret;
@@ -558,6 +560,25 @@ struct msm_gpu *a3xx_gpu_init(struct drm_device *dev)if (ret) goto fail; +/* +* We need to know the platform type before calling into adreno_gpu_init +* so that the hw_apriv flag can be correctly set. Snoop into the info +* and grab the revision number +*/ + info =adreno_info (config->rev); +if (!info) { + ret = -EINVAL ; + goto fail; + } + +/* Assign these early so that we can use the is_aXYZ helpers */ +/* Numeric revision IDs (e.g. 630) */ + adreno_gpu->revn = info->revn; +/* New-style ADRENO_REV()-only */ + adreno_gpu->rev = info->rev; +/* Quirk data */ + adreno_gpu->info = info; +/* if needed, allocate gmem: */ if (adreno_is_a330 (adreno_gpu)) { ret = adreno_gpu_ocmem_init(&adreno_gpu->base.pdev->dev,
Signature · 1 line
2.34.1
PATCH 2/3 drm/msm/43xx: Pass the revision information
From: Fabio Estevam <[email protected]>
Commit cc943f43ece7 ("drm/msm/adreno: warn if chip revn is verified before being set") exposes the need of setting the GPU revision fields prior to using the adreno_is_xxx() functions.
Pass the GPU revision information to avoid run-time warning.
---
Build-tested only.
drivers/gpu/drm/msm/adreno/a4xx_gpu.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
drivers/gpu/drm/msm/adreno/a4xx_gpu.c +21 -0
@@ -658,6 +658,8 @@ struct msm_gpu *a4xx_gpu_init(struct drm_device *dev)struct msm_gpu *gpu;struct msm_drm_private *priv = dev->dev_private;struct platform_device *pdev = priv->gpu_pdev; +struct adreno_platform_config *config = pdev->dev.platform_data; +const struct adreno_info *info;struct icc_path *ocmem_icc_path;struct icc_path *icc_path;int ret;
@@ -684,6 +686,25 @@ struct msm_gpu *a4xx_gpu_init(struct drm_device *dev)if (ret) goto fail; +/* +* We need to know the platform type before calling into adreno_gpu_init +* so that the hw_apriv flag can be correctly set. Snoop into the info +* and grab the revision number +*/ + info =adreno_info (config->rev); +if (!info) { + ret = -EINVAL ; + goto fail; + } + +/* Assign these early so that we can use the is_aXYZ helpers */ +/* Numeric revision IDs (e.g. 630) */ + adreno_gpu->revn = info->revn; +/* New-style ADRENO_REV()-only */ + adreno_gpu->rev = info->rev; +/* Quirk data */ + adreno_gpu->info = info; + adreno_gpu->registers =adreno_is_a405 (adreno_gpu) ? a405_registers : a4xx_registers;
Signature · 1 line
2.34.1
PATCH 3/3 drm/msm/a5xx: Pass the revision information
In reply to Fabio EstevamFrom: Fabio Estevam <[email protected]>
Commit cc943f43ece7 ("drm/msm/adreno: warn if chip revn is verified before being set") exposes the need of setting the GPU revision fields prior to using the adreno_is_xxx() functions.
Pass the GPU revision information to avoid run-time warning.
---
Build-tested only.
drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
drivers/gpu/drm/msm/adreno/a5xx_gpu.c +18 -0
@@ -1744,6 +1744,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; +const struct adreno_info *info;struct a5xx_gpu *a5xx_gpu =NULL ;struct adreno_gpu *adreno_gpu;struct msm_gpu *gpu;
@@ -1770,6 +1771,23 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev) nr_rings =4 ; +/* +* We need to know the platform type before calling into adreno_gpu_init +* so that the hw_apriv flag can be correctly set. Snoop into the info +* and grab the revision number +*/ + info =adreno_info (config->rev); +if (!info) +return ERR_PTR (-EINVAL ); + +/* Assign these early so that we can use the is_aXYZ helpers */ +/* Numeric revision IDs (e.g. 630) */ + adreno_gpu->revn = info->revn; +/* New-style ADRENO_REV()-only */ + adreno_gpu->rev = info->rev; +/* Quirk data */ + adreno_gpu->info = info; +if (adreno_cmp_rev (ADRENO_REV (5 ,1 ,0 ,ANY_ID ), config->rev)) nr_rings =1 ;
Signature · 1 line
2.34.1
Quoted 9 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
Commit
cc943f43ece7("drm/msm/adreno: warn if chip revn is verified before being set") exposes the need of setting the GPU revision fields prior to using theadreno_is_xxx()functions.Pass the GPU revision information to avoid run-time warning.
Signed-off-by Fabio Estevam <[email protected]>
I'll take a glance later. Generic comment, you missed freedreno@, so these patches will not pop up in our patch tracker. Also could you please use git send-email passing all patches to the command, so that they are threaded?
Quoted 31 lines
---
Build-tested only.drivers/gpu/drm/msm/adreno/a3xx_gpu.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)drivers/gpu/drm/msm/adreno/a3xx_gpu.c +10
-0@@ -530,6 +530,8 @@ struct msm_gpu *a3xx_gpu_init(struct drm_device *dev)struct msm_gpu *gpu;struct msm_drm_private *priv = dev->dev_private;struct platform_device *pdev = priv->gpu_pdev; +struct adreno_platform_config *config = pdev->dev.platform_data; +const struct adreno_info *info;struct icc_path *ocmem_icc_path;struct icc_path *icc_path;int ret;@@ -558,6 +560,25 @@ struct msm_gpu *a3xx_gpu_init(struct drm_device *dev)if (ret) goto fail; +/* +* We need to know the platform type before calling into adreno_gpu_init +* so that the hw_apriv flag can be correctly set. Snoop into the info +* and grab the revision number +*/ + info =adreno_info (config->rev); +if (!info) { + ret = -EINVAL ;
drivers/gpu/drm/msm/adreno/a3xx_gpu.c struct msm_gpu *a3xx_gpu_init(struct drm_device *dev) · line 580
Quoted 10 lines
drivers/gpu/drm/msm/adreno/a3xx_gpu.c +10
-0+ goto fail; + } + +/* Assign these early so that we can use the is_aXYZ helpers */ +/* Numeric revision IDs (e.g. 630) */ + adreno_gpu->revn = info->revn; +/* New-style ADRENO_REV()-only */ + adreno_gpu->rev = info->rev; +/* Quirk data */ + adreno_gpu->info = info;
This looks like a boilerplate being added to all aYxx drivers (and then these fields are also set in adreno_gpu_init()). Can we remove duplication somehow?
Quoted 4 lines
drivers/gpu/drm/msm/adreno/a3xx_gpu.c +1
-0+/* if needed, allocate gmem: */ if (adreno_is_a330 (adreno_gpu)) { ret = adreno_gpu_ocmem_init(&adreno_gpu->base.pdev->dev,
Signature · 2 lines
With best wishes Dmitry
Quoted 3 lines · Dmitry Baryshkov
This looks like a boilerplate being added to all aYxx drivers (and then these fields are also set in
adreno_gpu_init()). Can we remove duplication somehow?
Sorry, I missed this comment prior to sending v2.
Maybe a simpler fix for a2xx_gpu would be:
drivers/gpu/drm/msm/adreno/a2xx_gpu.c +4 -4
@@ -540,6 +540,10 @@ struct msm_gpu *a2xx_gpu_init(struct drm_device *dev) gpu->perfcntrs = perfcntrs; gpu->num_perfcntrs =ARRAY_SIZE (perfcntrs); + ret =adreno_gpu_init (dev, pdev, adreno_gpu, &funcs,1 ); +if (ret) + goto fail; +if (adreno_is_a20x (adreno_gpu)) adreno_gpu->registers = a200_registers;else if (adreno_is_a225 (adreno_gpu))
@@ -547,10 +551,6 @@ struct msm_gpu *a2xx_gpu_init(struct drm_device *dev)else adreno_gpu->registers = a220_registers; - ret =adreno_gpu_init (dev, pdev, adreno_gpu, &funcs,1 ); -if (ret) - goto fail; -if (!gpu->aspace) {dev_err (dev->dev,"No memory protection without MMU\n" );if (!allow_vram_carveout) {
What do you think?
a3xx and a4xx call adreno_gpu_init() prior to adreno_is_xxx() so they don't have issues.
Quoted 38 lines · Fabio Estevam
Quoted 3 lines · Dmitry Baryshkov
This looks like a boilerplate being added to all aYxx drivers (and then these fields are also set in
adreno_gpu_init()). Can we remove duplication somehow?Sorry, I missed this comment prior to sending v2.
Maybe a simpler fix for
a2xx_gpuwould be:drivers/gpu/drm/msm/adreno/a2xx_gpu.c +4
-0@@ -540,6 +540,10 @@ struct msm_gpu *a2xx_gpu_init(struct drm_device *dev) gpu->perfcntrs = perfcntrs; gpu->num_perfcntrs =ARRAY_SIZE (perfcntrs); + ret =adreno_gpu_init (dev, pdev, adreno_gpu, &funcs,1 ); +if (ret) + goto fail; +if (adreno_is_a20x (adreno_gpu)) adreno_gpu->registers = a200_registers;else if (adreno_is_a225(adreno_gpu))drivers/gpu/drm/msm/adreno/a2xx_gpu.c +0
-4@@ -547,10 +551,6 @@ struct msm_gpu *a2xx_gpu_init(struct drm_device *dev) else adreno_gpu->registers = a220_registers; - ret =adreno_gpu_init (dev, pdev, adreno_gpu, &funcs,1 ); -if (ret) - goto fail; -if (!gpu->aspace) {dev_err (dev->dev,"No memory protection without MMU\n" );if (!allow_vram_carveout) {
Quoted 4 lines
What do you think?
a3xx and a4xx call
adreno_gpu_init()prior toadreno_is_xxx()so they don't have issues.
Yes, this seems like a perfect solution. Please send it with the proper commit message. Also please add:
Signature · 2 lines
With best wishes Dmitry