diff mbox series

[DRM] drm: msm: adreno: Use DRM_DEV_* instead of dev_*

Message ID 20181018183322.GA10769@armorer (mailing list archive)
State New, archived
Headers show
Series [DRM] drm: msm: adreno: Use DRM_DEV_* instead of dev_* | expand

Commit Message

Mamta Shukla Oct. 18, 2018, 6:33 p.m. UTC
Use DRM_DEV_INFO/ERROR/WARN instead of dev_info/err/debug to generate
drm-formatted specific log messages so that it will be easy to
differentiate in case of multiple instances of driver.

Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com>
---
 drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Sean Paul Oct. 19, 2018, 8:40 p.m. UTC | #1
On Thu, Oct 18, 2018 at 2:33 PM Mamta Shukla <mamtashukla555@gmail.com> wrote:
>
> Use DRM_DEV_INFO/ERROR/WARN instead of dev_info/err/debug to generate
> drm-formatted specific log messages so that it will be easy to
> differentiate in case of multiple instances of driver.
>
> Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com>

Hi Mamta,
Thank you for the patch! Any plans to convert more than just the one
file? Ideally we'd switch (or commit to switching) the entire driver
to avoid having to use 2 patterns when grepping for logs.

If you don't want to bite off the entire msm driver, perhaps do all of
adreno/, all of the msm* files, all of disp/mdp[4,5], etc. Another
good bite-sized piece would be converting the DPU_* log messages to
DRM_DEV* in disp/dpu1/*

Sean



> ---
>  drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> index 6a68493..bf8402d 100644
> --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> @@ -514,7 +514,7 @@ static int a5xx_ucode_init(struct msm_gpu *gpu)
>                 if (IS_ERR(a5xx_gpu->pm4_bo)) {
>                         ret = PTR_ERR(a5xx_gpu->pm4_bo);
>                         a5xx_gpu->pm4_bo = NULL;
> -                       dev_err(gpu->dev->dev, "could not allocate PM4: %d\n",
> +                       DRM_DEV_ERROR(gpu->dev->dev, "could not allocate PM4: %d\n",
>                                 ret);
>                         return ret;
>                 }
> @@ -527,7 +527,7 @@ static int a5xx_ucode_init(struct msm_gpu *gpu)
>                 if (IS_ERR(a5xx_gpu->pfp_bo)) {
>                         ret = PTR_ERR(a5xx_gpu->pfp_bo);
>                         a5xx_gpu->pfp_bo = NULL;
> -                       dev_err(gpu->dev->dev, "could not allocate PFP: %d\n",
> +                       DRM_DEV_ERROR(gpu->dev->dev, "could not allocate PFP: %d\n",
>                                 ret);
>                         return ret;
>                 }
> @@ -1028,7 +1028,7 @@ static void a5xx_fault_detect_irq(struct msm_gpu *gpu)
>         struct msm_drm_private *priv = dev->dev_private;
>         struct msm_ringbuffer *ring = gpu->funcs->active_ring(gpu);
>
> -       dev_err(dev->dev, "gpu fault ring %d fence %x status %8.8X rb %4.4x/%4.4x ib1 %16.16llX/%4.4x ib2 %16.16llX/%4.4x\n",
> +       DRM_DEV_ERROR(dev->dev, "gpu fault ring %d fence %x status %8.8X rb %4.4x/%4.4x ib1 %16.16llX/%4.4x ib2 %16.16llX/%4.4x\n",
>                 ring ? ring->id : -1, ring ? ring->seqno : 0,
>                 gpu_read(gpu, REG_A5XX_RBBM_STATUS),
>                 gpu_read(gpu, REG_A5XX_CP_RB_RPTR),
> @@ -1134,7 +1134,7 @@ static irqreturn_t a5xx_irq(struct msm_gpu *gpu)
>
>  static void a5xx_dump(struct msm_gpu *gpu)
>  {
> -       dev_info(gpu->dev->dev, "status:   %08x\n",
> +       DRM_DEV_INFO(gpu->dev->dev, "status:   %08x\n",
>                 gpu_read(gpu, REG_A5XX_RBBM_STATUS));
>         adreno_dump(gpu);
>  }
> @@ -1498,7 +1498,7 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev)
>         int ret;
>
>         if (!pdev) {
> -               dev_err(dev->dev, "No A5XX device is defined\n");
> +               DRM_DEV_ERROR(dev->dev, "No A5XX device is defined\n");
>                 return ERR_PTR(-ENXIO);
>         }
>
> --
> 1.9.1
>
Mamta Shukla Oct. 20, 2018, 6:09 a.m. UTC | #2
On Sat, Oct 20, 2018 at 2:11 AM Sean Paul <sean@poorly.run> wrote:
>
> On Thu, Oct 18, 2018 at 2:33 PM Mamta Shukla <mamtashukla555@gmail.com> wrote:
> >
> > Use DRM_DEV_INFO/ERROR/WARN instead of dev_info/err/debug to generate
> > drm-formatted specific log messages so that it will be easy to
> > differentiate in case of multiple instances of driver.
> >
> > Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com>
>
> Hi Mamta,
> Thank you for the patch! Any plans to convert more than just the one
> file? Ideally we'd switch (or commit to switching) the entire driver
> to avoid having to use 2 patterns when grepping for logs.
>
> If you don't want to bite off the entire msm driver, perhaps do all of
> adreno/, all of the msm* files, all of disp/mdp[4,5], etc. Another
> good bite-sized piece would be converting the DPU_* log messages to
> DRM_DEV* in disp/dpu1/*

Thank you for the feedback.
I will do these changes for msm driver to maintain uniformity for the
entire driver rather than
just a file.


> Sean
>
>
>
> > ---
> >  drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> > index 6a68493..bf8402d 100644
> > --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> > +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> > @@ -514,7 +514,7 @@ static int a5xx_ucode_init(struct msm_gpu *gpu)
> >                 if (IS_ERR(a5xx_gpu->pm4_bo)) {
> >                         ret = PTR_ERR(a5xx_gpu->pm4_bo);
> >                         a5xx_gpu->pm4_bo = NULL;
> > -                       dev_err(gpu->dev->dev, "could not allocate PM4: %d\n",
> > +                       DRM_DEV_ERROR(gpu->dev->dev, "could not allocate PM4: %d\n",
> >                                 ret);
> >                         return ret;
> >                 }
> > @@ -527,7 +527,7 @@ static int a5xx_ucode_init(struct msm_gpu *gpu)
> >                 if (IS_ERR(a5xx_gpu->pfp_bo)) {
> >                         ret = PTR_ERR(a5xx_gpu->pfp_bo);
> >                         a5xx_gpu->pfp_bo = NULL;
> > -                       dev_err(gpu->dev->dev, "could not allocate PFP: %d\n",
> > +                       DRM_DEV_ERROR(gpu->dev->dev, "could not allocate PFP: %d\n",
> >                                 ret);
> >                         return ret;
> >                 }
> > @@ -1028,7 +1028,7 @@ static void a5xx_fault_detect_irq(struct msm_gpu *gpu)
> >         struct msm_drm_private *priv = dev->dev_private;
> >         struct msm_ringbuffer *ring = gpu->funcs->active_ring(gpu);
> >
> > -       dev_err(dev->dev, "gpu fault ring %d fence %x status %8.8X rb %4.4x/%4.4x ib1 %16.16llX/%4.4x ib2 %16.16llX/%4.4x\n",
> > +       DRM_DEV_ERROR(dev->dev, "gpu fault ring %d fence %x status %8.8X rb %4.4x/%4.4x ib1 %16.16llX/%4.4x ib2 %16.16llX/%4.4x\n",
> >                 ring ? ring->id : -1, ring ? ring->seqno : 0,
> >                 gpu_read(gpu, REG_A5XX_RBBM_STATUS),
> >                 gpu_read(gpu, REG_A5XX_CP_RB_RPTR),
> > @@ -1134,7 +1134,7 @@ static irqreturn_t a5xx_irq(struct msm_gpu *gpu)
> >
> >  static void a5xx_dump(struct msm_gpu *gpu)
> >  {
> > -       dev_info(gpu->dev->dev, "status:   %08x\n",
> > +       DRM_DEV_INFO(gpu->dev->dev, "status:   %08x\n",
> >                 gpu_read(gpu, REG_A5XX_RBBM_STATUS));
> >         adreno_dump(gpu);
> >  }
> > @@ -1498,7 +1498,7 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev)
> >         int ret;
> >
> >         if (!pdev) {
> > -               dev_err(dev->dev, "No A5XX device is defined\n");
> > +               DRM_DEV_ERROR(dev->dev, "No A5XX device is defined\n");
> >                 return ERR_PTR(-ENXIO);
> >         }
> >
> > --
> > 1.9.1
> >
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
index 6a68493..bf8402d 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
@@ -514,7 +514,7 @@  static int a5xx_ucode_init(struct msm_gpu *gpu)
 		if (IS_ERR(a5xx_gpu->pm4_bo)) {
 			ret = PTR_ERR(a5xx_gpu->pm4_bo);
 			a5xx_gpu->pm4_bo = NULL;
-			dev_err(gpu->dev->dev, "could not allocate PM4: %d\n",
+			DRM_DEV_ERROR(gpu->dev->dev, "could not allocate PM4: %d\n",
 				ret);
 			return ret;
 		}
@@ -527,7 +527,7 @@  static int a5xx_ucode_init(struct msm_gpu *gpu)
 		if (IS_ERR(a5xx_gpu->pfp_bo)) {
 			ret = PTR_ERR(a5xx_gpu->pfp_bo);
 			a5xx_gpu->pfp_bo = NULL;
-			dev_err(gpu->dev->dev, "could not allocate PFP: %d\n",
+			DRM_DEV_ERROR(gpu->dev->dev, "could not allocate PFP: %d\n",
 				ret);
 			return ret;
 		}
@@ -1028,7 +1028,7 @@  static void a5xx_fault_detect_irq(struct msm_gpu *gpu)
 	struct msm_drm_private *priv = dev->dev_private;
 	struct msm_ringbuffer *ring = gpu->funcs->active_ring(gpu);
 
-	dev_err(dev->dev, "gpu fault ring %d fence %x status %8.8X rb %4.4x/%4.4x ib1 %16.16llX/%4.4x ib2 %16.16llX/%4.4x\n",
+	DRM_DEV_ERROR(dev->dev, "gpu fault ring %d fence %x status %8.8X rb %4.4x/%4.4x ib1 %16.16llX/%4.4x ib2 %16.16llX/%4.4x\n",
 		ring ? ring->id : -1, ring ? ring->seqno : 0,
 		gpu_read(gpu, REG_A5XX_RBBM_STATUS),
 		gpu_read(gpu, REG_A5XX_CP_RB_RPTR),
@@ -1134,7 +1134,7 @@  static irqreturn_t a5xx_irq(struct msm_gpu *gpu)
 
 static void a5xx_dump(struct msm_gpu *gpu)
 {
-	dev_info(gpu->dev->dev, "status:   %08x\n",
+	DRM_DEV_INFO(gpu->dev->dev, "status:   %08x\n",
 		gpu_read(gpu, REG_A5XX_RBBM_STATUS));
 	adreno_dump(gpu);
 }
@@ -1498,7 +1498,7 @@  struct msm_gpu *a5xx_gpu_init(struct drm_device *dev)
 	int ret;
 
 	if (!pdev) {
-		dev_err(dev->dev, "No A5XX device is defined\n");
+		DRM_DEV_ERROR(dev->dev, "No A5XX device is defined\n");
 		return ERR_PTR(-ENXIO);
 	}