[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADnq5_N7kZeHaDXSdHsutgo8n8DjtWCWT1=KitEOycXCBWtyZQ@mail.gmail.com>
Date: Tue, 16 Dec 2025 10:31:33 -0500
From: Alex Deucher <alexdeucher@...il.com>
To: Christian König <christian.koenig@....com>
Cc: Mukesh Ogare <mukeshogare871@...il.com>, alexander.deucher@....com, airlied@...il.com,
simona@...ll.ch, amd-gfx@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/radeon: Convert logging in radeon_display.c to drm_* helpers
Applied. Thanks!
On Tue, Dec 16, 2025 at 3:37 AM Christian König
<christian.koenig@....com> wrote:
>
> On 12/16/25 07:42, Mukesh Ogare wrote:
> > Replace DRM_ERROR() and DRM_INFO() calls in
> > drivers/gpu/drm/radeon/radeon_display.c with the corresponding
> > drm_err() and drm_info() helpers.
> >
> > The drm_*() logging functions take a struct drm_device * argument,
> > allowing the DRM core to prefix log messages with the correct device
> > name and instance. This is required to correctly distinguish log
> > messages on systems with multiple GPUs.
> >
> > This change aligns radeon with the DRM TODO item:
> > "Convert logging to drm_* functions with drm_device parameter".
> >
> > Signed-off-by: Mukesh Ogare <mukeshogare871@...il.com>
>
> Of hand looks reasonable to me, but I don't have the time to check everything for typos. So only:
>
> Acked-by: Christian König <christian.koenig@....com>
>
> Alex will probably pick this up when he has time.
>
> Thanks,
> Christian.
>
> >
> > diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
> > index 35fb99bcd9a7..bc28117e01b4 100644
> > --- a/drivers/gpu/drm/radeon/radeon_display.c
> > +++ b/drivers/gpu/drm/radeon/radeon_display.c
> > @@ -41,6 +41,7 @@
> > #include <drm/drm_probe_helper.h>
> > #include <drm/drm_vblank.h>
> > #include <drm/radeon_drm.h>
> > +#include <drm/drm_print.h>
> >
> > #include "atom.h"
> > #include "radeon.h"
> > @@ -273,7 +274,7 @@ static void radeon_unpin_work_func(struct work_struct *__work)
> > radeon_bo_unpin(work->old_rbo);
> > radeon_bo_unreserve(work->old_rbo);
> > } else
> > - DRM_ERROR("failed to reserve buffer after flip\n");
> > + drm_err(&work->rdev->ddev, "failed to reserve buffer after flip\n");
> >
> > drm_gem_object_put(&work->old_rbo->tbo.base);
> > kfree(work);
> > @@ -434,7 +435,7 @@ static void radeon_flip_work_func(struct work_struct *__work)
> > r = dma_fence_wait(work->fence, false);
> >
> > if (r)
> > - DRM_ERROR("failed to wait on page flip fence (%d)!\n", r);
> > + drm_err(dev, "failed to wait on page flip fence (%d)!\n", r);
> >
> > /* We continue with the page flip even if we failed to wait on
> > * the fence, otherwise the DRM core and userspace will be
> > @@ -521,7 +522,7 @@ static int radeon_crtc_page_flip_target(struct drm_crtc *crtc,
> >
> > r = radeon_bo_reserve(new_rbo, false);
> > if (unlikely(r != 0)) {
> > - DRM_ERROR("failed to reserve new rbo buffer before flip\n");
> > + drm_err(dev, "failed to reserve new rbo buffer before flip\n");
> > goto cleanup;
> > }
> > /* Only 27 bit offset for legacy CRTC */
> > @@ -530,14 +531,14 @@ static int radeon_crtc_page_flip_target(struct drm_crtc *crtc,
> > if (unlikely(r != 0)) {
> > radeon_bo_unreserve(new_rbo);
> > r = -EINVAL;
> > - DRM_ERROR("failed to pin new rbo buffer before flip\n");
> > + drm_err(dev, "failed to pin new rbo buffer before flip\n");
> > goto cleanup;
> > }
> > r = dma_resv_get_singleton(new_rbo->tbo.base.resv, DMA_RESV_USAGE_WRITE,
> > &work->fence);
> > if (r) {
> > radeon_bo_unreserve(new_rbo);
> > - DRM_ERROR("failed to get new rbo buffer fences\n");
> > + drm_err(dev, "failed to get new rbo buffer fences\n");
> > goto cleanup;
> > }
> > radeon_bo_get_tiling_flags(new_rbo, &tiling_flags, NULL);
> > @@ -604,7 +605,7 @@ static int radeon_crtc_page_flip_target(struct drm_crtc *crtc,
> >
> > pflip_cleanup:
> > if (unlikely(radeon_bo_reserve(new_rbo, false) != 0)) {
> > - DRM_ERROR("failed to reserve new rbo in error path\n");
> > + drm_err(dev, "failed to reserve new rbo in error path\n");
> > goto cleanup;
> > }
> > radeon_bo_unpin(new_rbo);
> > @@ -772,15 +773,15 @@ static void radeon_print_display_setup(struct drm_device *dev)
> > uint32_t devices;
> > int i = 0;
> >
> > - DRM_INFO("Radeon Display Connectors\n");
> > + drm_info(dev, "Radeon Display Connectors\n");
> > list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
> > radeon_connector = to_radeon_connector(connector);
> > - DRM_INFO("Connector %d:\n", i);
> > - DRM_INFO(" %s\n", connector->name);
> > + drm_info(dev, "Connector %d:\n", i);
> > + drm_info(dev, " %s\n", connector->name);
> > if (radeon_connector->hpd.hpd != RADEON_HPD_NONE)
> > - DRM_INFO(" %s\n", hpd_names[radeon_connector->hpd.hpd]);
> > + drm_info(dev, " %s\n", hpd_names[radeon_connector->hpd.hpd]);
> > if (radeon_connector->ddc_bus) {
> > - DRM_INFO(" DDC: 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n",
> > + drm_info(dev, " DDC: 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n",
> > radeon_connector->ddc_bus->rec.mask_clk_reg,
> > radeon_connector->ddc_bus->rec.mask_data_reg,
> > radeon_connector->ddc_bus->rec.a_clk_reg,
> > @@ -790,11 +791,11 @@ static void radeon_print_display_setup(struct drm_device *dev)
> > radeon_connector->ddc_bus->rec.y_clk_reg,
> > radeon_connector->ddc_bus->rec.y_data_reg);
> > if (radeon_connector->router.ddc_valid)
> > - DRM_INFO(" DDC Router 0x%x/0x%x\n",
> > + drm_info(dev, " DDC Router 0x%x/0x%x\n",
> > radeon_connector->router.ddc_mux_control_pin,
> > radeon_connector->router.ddc_mux_state);
> > if (radeon_connector->router.cd_valid)
> > - DRM_INFO(" Clock/Data Router 0x%x/0x%x\n",
> > + drm_info(dev, " Clock/Data Router 0x%x/0x%x\n",
> > radeon_connector->router.cd_mux_control_pin,
> > radeon_connector->router.cd_mux_state);
> > } else {
> > @@ -804,35 +805,46 @@ static void radeon_print_display_setup(struct drm_device *dev)
> > connector->connector_type == DRM_MODE_CONNECTOR_DVIA ||
> > connector->connector_type == DRM_MODE_CONNECTOR_HDMIA ||
> > connector->connector_type == DRM_MODE_CONNECTOR_HDMIB)
> > - DRM_INFO(" DDC: no ddc bus - possible BIOS bug - please report to xorg-driver-ati@...ts.x.org\n");
> > + drm_info(dev, " DDC: no ddc bus - possible BIOS bug - please report to xorg-driver-ati@...ts.x.org\n");
> > }
> > - DRM_INFO(" Encoders:\n");
> > + drm_info(dev, " Encoders:\n");
> > list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
> > radeon_encoder = to_radeon_encoder(encoder);
> > devices = radeon_encoder->devices & radeon_connector->devices;
> > if (devices) {
> > if (devices & ATOM_DEVICE_CRT1_SUPPORT)
> > - DRM_INFO(" CRT1: %s\n", encoder_names[radeon_encoder->encoder_id]);
> > + drm_info(dev, " CRT1: %s\n",
> > + encoder_names[radeon_encoder->encoder_id]);
> > if (devices & ATOM_DEVICE_CRT2_SUPPORT)
> > - DRM_INFO(" CRT2: %s\n", encoder_names[radeon_encoder->encoder_id]);
> > + drm_info(dev, " CRT2: %s\n",
> > + encoder_names[radeon_encoder->encoder_id]);
> > if (devices & ATOM_DEVICE_LCD1_SUPPORT)
> > - DRM_INFO(" LCD1: %s\n", encoder_names[radeon_encoder->encoder_id]);
> > + drm_info(dev, " LCD1: %s\n",
> > + encoder_names[radeon_encoder->encoder_id]);
> > if (devices & ATOM_DEVICE_DFP1_SUPPORT)
> > - DRM_INFO(" DFP1: %s\n", encoder_names[radeon_encoder->encoder_id]);
> > + drm_info(dev, " DFP1: %s\n",
> > + encoder_names[radeon_encoder->encoder_id]);
> > if (devices & ATOM_DEVICE_DFP2_SUPPORT)
> > - DRM_INFO(" DFP2: %s\n", encoder_names[radeon_encoder->encoder_id]);
> > + drm_info(dev, " DFP2: %s\n",
> > + encoder_names[radeon_encoder->encoder_id]);
> > if (devices & ATOM_DEVICE_DFP3_SUPPORT)
> > - DRM_INFO(" DFP3: %s\n", encoder_names[radeon_encoder->encoder_id]);
> > + drm_info(dev, " DFP3: %s\n",
> > + encoder_names[radeon_encoder->encoder_id]);
> > if (devices & ATOM_DEVICE_DFP4_SUPPORT)
> > - DRM_INFO(" DFP4: %s\n", encoder_names[radeon_encoder->encoder_id]);
> > + drm_info(dev, " DFP4: %s\n",
> > + encoder_names[radeon_encoder->encoder_id]);
> > if (devices & ATOM_DEVICE_DFP5_SUPPORT)
> > - DRM_INFO(" DFP5: %s\n", encoder_names[radeon_encoder->encoder_id]);
> > + drm_info(dev, " DFP5: %s\n",
> > + encoder_names[radeon_encoder->encoder_id]);
> > if (devices & ATOM_DEVICE_DFP6_SUPPORT)
> > - DRM_INFO(" DFP6: %s\n", encoder_names[radeon_encoder->encoder_id]);
> > + drm_info(dev, " DFP6: %s\n",
> > + encoder_names[radeon_encoder->encoder_id]);
> > if (devices & ATOM_DEVICE_TV1_SUPPORT)
> > - DRM_INFO(" TV1: %s\n", encoder_names[radeon_encoder->encoder_id]);
> > + drm_info(dev, " TV1: %s\n",
> > + encoder_names[radeon_encoder->encoder_id]);
> > if (devices & ATOM_DEVICE_CV_SUPPORT)
> > - DRM_INFO(" CV: %s\n", encoder_names[radeon_encoder->encoder_id]);
> > + drm_info(dev, " CV: %s\n",
> > + encoder_names[radeon_encoder->encoder_id]);
> > }
> > }
> > i++;
> > @@ -1747,7 +1759,7 @@ bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
> > * (ie all encoder can work with the same
> > * scaling).
> > */
> > - DRM_ERROR("Scaling not consistent across encoder.\n");
> > + drm_err(dev, "Scaling not consistent across encoder.\n");
> > return false;
> > }
> > }
>
Powered by blists - more mailing lists