<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:11pt;color:#0078D7;margin:5pt;" align="Left">
[AMD Official Use Only - Internal Distribution Only]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Tuikov, Luben <Luben.Tuikov@amd.com><br>
<b>Sent:</b> Tuesday, March 23, 2021 4:26 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Tuikov, Luben <Luben.Tuikov@amd.com>; Wentland, Harry <Harry.Wentland@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com><br>
<b>Subject:</b> [PATCH] drm/amd/display: Use DRM_DEBUG_DP</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Convert IRQ-based prints from DRM_DEBUG_DRIVER to<br>
DRM_DEBUG_DP, as the latter is not used in drm/amd<br>
prior to this patch and since IRQ-based prints<br>
drown out the rest of the driver's<br>
DRM_DEBUG_DRIVER messages.<br>
<br>
Cc: Harry Wentland <Harry.Wentland@amd.com><br>
Cc: Alex Deucher <alexander.deucher@amd.com><br>
Signed-off-by: Luben Tuikov <luben.tuikov@amd.com><br>
---<br>
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 57 +++++++++----------<br>
 1 file changed, 28 insertions(+), 29 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
index f455fc3aa561..9376d44ce3b4 100644<br>
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
@@ -449,9 +449,9 @@ static void dm_pflip_high_irq(void *interrupt_params)<br>
         amdgpu_crtc->pflip_status = AMDGPU_FLIP_NONE;<br>
         spin_unlock_irqrestore(&adev_to_drm(adev)->event_lock, flags);<br>
 <br>
-       DRM_DEBUG_DRIVER("crtc:%d[%p], pflip_stat:AMDGPU_FLIP_NONE, vrr[%d]-fp %d\n",<br>
-                        amdgpu_crtc->crtc_id, amdgpu_crtc,<br>
-                        vrr_active, (int) !e);<br>
+       DRM_DEBUG_KMS("crtc:%d[%p], pflip_stat:AMDGPU_FLIP_NONE, vrr[%d]-fp %d\n",<br>
+                     amdgpu_crtc->crtc_id, amdgpu_crtc,<br>
+                     vrr_active, (int) !e);<br>
 }<br>
 <br>
 static void dm_vupdate_high_irq(void *interrupt_params)<br>
@@ -993,8 +993,7 @@ static void event_mall_stutter(struct work_struct *work)<br>
         dc_allow_idle_optimizations(<br>
                 dm->dc, dm->active_vblank_irq_count == 0);<br>
 <br>
-       DRM_DEBUG_DRIVER("Allow idle optimizations (MALL): %d\n", dm->active_vblank_irq_count == 0);<br>
-<br>
+       DRM_DEBUG_KMS("Allow idle optimizations (MALL): %d\n", dm->active_vblank_irq_count == 0);<br>
 <br>
         mutex_unlock(&dm->dc_lock);<br>
 }<br>
@@ -1810,8 +1809,8 @@ static void dm_gpureset_toggle_interrupts(struct amdgpu_device *adev,<br>
                 if (acrtc && state->stream_status[i].plane_count != 0) {<br>
                         irq_source = IRQ_TYPE_PFLIP + acrtc->otg_inst;<br>
                         rc = dc_interrupt_set(adev->dm.dc, irq_source, enable) ? 0 : -EBUSY;<br>
-                       DRM_DEBUG("crtc %d - vupdate irq %sabling: r=%d\n",<br>
-                                 acrtc->crtc_id, enable ? "en" : "dis", rc);<br>
+                       DRM_DEBUG_VBL("crtc %d - vupdate irq %sabling: r=%d\n",<br>
+                                     acrtc->crtc_id, enable ? "en" : "dis", rc);<br>
                         if (rc)<br>
                                 DRM_WARN("Failed to %s pflip interrupts\n",<br>
                                          enable ? "enable" : "disable");<br>
@@ -4966,8 +4965,8 @@ static void update_stream_scaling_settings(const struct drm_display_mode *mode,<br>
         stream->src = src;<br>
         stream->dst = dst;<br>
 <br>
-       DRM_DEBUG_DRIVER("Destination Rectangle x:%d  y:%d  width:%d  height:%d\n",<br>
-                       dst.x, dst.y, dst.width, dst.height);<br>
+       DRM_DEBUG_KMS("Destination Rectangle x:%d  y:%d  width:%d  height:%d\n",<br>
+                     dst.x, dst.y, dst.width, dst.height);<br>
 <br>
 }<br>
 <br>
@@ -5710,8 +5709,8 @@ static inline int dm_set_vupdate_irq(struct drm_crtc *crtc, bool enable)<br>
 <br>
         rc = dc_interrupt_set(adev->dm.dc, irq_source, enable) ? 0 : -EBUSY;<br>
 <br>
-       DRM_DEBUG_DRIVER("crtc %d - vupdate irq %sabling: r=%d\n",<br>
-                        acrtc->crtc_id, enable ? "en" : "dis", rc);<br>
+       DRM_DEBUG_VBL("crtc %d - vupdate irq %sabling: r=%d\n",<br>
+                     acrtc->crtc_id, enable ? "en" : "dis", rc);<br>
         return rc;<br>
 }<br>
 <br>
@@ -6664,7 +6663,7 @@ static int dm_plane_helper_prepare_fb(struct drm_plane *plane,<br>
         int r;<br>
 <br>
         if (!new_state->fb) {<br>
-               DRM_DEBUG_DRIVER("No FB bound\n");<br>
+               DRM_DEBUG_KMS("No FB bound\n");<br>
                 return 0;<br>
         }<br>
 <br>
@@ -7896,11 +7895,11 @@ static void handle_cursor_update(struct drm_plane *plane,<br>
         if (!plane->state->fb && !old_plane_state->fb)<br>
                 return;<br>
 <br>
-       DRM_DEBUG_DRIVER("%s: crtc_id=%d with size %d to %d\n",<br>
-                        __func__,<br>
-                        amdgpu_crtc->crtc_id,<br>
-                        plane->state->crtc_w,<br>
-                        plane->state->crtc_h);<br>
+       DRM_DEBUG_KMS("%s: crtc_id=%d with size %d to %d\n",<br>
+                     __func__,<br>
+                     amdgpu_crtc->crtc_id,<br>
+                     plane->state->crtc_w,<br>
+                     plane->state->crtc_h);<br>
 <br>
         ret = get_cursor_position(plane, crtc, &position);<br>
         if (ret)<br>
@@ -7958,8 +7957,8 @@ static void prepare_flip_isr(struct amdgpu_crtc *acrtc)<br>
         /* Mark this event as consumed */<br>
         acrtc->base.state->event = NULL;<br>
 <br>
-       DRM_DEBUG_DRIVER("crtc:%d, pflip_stat:AMDGPU_FLIP_SUBMITTED\n",<br>
-                                                acrtc->crtc_id);<br>
+       DRM_DEBUG_KMS("crtc:%d, pflip_stat:AMDGPU_FLIP_SUBMITTED\n",<br>
+                     acrtc->crtc_id);<br>
 }<br>
 <br>
 static void update_freesync_state_on_stream(<br>
@@ -8265,7 +8264,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,<br>
                         &bundle->flip_addrs[planes_count].address,<br>
                         afb->tmz_surface, false);<br>
 <br>
-               DRM_DEBUG_DRIVER("plane: id=%d dcc_en=%d\n",<br>
+               DRM_DEBUG_ATOMIC("plane: id=%d dcc_en=%d\n",<br>
                                  new_plane_state->plane->index,<br>
                                  bundle->plane_infos[planes_count].dcc.enable);<br>
 <br>
@@ -8299,7 +8298,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,<br>
                                 dc_plane,<br>
                                 bundle->flip_addrs[planes_count].flip_timestamp_in_us);<br>
 <br>
-               DRM_DEBUG_DRIVER("%s Flipping to hi: 0x%x, low: 0x%x\n",<br>
+               DRM_DEBUG_ATOMIC("%s Flipping to hi: 0x%x, low: 0x%x\n",<br>
                                  __func__,<br>
                                  bundle->flip_addrs[planes_count].address.grph.addr.high_part,<br>
                                  bundle->flip_addrs[planes_count].address.grph.addr.low_part);<br>
@@ -8621,7 +8620,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)<br>
                 dm_new_crtc_state = to_dm_crtc_state(new_crtc_state);<br>
                 dm_old_crtc_state = to_dm_crtc_state(old_crtc_state);<br>
 <br>
-               DRM_DEBUG_DRIVER(<br>
+               DRM_DEBUG_ATOMIC(<br>
                         "amdgpu_crtc id:%d crtc_state_flags: enable:%d, active:%d, "<br>
                         "planes_changed:%d, mode_changed:%d,active_changed:%d,"<br>
                         "connectors_changed:%d\n",<br>
@@ -8655,7 +8654,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)<br>
 <br>
                 if (modeset_required(new_crtc_state, dm_new_crtc_state->stream, dm_old_crtc_state->stream)) {<br>
 <br>
-                       DRM_DEBUG_DRIVER("Atomic commit: SET crtc id %d: [%p]\n", acrtc->crtc_id, acrtc);<br>
+                       DRM_DEBUG_ATOMIC("Atomic commit: SET crtc id %d: [%p]\n", acrtc->crtc_id, acrtc);<br>
 <br>
                         if (!dm_new_crtc_state->stream) {<br>
                                 /*<br>
@@ -8688,7 +8687,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)<br>
                         crtc->hwmode = new_crtc_state->mode;<br>
                         mode_set_reset_required = true;<br>
                 } else if (modereset_required(new_crtc_state)) {<br>
-                       DRM_DEBUG_DRIVER("Atomic commit: RESET. crtc id %d:[%p]\n", acrtc->crtc_id, acrtc);<br>
+                       DRM_DEBUG_ATOMIC("Atomic commit: RESET. crtc id %d:[%p]\n", acrtc->crtc_id, acrtc);<br>
                         /* i.e. reset mode */<br>
                         if (dm_old_crtc_state->stream)<br>
                                 remove_stream(adev, acrtc, dm_old_crtc_state->stream);<br>
@@ -9298,7 +9297,7 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,<br>
         if (!drm_atomic_crtc_needs_modeset(new_crtc_state))<br>
                 goto skip_modeset;<br>
 <br>
-       DRM_DEBUG_DRIVER(<br>
+       DRM_DEBUG_ATOMIC(<br>
                 "amdgpu_crtc id:%d crtc_state_flags: enable:%d, active:%d, "<br>
                 "planes_changed:%d, mode_changed:%d,active_changed:%d,"<br>
                 "connectors_changed:%d\n",<br>
@@ -9382,8 +9381,8 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,<br>
 <br>
                         dc_stream_retain(new_stream);<br>
 <br>
-                       DRM_DEBUG_DRIVER("Enabling DRM crtc: %d\n",<br>
-                                               crtc->base.id);<br>
+                       DRM_DEBUG_ATOMIC("Enabling DRM crtc: %d\n",<br>
+                                        crtc->base.id);<br>
 <br>
                         if (dc_add_stream_to_ctx(<br>
                                         dm->dc,<br>
@@ -9728,8 +9727,8 @@ static int dm_update_plane_state(struct dc *dc,<br>
                 if (!dc_new_plane_state)<br>
                         return -ENOMEM;<br>
 <br>
-               DRM_DEBUG_DRIVER("Enabling DRM plane: %d on DRM crtc %d\n",<br>
-                               plane->base.id, new_plane_crtc->base.id);<br>
+               DRM_DEBUG_ATOMIC("Enabling DRM plane: %d on DRM crtc %d\n",<br>
+                                plane->base.id, new_plane_crtc->base.id);<br>
 <br>
                 ret = fill_dc_plane_attributes(<br>
                         drm_to_adev(new_plane_crtc->dev),<br>
-- <br>
2.31.0.rc2<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>