Skip to content

Commit 24abe1f

Browse files
abhisraj97Chun-Kuang Hu
authored andcommitted
drm/mediatek: Convert legacy DRM logging to drm_* helpers in mtk_crtc.c
Replace DRM_ERROR() and DRM_DEBUG_DRIVER() calls in drivers/gpu/drm/mediatek/mtk_crtc.c with the corresponding drm_err() and drm_dbg_driver() helpers. The drm_*() logging helpers 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 the Mediatek DRM driver with the DRM TODO item: "Convert logging to drm_* functions with drm_device parameter". Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202512220515.z3QybJ8I-lkp@intel.com/ Signed-off-by: Abhishek Rajput <abhiraj21put@gmail.com> Reviewed-by: CK Hu <ck.hu@mediatek.com> Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20251223095434.492041-1-abhiraj21put@gmail.com/ Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
1 parent 65155d1 commit 24abe1f

1 file changed

Lines changed: 15 additions & 9 deletions

File tree

drivers/gpu/drm/mediatek/mtk_crtc.c

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,14 @@ static void mtk_crtc_mode_set_nofb(struct drm_crtc *crtc)
225225

226226
static int mtk_crtc_ddp_clk_enable(struct mtk_crtc *mtk_crtc)
227227
{
228+
struct drm_device *dev = mtk_crtc->base.dev;
228229
int ret;
229230
int i;
230231

231232
for (i = 0; i < mtk_crtc->ddp_comp_nr; i++) {
232233
ret = mtk_ddp_comp_clk_enable(mtk_crtc->ddp_comp[i]);
233234
if (ret) {
234-
DRM_ERROR("Failed to enable clock %d: %d\n", i, ret);
235+
drm_err(dev, "Failed to enable clock %d: %d\n", i, ret);
235236
goto err;
236237
}
237238
}
@@ -343,6 +344,7 @@ static int mtk_crtc_ddp_hw_init(struct mtk_crtc *mtk_crtc)
343344
struct drm_connector *connector;
344345
struct drm_encoder *encoder;
345346
struct drm_connector_list_iter conn_iter;
347+
struct drm_device *dev = mtk_crtc->base.dev;
346348
unsigned int width, height, vrefresh, bpc = MTK_MAX_BPC;
347349
int ret;
348350
int i;
@@ -371,19 +373,19 @@ static int mtk_crtc_ddp_hw_init(struct mtk_crtc *mtk_crtc)
371373

372374
ret = pm_runtime_resume_and_get(crtc->dev->dev);
373375
if (ret < 0) {
374-
DRM_ERROR("Failed to enable power domain: %d\n", ret);
376+
drm_err(dev, "Failed to enable power domain: %d\n", ret);
375377
return ret;
376378
}
377379

378380
ret = mtk_mutex_prepare(mtk_crtc->mutex);
379381
if (ret < 0) {
380-
DRM_ERROR("Failed to enable mutex clock: %d\n", ret);
382+
drm_err(dev, "Failed to enable mutex clock: %d\n", ret);
381383
goto err_pm_runtime_put;
382384
}
383385

384386
ret = mtk_crtc_ddp_clk_enable(mtk_crtc);
385387
if (ret < 0) {
386-
DRM_ERROR("Failed to enable component clocks: %d\n", ret);
388+
drm_err(dev, "Failed to enable component clocks: %d\n", ret);
387389
goto err_mutex_unprepare;
388390
}
389391

@@ -648,11 +650,12 @@ static void mtk_crtc_ddp_irq(void *data)
648650
struct mtk_drm_private *priv = crtc->dev->dev_private;
649651

650652
#if IS_REACHABLE(CONFIG_MTK_CMDQ)
653+
struct drm_device *dev = mtk_crtc->base.dev;
651654
if (!priv->data->shadow_register && !mtk_crtc->cmdq_client.chan)
652655
mtk_crtc_ddp_config(crtc, NULL);
653656
else if (mtk_crtc->cmdq_vblank_cnt > 0 && --mtk_crtc->cmdq_vblank_cnt == 0)
654-
DRM_ERROR("mtk_crtc %d CMDQ execute command timeout!\n",
655-
drm_crtc_index(&mtk_crtc->base));
657+
drm_err(dev, "mtk_crtc %d CMDQ execute command timeout!\n",
658+
drm_crtc_index(&mtk_crtc->base));
656659
#else
657660
if (!priv->data->shadow_register)
658661
mtk_crtc_ddp_config(crtc, NULL);
@@ -776,9 +779,10 @@ static void mtk_crtc_atomic_enable(struct drm_crtc *crtc,
776779
{
777780
struct mtk_crtc *mtk_crtc = to_mtk_crtc(crtc);
778781
struct mtk_ddp_comp *comp = mtk_crtc->ddp_comp[0];
782+
struct drm_device *dev = mtk_crtc->base.dev;
779783
int ret;
780784

781-
DRM_DEBUG_DRIVER("%s %d\n", __func__, crtc->base.id);
785+
drm_dbg_driver(dev, "%s %d\n", __func__, crtc->base.id);
782786

783787
ret = mtk_ddp_comp_power_on(comp);
784788
if (ret < 0) {
@@ -803,9 +807,10 @@ static void mtk_crtc_atomic_disable(struct drm_crtc *crtc,
803807
{
804808
struct mtk_crtc *mtk_crtc = to_mtk_crtc(crtc);
805809
struct mtk_ddp_comp *comp = mtk_crtc->ddp_comp[0];
810+
struct drm_device *dev = mtk_crtc->base.dev;
806811
int i;
807812

808-
DRM_DEBUG_DRIVER("%s %d\n", __func__, crtc->base.id);
813+
drm_dbg_driver(dev, "%s %d\n", __func__, crtc->base.id);
809814
if (!mtk_crtc->enabled)
810815
return;
811816

@@ -845,10 +850,11 @@ static void mtk_crtc_atomic_begin(struct drm_crtc *crtc,
845850
crtc);
846851
struct mtk_crtc_state *mtk_crtc_state = to_mtk_crtc_state(crtc_state);
847852
struct mtk_crtc *mtk_crtc = to_mtk_crtc(crtc);
853+
struct drm_device *dev = mtk_crtc->base.dev;
848854
unsigned long flags;
849855

850856
if (mtk_crtc->event && mtk_crtc_state->base.event)
851-
DRM_ERROR("new event while there is still a pending event\n");
857+
drm_err(dev, "new event while there is still a pending event\n");
852858

853859
if (mtk_crtc_state->base.event) {
854860
mtk_crtc_state->base.event->pipe = drm_crtc_index(crtc);

0 commit comments

Comments
 (0)