Skip to contentSkip to conversation

drm: msm: adreno: Use DRM_DEV_* instead of dev_*

PATCH In review Mamta Shukla 2 participants 3 messages Oct 18, 2018 – Oct 20, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: msm: adreno: Use DRM_DEV_* instead of dev_*

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.

---
 drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/msm/adreno/a5xx_gpu.c +5 -5
index 6a68493..bf8402d 100644
@@ -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);
 	}
 
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
reviewer
#1 lore raw
Quoted 6 lines · Mamta Shukla

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.

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

Quoted 54 lines
---
 drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/msm/adreno/a5xx_gpu.c +5 -6
index 6a68493..bf8402d 100644
@@ -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);
        }
 
--
Quoted 2 lines

1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
Quoted 14 lines · Sean Paul
Quoted 6 lines · Mamta Shukla

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.

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.

Quoted 4 lines

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.

Quoted 60 lines

Sean

Quoted 56 lines
---
 drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/msm/adreno/a5xx_gpu.c +5 -6
index 6a68493..bf8402d 100644
@@ -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

Signature · 5 lines
Mamta Shukla
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel