drm/tidss: Add printing of underflows
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Mon, 21 Oct 2024 14:07:48 +0000 (17:07 +0300)
committerTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Mon, 25 Nov 2024 11:10:21 +0000 (13:10 +0200)
Add printing of underflows the same way as we handle sync losts.

Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
Reviewed-by: Aradhya Bhatia <aradhya.bhatia@linux.dev>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241021-tidss-irq-fix-v1-4-82ddaec94e4a@ideasonboard.com
drivers/gpu/drm/tidss/tidss_irq.c
drivers/gpu/drm/tidss/tidss_plane.c
drivers/gpu/drm/tidss/tidss_plane.h

index 91498ff664a28dee82159ad0a2fd13effa07e9a4..3cc4024ec7ff1d0e53962804eddc430b1bb127c8 100644 (file)
@@ -78,6 +78,14 @@ static irqreturn_t tidss_irq_handler(int irq, void *arg)
                        tidss_crtc_error_irq(crtc, irqstatus);
        }
 
+       for (unsigned int i = 0; i < tidss->num_planes; ++i) {
+               struct drm_plane *plane = tidss->planes[i];
+               struct tidss_plane *tplane = to_tidss_plane(plane);
+
+               if (irqstatus & DSS_IRQ_PLANE_FIFO_UNDERFLOW(tplane->hw_plane_id))
+                       tidss_plane_error_irq(plane, irqstatus);
+       }
+
        return IRQ_HANDLED;
 }
 
@@ -112,6 +120,12 @@ int tidss_irq_install(struct drm_device *ddev, unsigned int irq)
                tidss->irq_mask |= DSS_IRQ_VP_FRAME_DONE(tcrtc->hw_videoport);
        }
 
+       for (unsigned int i = 0; i < tidss->num_planes; ++i) {
+               struct tidss_plane *tplane = to_tidss_plane(tidss->planes[i]);
+
+               tidss->irq_mask |= DSS_IRQ_PLANE_FIFO_UNDERFLOW(tplane->hw_plane_id);
+       }
+
        return 0;
 }
 
index a5d86822c9e3370a59eae369ba764fbd2d00e88a..116de124bddbf78da7bcaadc4a622f7fa62b4cdf 100644 (file)
 #include "tidss_drv.h"
 #include "tidss_plane.h"
 
+void tidss_plane_error_irq(struct drm_plane *plane, u64 irqstatus)
+{
+       struct tidss_plane *tplane = to_tidss_plane(plane);
+
+       dev_err_ratelimited(plane->dev->dev, "Plane%u underflow (irq %llx)\n",
+                           tplane->hw_plane_id, irqstatus);
+}
+
 /* drm_plane_helper_funcs */
 
 static int tidss_plane_atomic_check(struct drm_plane *plane,
index e933e158b61785d1ddc6b32c68efe96c26870daf..aecaf27284069dc8eaa6aef8b1c03db3779d5fac 100644 (file)
@@ -22,4 +22,6 @@ struct tidss_plane *tidss_plane_create(struct tidss_device *tidss,
                                       u32 crtc_mask, const u32 *formats,
                                       u32 num_formats);
 
+void tidss_plane_error_irq(struct drm_plane *plane, u64 irqstatus);
+
 #endif