]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/display: use drm_warn instead of DRM_WARN
authorAurabindo Pillai <aurabindo.pillai@amd.com>
Tue, 18 Mar 2025 21:25:16 +0000 (17:25 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 7 Apr 2025 19:18:36 +0000 (15:18 -0400)
drm_warn prints the drm device instance which is helpful when
debugging multi gpu issues

Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index 1da749e4ddc407a5d3105a0bab8e95c7c197daf0..f8847cf10dbd0c9af487cd96f9d8590f6cb3660c 100644 (file)
@@ -804,7 +804,7 @@ static void dmub_hpd_callback(struct amdgpu_device *adev,
                        else if (notify->type == DMUB_NOTIFICATION_HPD_IRQ)
                                drm_info(adev_to_drm(adev), "DMUB HPD RX IRQ callback: link_index=%u\n", link_index);
                        else
-                               DRM_WARN("DMUB Unknown HPD callback type %d, link_index=%u\n",
+                               drm_warn(adev_to_drm(adev), "DMUB Unknown HPD callback type %d, link_index=%u\n",
                                                notify->type, link_index);
 
                        hpd_aconnector = aconnector;
@@ -816,7 +816,7 @@ static void dmub_hpd_callback(struct amdgpu_device *adev,
        if (hpd_aconnector) {
                if (notify->type == DMUB_NOTIFICATION_HPD) {
                        if (hpd_aconnector->dc_link->hpd_status == (notify->hpd_status == DP_HPD_PLUG))
-                               DRM_WARN("DMUB reported hpd status unchanged. link_index=%u\n", link_index);
+                               drm_warn(adev_to_drm(adev), "DMUB reported hpd status unchanged. link_index=%u\n", link_index);
                        handle_hpd_irq_helper(hpd_aconnector);
                } else if (notify->type == DMUB_NOTIFICATION_HPD_IRQ) {
                        handle_hpd_rx_irq(hpd_aconnector);
@@ -939,7 +939,7 @@ static void dm_dmub_outbox1_low_irq(void *interrupt_params)
                                continue;
                        }
                        if (!dm->dmub_callback[notify.type]) {
-                               DRM_WARN("DMUB notification skipped due to no handler: type=%s\n",
+                               drm_warn(adev_to_drm(adev), "DMUB notification skipped due to no handler: type=%s\n",
                                        event_type[notify.type]);
                                continue;
                        }
@@ -1207,7 +1207,7 @@ static int dm_dmub_hw_init(struct amdgpu_device *adev)
        /* Reset DMCUB if it was previously running - before we overwrite its memory. */
        status = dmub_srv_hw_reset(dmub_srv);
        if (status != DMUB_STATUS_OK)
-               DRM_WARN("Error resetting DMUB HW: %d\n", status);
+               drm_warn(adev_to_drm(adev), "Error resetting DMUB HW: %d\n", status);
 
        hdr = (const struct dmcub_firmware_header_v1_0 *)dmub_fw->data;
 
@@ -1304,7 +1304,7 @@ static int dm_dmub_hw_init(struct amdgpu_device *adev)
        /* Wait for firmware load to finish. */
        status = dmub_srv_wait_for_auto_load(dmub_srv, 100000);
        if (status != DMUB_STATUS_OK)
-               DRM_WARN("Wait for DMUB auto-load failed: %d\n", status);
+               drm_warn(adev_to_drm(adev), "Wait for DMUB auto-load failed: %d\n", status);
 
        /* Init DMCU and ABM if available. */
        if (dmcu && abm) {
@@ -1362,13 +1362,13 @@ static void dm_dmub_hw_resume(struct amdgpu_device *adev)
 
        status = dmub_srv_is_hw_init(dmub_srv, &init);
        if (status != DMUB_STATUS_OK)
-               DRM_WARN("DMUB hardware init check failed: %d\n", status);
+               drm_warn(adev_to_drm(adev), "DMUB hardware init check failed: %d\n", status);
 
        if (status == DMUB_STATUS_OK && init) {
                /* Wait for firmware load to finish. */
                status = dmub_srv_wait_for_auto_load(dmub_srv, 100000);
                if (status != DMUB_STATUS_OK)
-                       DRM_WARN("Wait for DMUB auto-load failed: %d\n", status);
+                       drm_warn(adev_to_drm(adev), "Wait for DMUB auto-load failed: %d\n", status);
        } else {
                /* Perform the full hardware initialization. */
                r = dm_dmub_hw_init(adev);
@@ -3089,7 +3089,7 @@ static void dm_gpureset_toggle_interrupts(struct amdgpu_device *adev,
                        irq_source = IRQ_TYPE_PFLIP + acrtc->otg_inst;
                        rc = dc_interrupt_set(adev->dm.dc, irq_source, enable) ? 0 : -EBUSY;
                        if (rc)
-                               DRM_WARN("Failed to %s pflip interrupts\n",
+                               drm_warn(adev_to_drm(adev), "Failed to %s pflip interrupts\n",
                                         enable ? "enable" : "disable");
 
                        if (enable) {
@@ -3099,14 +3099,14 @@ static void dm_gpureset_toggle_interrupts(struct amdgpu_device *adev,
                                rc = amdgpu_dm_crtc_set_vupdate_irq(&acrtc->base, false);
 
                        if (rc)
-                               DRM_WARN("Failed to %sable vupdate interrupt\n", enable ? "en" : "dis");
+                               drm_warn(adev_to_drm(adev), "Failed to %sable vupdate interrupt\n", enable ? "en" : "dis");
 
                        irq_source = IRQ_TYPE_VBLANK + acrtc->otg_inst;
                        /* During gpu-reset we disable and then enable vblank irq, so
                         * don't use amdgpu_irq_get/put() to avoid refcount change.
                         */
                        if (!dc_interrupt_set(adev->dm.dc, irq_source, enable))
-                               DRM_WARN("Failed to %sable vblank interrupt\n", enable ? "en" : "dis");
+                               drm_warn(adev_to_drm(adev), "Failed to %sable vblank interrupt\n", enable ? "en" : "dis");
                }
        }
 
@@ -12353,7 +12353,7 @@ static bool dm_edid_parser_send_cea(struct amdgpu_display_manager *dm,
                vsdb->min_refresh_rate_hz = output->amd_vsdb.min_frame_rate;
                vsdb->max_refresh_rate_hz = output->amd_vsdb.max_frame_rate;
        } else {
-               DRM_WARN("Unknown EDID CEA parser results\n");
+               drm_warn(adev_to_drm(dm->adev), "Unknown EDID CEA parser results\n");
                return false;
        }
 
@@ -12765,7 +12765,7 @@ int amdgpu_dm_process_dmub_aux_transfer_sync(
                 * lead to this error. We can ignore this for now.
                 */
                if (p_notify->result != AUX_RET_ERROR_PROTOCOL_ERROR) {
-                       DRM_WARN("DPIA AUX failed on 0x%x(%d), error %d\n",
+                       drm_warn(adev_to_drm(adev), "DPIA AUX failed on 0x%x(%d), error %d\n",
                                        payload->address, payload->length,
                                        p_notify->result);
                }
@@ -12779,7 +12779,7 @@ int amdgpu_dm_process_dmub_aux_transfer_sync(
                        (payload->reply[0] == AUX_TRANSACTION_REPLY_AUX_ACK)) {
 
                if (payload->length != p_notify->aux_reply.length) {
-                       DRM_WARN("invalid read length %d from DPIA AUX 0x%x(%d)!\n",
+                       drm_warn(adev_to_drm(adev), "invalid read length %d from DPIA AUX 0x%x(%d)!\n",
                                p_notify->aux_reply.length,
                                        payload->address, payload->length);
                        *operation_result = AUX_RET_ERROR_INVALID_REPLY;