Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Abhishek Rajput and committed by
Chun-Kuang Hu
24abe1f2 65155d16

+15 -9
+15 -9
drivers/gpu/drm/mediatek/mtk_crtc.c
··· 225 225 226 226 static int mtk_crtc_ddp_clk_enable(struct mtk_crtc *mtk_crtc) 227 227 { 228 + struct drm_device *dev = mtk_crtc->base.dev; 228 229 int ret; 229 230 int i; 230 231 231 232 for (i = 0; i < mtk_crtc->ddp_comp_nr; i++) { 232 233 ret = mtk_ddp_comp_clk_enable(mtk_crtc->ddp_comp[i]); 233 234 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); 235 236 goto err; 236 237 } 237 238 } ··· 344 343 struct drm_connector *connector; 345 344 struct drm_encoder *encoder; 346 345 struct drm_connector_list_iter conn_iter; 346 + struct drm_device *dev = mtk_crtc->base.dev; 347 347 unsigned int width, height, vrefresh, bpc = MTK_MAX_BPC; 348 348 int ret; 349 349 int i; ··· 373 371 374 372 ret = pm_runtime_resume_and_get(crtc->dev->dev); 375 373 if (ret < 0) { 376 - DRM_ERROR("Failed to enable power domain: %d\n", ret); 374 + drm_err(dev, "Failed to enable power domain: %d\n", ret); 377 375 return ret; 378 376 } 379 377 380 378 ret = mtk_mutex_prepare(mtk_crtc->mutex); 381 379 if (ret < 0) { 382 - DRM_ERROR("Failed to enable mutex clock: %d\n", ret); 380 + drm_err(dev, "Failed to enable mutex clock: %d\n", ret); 383 381 goto err_pm_runtime_put; 384 382 } 385 383 386 384 ret = mtk_crtc_ddp_clk_enable(mtk_crtc); 387 385 if (ret < 0) { 388 - DRM_ERROR("Failed to enable component clocks: %d\n", ret); 386 + drm_err(dev, "Failed to enable component clocks: %d\n", ret); 389 387 goto err_mutex_unprepare; 390 388 } 391 389 ··· 650 648 struct mtk_drm_private *priv = crtc->dev->dev_private; 651 649 652 650 #if IS_REACHABLE(CONFIG_MTK_CMDQ) 651 + struct drm_device *dev = mtk_crtc->base.dev; 653 652 if (!priv->data->shadow_register && !mtk_crtc->cmdq_client.chan) 654 653 mtk_crtc_ddp_config(crtc, NULL); 655 654 else if (mtk_crtc->cmdq_vblank_cnt > 0 && --mtk_crtc->cmdq_vblank_cnt == 0) 656 - DRM_ERROR("mtk_crtc %d CMDQ execute command timeout!\n", 657 - drm_crtc_index(&mtk_crtc->base)); 655 + drm_err(dev, "mtk_crtc %d CMDQ execute command timeout!\n", 656 + drm_crtc_index(&mtk_crtc->base)); 658 657 #else 659 658 if (!priv->data->shadow_register) 660 659 mtk_crtc_ddp_config(crtc, NULL); ··· 779 776 { 780 777 struct mtk_crtc *mtk_crtc = to_mtk_crtc(crtc); 781 778 struct mtk_ddp_comp *comp = mtk_crtc->ddp_comp[0]; 779 + struct drm_device *dev = mtk_crtc->base.dev; 782 780 int ret; 783 781 784 - DRM_DEBUG_DRIVER("%s %d\n", __func__, crtc->base.id); 782 + drm_dbg_driver(dev, "%s %d\n", __func__, crtc->base.id); 785 783 786 784 ret = mtk_ddp_comp_power_on(comp); 787 785 if (ret < 0) { ··· 807 803 { 808 804 struct mtk_crtc *mtk_crtc = to_mtk_crtc(crtc); 809 805 struct mtk_ddp_comp *comp = mtk_crtc->ddp_comp[0]; 806 + struct drm_device *dev = mtk_crtc->base.dev; 810 807 int i; 811 808 812 - DRM_DEBUG_DRIVER("%s %d\n", __func__, crtc->base.id); 809 + drm_dbg_driver(dev, "%s %d\n", __func__, crtc->base.id); 813 810 if (!mtk_crtc->enabled) 814 811 return; 815 812 ··· 850 845 crtc); 851 846 struct mtk_crtc_state *mtk_crtc_state = to_mtk_crtc_state(crtc_state); 852 847 struct mtk_crtc *mtk_crtc = to_mtk_crtc(crtc); 848 + struct drm_device *dev = mtk_crtc->base.dev; 853 849 unsigned long flags; 854 850 855 851 if (mtk_crtc->event && mtk_crtc_state->base.event) 856 - DRM_ERROR("new event while there is still a pending event\n"); 852 + drm_err(dev, "new event while there is still a pending event\n"); 857 853 858 854 if (mtk_crtc_state->base.event) { 859 855 mtk_crtc_state->base.event->pipe = drm_crtc_index(crtc);