drm/amd/amdgpu: Add print format prefix
Subsystems (3)
v2 cover drm/amd/amdgpu: Add print format prefix
Changes in v2
* Add dev_fmt format prefix
* Removed hardcoded module names in pr_* and dev_* prints
Aurabindo Pillai (3):
drm/amd/amdgpu: add prefix for pr_* prints drm/amd/amdgpu: add print prefix for dev_* variants drm/amd/amdgpu: remove hardcoded module name in prints
drivers/gpu/drm/amd/amdgpu/amdgpu.h | 12 ++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 2 +- drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 2 +- 7 files changed, 21 insertions(+), 9 deletions(-)
Signature · 1 line
2.26.0
PATCH v2 1/3 drm/amd/amdgpu: add prefix for pr_* prints
amdgpu uses lots of pr_* calls for printing error messages. With this prefix, errors shall be more obvious to the end use regarding its origin, and may help debugging.
Prefix format:
[xxx.xxxxx] amdgpu: ...
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +6 -0
@@ -28,6 +28,12 @@#ifndef __AMDGPU_H__#define __AMDGPU_H__ +#ifdef pr_fmt +#undef pr_fmt +#endif + +#define pr_fmt (fmt) "amdgpu: " fmt +#include "amdgpu_ctx.h" #include <linux/atomic.h>
Signature · 1 line
2.26.0
PATCH v2 2/3 drm/amd/amdgpu: add print prefix for dev_* variants
In reply to Aurabindo PillaiDefine dev_fmt macro for informative print messages
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +6 -0
@@ -34,6 +34,12 @@#define pr_fmt (fmt) "amdgpu: " fmt +#ifdef dev_fmt +#undef dev_fmt +#endif + +#define dev_fmt (fmt) "amdgpu: " fmt +#include "amdgpu_ctx.h" #include <linux/atomic.h>
Signature · 1 line
2.26.0
PATCH v2 3/3 drm/amd/amdgpu: remove hardcoded module name in prints
In reply to Aurabindo PillaiLet format prefixes take care of printing the module name through pr_fmt and dev_fmt definitions.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 2 +- drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +3 -3
@@ -325,13 +325,13 @@ static int vm_validate_pt_pd_bos(struct amdgpu_vm *vm) ret =amdgpu_vm_validate_pt_bos (adev, vm, amdgpu_amdkfd_validate, ¶m);if (ret) { -pr_err ("amdgpu: failed to validate PT BOs\n" ); +pr_err ("failed to validate PT BOs\n" );return ret; } ret =amdgpu_amdkfd_validate (¶m, pd);if (ret) { -pr_err ("amdgpu: failed to validate PD\n" ); +pr_err ("failed to validate PD\n" );return ret; }
@@ -340,7 +340,7 @@ static int vm_validate_pt_pd_bos(struct amdgpu_vm *vm)if (vm->use_cpu_for_update) { ret =amdgpu_bo_kmap (pd,NULL );if (ret) { -pr_err ("amdgpu: failed to kmap PD, ret=%d\n" , ret); +pr_err ("failed to kmap PD, ret=%d\n" , ret);return ret; } }
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -2
@@ -1092,7 +1092,7 @@ static void amdgpu_switcheroo_set_state(struct pci_dev *pdev, enum vga_switcheroreturn ;if (state ==VGA_SWITCHEROO_ON ) { -pr_info ("amdgpu: switched on\n" ); +pr_info ("switched on\n" );/* don't suspend or resume card normally */ dev->switch_power_state =DRM_SWITCH_POWER_CHANGING ;
@@ -1106,7 +1106,7 @@ static void amdgpu_switcheroo_set_state(struct pci_dev *pdev, enum vga_switchero dev->switch_power_state =DRM_SWITCH_POWER_ON ;drm_kms_helper_poll_enable (dev); }else { -pr_info ("amdgpu: switched off\n" ); +pr_info ("switched off\n" );drm_kms_helper_poll_disable (dev); dev->switch_power_state =DRM_SWITCH_POWER_CHANGING ;amdgpu_device_suspend (dev, true);
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +1 -1
@@ -260,7 +260,7 @@ int amdgpu_irq_init(struct amdgpu_device *adev) nvec =pci_alloc_irq_vectors (adev->pdev,1 ,1 , flags);if (nvec >0 ) { adev->irq.msi_enabled = true; -dev_dbg (adev->dev,"amdgpu: using MSI/MSI-X.\n" ); +dev_dbg (adev->dev,"using MSI/MSI-X.\n" ); } }
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c +1 -1
@@ -858,7 +858,7 @@ static int gmc_v6_0_sw_init(void *handle) r =dma_set_mask_and_coherent (adev->dev,DMA_BIT_MASK (44 ));if (r) { -dev_warn (adev->dev,"amdgpu: No suitable DMA available.\n" ); +dev_warn (adev->dev,"No suitable DMA available.\n" );return r; } adev->need_swiotlb =drm_need_swiotlb (44 );
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +1 -1
@@ -1019,7 +1019,7 @@ static int gmc_v7_0_sw_init(void *handle) r =dma_set_mask_and_coherent (adev->dev,DMA_BIT_MASK (40 ));if (r) { -pr_warn ("amdgpu: No suitable DMA available\n" ); +pr_warn ("No suitable DMA available\n" );return r; } adev->need_swiotlb =drm_need_swiotlb (40 );
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +1 -1
@@ -1144,7 +1144,7 @@ static int gmc_v8_0_sw_init(void *handle) r =dma_set_mask_and_coherent (adev->dev,DMA_BIT_MASK (40 ));if (r) { -pr_warn ("amdgpu: No suitable DMA available\n" ); +pr_warn ("No suitable DMA available\n" );return r; } adev->need_swiotlb =drm_need_swiotlb (40 );
Signature · 1 line
2.26.0
Alex Deucher
AppliedQuoted 10 lines · Aurabindo Pillai
Changes in v2
* Add
dev_fmtformat prefix
* Removed hardcoded module names in pr_* and dev_* printsAurabindo Pillai (3):
drm/amd/amdgpu: add prefix for pr_* prints drm/amd/amdgpu: add print prefix for dev_* variants drm/amd/amdgpu: remove hardcoded module name in prints
Applied. thanks!
Alex
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu.h | 12 ++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 2 +- drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 2 +- 7 files changed, 21 insertions(+), 9 deletions(-)
Quoted 7 lines
--
2.26.0_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel