drm/komeda: Convert logging in d71_dev.c to drm_* with drm_device parameter
Subsystems (4)
PATCH 1/1 drm/komeda: Convert logging in d71_dev.c to drm_* with drm_device parameter
Replace DRM_DEBUG() and DRM_ERROR() calls in drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c with the drm_dbg() and drm_err() helpers in functions where a drm_device parameter is available.
The drm_*() logging macros require a struct drm_device * parameter, which allows the DRM core to prefix log messages with the device instance. This improves debugging clarity when multiple Komeda or other DRM devices are present.
Logging in early hardware probing functions such as d71_identify() is intentionally left unchanged because they do not have access to a drm_device pointer at that stage of initialization.
This conversion follows the DRM TODO entry:
"Convert logging to drm_* functions with drm_device parameter".
--- .../gpu/drm/arm/display/komeda/d71/d71_dev.c | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c +14 -7
@@ -9,6 +9,7 @@#include <drm/drm_print.h> #include "d71_dev.h" #include "malidp_io.h" +#include "komeda_kms.h" static u64 get_lpu_event (struct d71_pipeline *d71_pipeline) {
@@ -348,6 +349,8 @@ static void d71_cleanup(struct komeda_dev *mdev)static int d71_enum_resources (struct komeda_dev *mdev) { +struct komeda_kms_dev *kms =dev_get_drvdata (mdev->dev); +struct drm_device *drm = &kms->base;struct d71_dev *d71;struct komeda_pipeline *pipe;struct block_header blk;
@@ -366,7 +369,7 @@ static int d71_enum_resources(struct komeda_dev *mdev) err =d71_reset (d71);if (err) { -DRM_ERROR ("Fail to reset d71 device.\n" ); +drm_err (drm,"Fail to reset d71 device.\n" ); goto err_cleanup; }
@@ -376,8 +379,8 @@ static int d71_enum_resources(struct komeda_dev *mdev) d71->num_pipelines = (value >>8 ) &0x7 ;if (d71->num_pipelines >D71_MAX_PIPELINE ) { -DRM_ERROR ("d71 supports %d pipelines, but got: %d.\n" , -D71_MAX_PIPELINE , d71->num_pipelines); +drm_err (drm,"d71 supports %d pipelines, but got: %d.\n" , +D71_MAX_PIPELINE , d71->num_pipelines); err = -EINVAL ; goto err_cleanup; }
@@ -455,8 +458,8 @@ static int d71_enum_resources(struct komeda_dev *mdev) offset +=D71_BLOCK_SIZE ; } -DRM_DEBUG ("total %d (out of %d) blocks are found.\n" , - i, d71->num_blocks); +drm_dbg (drm,"total %d (out of %d) blocks are found.\n" , + i, d71->num_blocks);return 0 ;
@@ -555,6 +558,8 @@ static void d71_init_fmt_tbl(struct komeda_dev *mdev)static int d71_connect_iommu (struct komeda_dev *mdev) { +struct komeda_kms_dev *kms =dev_get_drvdata (mdev->dev); +struct drm_device *drm = &kms->base;struct d71_dev *d71 = mdev->chip_data;u32 __iomem *reg = d71->gcu_addr; u32 check_bits = (d71->num_pipelines == 2) ?
@@ -569,7 +574,7 @@ static int d71_connect_iommu(struct komeda_dev *mdev) ret =dp_wait_cond (has_bits (check_bits,malidp_read32 (reg,BLK_STATUS )),100 ,1000 ,1000 );if (ret <0 ) { -DRM_ERROR ("timed out connecting to TCU!\n" ); +drm_err (drm,"timed out connecting to TCU!\n" );malidp_write32_mask (reg,BLK_CONTROL ,0x7 ,INACTIVE_MODE );return ret; }
@@ -582,6 +587,8 @@ static int d71_connect_iommu(struct komeda_dev *mdev)static int d71_disconnect_iommu (struct komeda_dev *mdev) { +struct komeda_kms_dev *kms =dev_get_drvdata (mdev->dev); +struct drm_device *drm = &kms->base;struct d71_dev *d71 = mdev->chip_data;u32 __iomem *reg = d71->gcu_addr; u32 check_bits = (d71->num_pipelines == 2) ?
@@ -593,7 +600,7 @@ static int d71_disconnect_iommu(struct komeda_dev *mdev) ret =dp_wait_cond (((malidp_read32 (reg,BLK_STATUS ) & check_bits) ==0 ),100 ,1000 ,1000 );if (ret <0 ) { -DRM_ERROR ("timed out disconnecting from TCU!\n" ); +drm_err (drm,"timed out disconnecting from TCU!\n" );malidp_write32_mask (reg,BLK_CONTROL ,0x7 ,INACTIVE_MODE ); }
Signature · 1 line
2.43.0
Liviu Dudau
maintainerQuoted 10 lines · Rahul Kumar
Replace
DRM_DEBUG()andDRM_ERROR()calls indrivers/gpu/drm/arm/display/komeda/d71/d71_dev.cwith thedrm_dbg()anddrm_err()helpers in functions where adrm_deviceparameter is available.The drm_*() logging macros require a struct
drm_device* parameter, which allows the DRM core to prefix log messages with the device instance. This improves debugging clarity when multiple Komeda or other DRM devices are present.
Quoted 6 lines
Logging in early hardware probing functions such as
d71_identify()is intentionally left unchanged because they do not have access to adrm_devicepointer at that stage of initialization.This conversion follows the DRM TODO entry:
"Convert logging to drm_* functions withdrm_deviceparameter".
Hi Rahul,
It would've been nice if these patches were collected in a series.
Quoted 19 lines
Signed-off-by Rahul Kumar <[email protected]>--- .../gpu/drm/arm/display/komeda/d71/d71_dev.c | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c +1
-0@@ -9,6 +9,7 @@#include <drm/drm_print.h> #include "d71_dev.h" #include "malidp_io.h" +#include "komeda_kms.h" static u64 get_lpu_event (struct d71_pipeline *d71_pipeline) {
drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c static void d71_cleanup(struct komeda_dev *mdev) · line 352
Quoted 4 lines
drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c +1
-0@@ -348,6 +349,8 @@ static void d71_cleanup(struct komeda_dev *mdev)static int d71_enum_resources (struct komeda_dev *mdev) { +struct komeda_kms_dev *kms =dev_get_drvdata (mdev->dev);
I've made a mistake when I've reviewed the previous patch but it applies here too:
dev_get_drvdata(mdev->dev) is going to give you a struct komeda_drv pointer, because that is what we set it to in komeda_platform_probe(). So this patch and the previous one for komeda_pipeline.c are invalid and need a respin.
Best regards,
Liviu
Quoted 74 lines
drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c +12
-7+struct drm_device *drm = &kms->base;struct d71_dev *d71;struct komeda_pipeline *pipe;struct block_header blk;@@ -366,7 +369,7 @@ static int d71_enum_resources(struct komeda_dev *mdev) err =d71_reset (d71);if (err) { -DRM_ERROR ("Fail to reset d71 device.\n" ); +drm_err (drm,"Fail to reset d71 device.\n" ); goto err_cleanup; }@@ -376,8 +379,8 @@ static int d71_enum_resources(struct komeda_dev *mdev) d71->num_pipelines = (value >>8 ) &0x7 ;if (d71->num_pipelines >D71_MAX_PIPELINE ) { -DRM_ERROR ("d71 supports %d pipelines, but got: %d.\n" , -D71_MAX_PIPELINE , d71->num_pipelines); +drm_err (drm,"d71 supports %d pipelines, but got: %d.\n" , +D71_MAX_PIPELINE , d71->num_pipelines); err = -EINVAL ; goto err_cleanup; }@@ -455,8 +458,8 @@ static int d71_enum_resources(struct komeda_dev *mdev) offset +=D71_BLOCK_SIZE ; } -DRM_DEBUG ("total %d (out of %d) blocks are found.\n" , - i, d71->num_blocks); +drm_dbg (drm,"total %d (out of %d) blocks are found.\n" , + i, d71->num_blocks);return 0 ;@@ -555,6 +558,8 @@ static void d71_init_fmt_tbl(struct komeda_dev *mdev)static int d71_connect_iommu (struct komeda_dev *mdev) { +struct komeda_kms_dev *kms =dev_get_drvdata (mdev->dev); +struct drm_device *drm = &kms->base;struct d71_dev *d71 = mdev->chip_data;u32 __iomem *reg = d71->gcu_addr; u32 check_bits = (d71->num_pipelines == 2) ?@@ -569,7 +574,7 @@ static int d71_connect_iommu(struct komeda_dev *mdev) ret =dp_wait_cond (has_bits (check_bits,malidp_read32 (reg,BLK_STATUS )),100 ,1000 ,1000 );if (ret <0 ) { -DRM_ERROR ("timed out connecting to TCU!\n" ); +drm_err (drm,"timed out connecting to TCU!\n" );malidp_write32_mask (reg,BLK_CONTROL ,0x7 ,INACTIVE_MODE );return ret; }@@ -582,6 +587,8 @@ static int d71_connect_iommu(struct komeda_dev *mdev)static int d71_disconnect_iommu (struct komeda_dev *mdev) { +struct komeda_kms_dev *kms =dev_get_drvdata (mdev->dev); +struct drm_device *drm = &kms->base;struct d71_dev *d71 = mdev->chip_data;u32 __iomem *reg = d71->gcu_addr; u32 check_bits = (d71->num_pipelines == 2) ?@@ -593,7 +600,7 @@ static int d71_disconnect_iommu(struct komeda_dev *mdev) ret =dp_wait_cond (((malidp_read32 (reg,BLK_STATUS ) & check_bits) ==0 ),100 ,1000 ,1000 );if (ret <0 ) { -DRM_ERROR ("timed out disconnecting from TCU!\n" ); +drm_err (drm,"timed out disconnecting from TCU!\n" );malidp_write32_mask (reg,BLK_CONTROL ,0x7 ,INACTIVE_MODE ); }Signature · 1 line
2.43.0
Signature · 8 lines
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