diff mbox series

[v3] drm/msm/a2xx: Call adreno_gpu_init() earlier

Message ID 20230620232319.991918-1-festevam@gmail.com (mailing list archive)
State New, archived
Headers show
Series [v3] drm/msm/a2xx: Call adreno_gpu_init() earlier | expand

Commit Message

Fabio Estevam June 20, 2023, 11:23 p.m. UTC
From: Fabio Estevam <festevam@denx.de>

The adreno_is_a20x() and adreno_is_a225() functions rely on the
GPU revision, but such information is retrieved inside adreno_gpu_init(),
which is called afterwards.

Fix this problem by caling adreno_gpu_init() earlier, so that
the GPU information revision is available when adreno_is_a20x()
and adreno_is_a225() run.

Tested on a imx53-qsb board.

Fixes: 21af872cd8c6 ("drm/msm/adreno: add a2xx")
Signed-off-by: Fabio Estevam <festevam@denx.de>
---
Hi,

This error has been exposed by a recent commit in linux-next:

cc943f43ece7 ("drm/msm/adreno: warn if chip revn is verified before being set")

, but the error has been present since the very first a2xx commit.

Changes since v2:
- Call adreno_gpu_init() earlier.

 drivers/gpu/drm/msm/adreno/a2xx_gpu.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Dmitry Baryshkov June 22, 2023, 6:37 p.m. UTC | #1
On 21/06/2023 02:23, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
> 
> The adreno_is_a20x() and adreno_is_a225() functions rely on the
> GPU revision, but such information is retrieved inside adreno_gpu_init(),
> which is called afterwards.
> 
> Fix this problem by caling adreno_gpu_init() earlier, so that
> the GPU information revision is available when adreno_is_a20x()
> and adreno_is_a225() run.
> 
> Tested on a imx53-qsb board.
> 
> Fixes: 21af872cd8c6 ("drm/msm/adreno: add a2xx")
> Signed-off-by: Fabio Estevam <festevam@denx.de>
> ---
> Hi,
> 
> This error has been exposed by a recent commit in linux-next:
> 
> cc943f43ece7 ("drm/msm/adreno: warn if chip revn is verified before being set")
> 
> , but the error has been present since the very first a2xx commit.
> 
> Changes since v2:
> - Call adreno_gpu_init() earlier.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>


> 
>   drivers/gpu/drm/msm/adreno/a2xx_gpu.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
Fabio Estevam July 24, 2023, 8:28 p.m. UTC | #2
Hi Rob,

A gentle ping.

On Thu, Jun 22, 2023 at 3:37 PM Dmitry Baryshkov
<dmitry.baryshkov@linaro.org> wrote:
>
> On 21/06/2023 02:23, Fabio Estevam wrote:
> > From: Fabio Estevam <festevam@denx.de>
> >
> > The adreno_is_a20x() and adreno_is_a225() functions rely on the
> > GPU revision, but such information is retrieved inside adreno_gpu_init(),
> > which is called afterwards.
> >
> > Fix this problem by caling adreno_gpu_init() earlier, so that
> > the GPU information revision is available when adreno_is_a20x()
> > and adreno_is_a225() run.
> >
> > Tested on a imx53-qsb board.
> >
> > Fixes: 21af872cd8c6 ("drm/msm/adreno: add a2xx")
> > Signed-off-by: Fabio Estevam <festevam@denx.de>
> > ---
> > Hi,
> >
> > This error has been exposed by a recent commit in linux-next:
> >
> > cc943f43ece7 ("drm/msm/adreno: warn if chip revn is verified before being set")
> >
> > , but the error has been present since the very first a2xx commit.
> >
> > Changes since v2:
> > - Call adreno_gpu_init() earlier.
>
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>
>
> >
> >   drivers/gpu/drm/msm/adreno/a2xx_gpu.c | 8 ++++----
> >   1 file changed, 4 insertions(+), 4 deletions(-)
>
>
> --
> With best wishes
> Dmitry
>
Fabio Estevam Aug. 11, 2023, 4:11 p.m. UTC | #3
Hi Rob,

Any comments, please?

