[PATCH 4/4] drm/i915: Put "cooked" vlank counters in frame CRC lines

Tomeu Vizoso tomeu.vizoso at collabora.com
Thu Oct 6 15:38:42 UTC 2016


Use drm_accurate_vblank_count so we have the full 32 bit to represent
the frame counter and userspace has a simpler way of knowing when the
counter wraps around.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso at collabora.com>
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
Series-version: 11
Series-cc: danvet, xexaxo, tagr, ville, seanpaul
Cover-letter:
New debugfs API for capturing CRC of frames
Hi,

this series basically takes the facility for continuously capturing CRCs
of frames from the i915 driver and into the DRM core.

The idea is that test suites such as IGT use this information to check
that frames that are exected to be identical, also have identical CRC
values.

Other drivers for hardware that can provide frame CRCs (including eDP
panels that support self-refresh) can easily implement the new callback
and provide userspace with the CRC values.

Sorry about that, but there was a dangling brace in v10 so here is this
v11.

Thanks,

Tomeu
END
---
 drivers/gpu/drm/i915/i915_irq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 1549cc4f88ec..238a353454e9 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -1495,7 +1495,6 @@ static void display_pipe_crc_irq_handler(struct drm_i915_private *dev_priv,
 	struct drm_driver *driver = dev_priv->drm.driver;
 	uint32_t crcs[5];
 	int head, tail, ret;
-	u32 frame;
 
 	spin_lock(&pipe_crc->lock);
 	if (pipe_crc->source) {
@@ -1551,8 +1550,9 @@ static void display_pipe_crc_irq_handler(struct drm_i915_private *dev_priv,
 		crcs[2] = crc2;
 		crcs[3] = crc3;
 		crcs[4] = crc4;
-		frame = driver->get_vblank_counter(&dev_priv->drm, pipe);
-		ret = drm_crtc_add_crc_entry(crtc, true, frame, crcs);
+		ret = drm_crtc_add_crc_entry(crtc, true,
+					     drm_accurate_vblank_count(crtc),
+					     crcs);
 		spin_unlock(&crtc->crc.lock);
 		if (!ret)
 			wake_up_interruptible(&crtc->crc.wq);
-- 
2.7.4



More information about the Intel-gfx-trybot mailing list