On Mon, Jul 24, 2023 at 5:28 PM Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi Rob,
>
> A gentle ping.
>
> On Thu, Jun 22, 2023 at 3:37 PM Dmitry Baryshkov
> <dmitry.baryshkov@linaro.org> wrote:
> >
> > On 21/06/2023 02:23, Fabio Estevam wrote:
> > > From: Fabio Estevam <festevam@denx.de>
> > >
> > > The adreno_is_a20x() and adreno_is_a225() functions rely on the
> > > GPU revision, but such information is retrieved inside adreno_gpu_init(),
> > > which is called afterwards.
> > >
> > > Fix this problem by caling adreno_gpu_init() earlier, so that
> > > the GPU information revision is available when adreno_is_a20x()
> > > and adreno_is_a225() run.
> > >
> > > Tested on a imx53-qsb board.
> > >
> > > Fixes: 21af872cd8c6 ("drm/msm/adreno: add a2xx")
> > > Signed-off-by: Fabio Estevam <festevam@denx.de>
> > > ---
> > > Hi,
> > >
> > > This error has been exposed by a recent commit in linux-next:
> > >
> > > cc943f43ece7 ("drm/msm/adreno: warn if chip revn is verified before being set")
> > >
> > > , but the error has been present since the very first a2xx commit.
> > >
> > > Changes since v2:
> > > - Call adreno_gpu_init() earlier.
> >
> > Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> >
> >
> > >
> > >   drivers/gpu/drm/msm/adreno/a2xx_gpu.c | 8 ++++----
> > >   1 file changed, 4 insertions(+), 4 deletions(-)
> >
> >
> > --
> > With best wishes
> > Dmitry
> >
Rob Clark Aug. 11, 2023, 7 p.m. UTC | #4
It is in https://gitlab.freedesktop.org/drm/msm/-/merge_requests/75 so
should be in msm-next for v6.6

BR,
-R

On Fri, Aug 11, 2023 at 9:11 AM Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi Rob,
>
> Any comments, please?
>
> On Mon, Jul 24, 2023 at 5:28 PM Fabio Estevam <festevam@gmail.com> wrote:
> >
> > Hi Rob,
> >
> > A gentle ping.
> >
> > On Thu, Jun 22, 2023 at 3:37 PM Dmitry Baryshkov
> > <dmitry.baryshkov@linaro.org> wrote:
> > >
> > > On 21/06/2023 02:23, Fabio Estevam wrote:
> > > > From: Fabio Estevam <festevam@denx.de>
> > > >
> > > > The adreno_is_a20x() and adreno_is_a225() functions rely on the
> > > > GPU revision, but such information is retrieved inside adreno_gpu_init(),
> > > > which is called afterwards.
> > > >
> > > > Fix this problem by caling adreno_gpu_init() earlier, so that
> > > > the GPU information revision is available when adreno_is_a20x()
> > > > and adreno_is_a225() run.
> > > >
> > > > Tested on a imx53-qsb board.
> > > >
> > > > Fixes: 21af872cd8c6 ("drm/msm/adreno: add a2xx")
> > > > Signed-off-by: Fabio Estevam <festevam@denx.de>
> > > > ---
> > > > Hi,
> > > >
> > > > This error has been exposed by a recent commit in linux-next:
> > > >
> > > > cc943f43ece7 ("drm/msm/adreno: warn if chip revn is verified before being set")
> > > >
> > > > , but the error has been present since the very first a2xx commit.
> > > >
> > > > Changes since v2:
> > > > - Call adreno_gpu_init() earlier.
> > >
> > > Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > >
> > >
> > > >
> > > >   drivers/gpu/drm/msm/adreno/a2xx_gpu.c | 8 ++++----
> > > >   1 file changed, 4 insertions(+), 4 deletions(-)
> > >
> > >
> > > --
> > > With best wishes
> > > Dmitry
> > >
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/adreno/a2xx_gpu.c b/drivers/gpu/drm/msm/adreno/a2xx_gpu.c
index c67089a7ebc1..ad4570d60abf 100644
--- a/drivers/gpu/drm/msm/adreno/a2xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a2xx_gpu.c
@@ -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) {