[Intel-gfx] [RFC 01/15] drm/i915: Test plane mask for sprite watermark updates properly

Matt Roper matthew.d.roper at intel.com
Wed May 20 19:12:13 PDT 2015


Our atomic transaction maintains a bitmask of planes that we need to
update sprite watermarks for once vblank evasion is complete.  When we
actually go to make use of that bitmask, we've been comparing against
the plane index rather than the plane mask; we need to update our
comparison to check '(1 << index)' rather than 'index' directly.

This bug was introduced by

        commit 32b7eeec4d1e861230b09d437e95d76c86ff4a68
        Author: Matt Roper <matthew.d.roper at intel.com>
        Date:   Wed Dec 24 07:59:06 2014 -0800

            drm/i915: Refactor work that can sleep out of commit (v7)

However we've been "lucky" and haven't actually run into problems caused
by this yet due to another bug in the code...we forgot to actually
remove the calls to intel_update_sprite_watermarks() from the low-level
plane programming functions that run under evasion.  We'll fix that
problem in a subsequent patch.

Signed-off-by: Matt Roper <matthew.d.roper at intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index c97b496..1d70349 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -13238,7 +13238,8 @@ static void intel_finish_crtc_commit(struct drm_crtc *crtc)
 		intel_post_enable_primary(crtc);
 
 	drm_for_each_legacy_plane(p, &dev->mode_config.plane_list)
-		if (intel_crtc->atomic.update_sprite_watermarks & drm_plane_index(p))
+		if (intel_crtc->atomic.update_sprite_watermarks &
+		    (1 << drm_plane_index(p)))
 			intel_update_sprite_watermarks(p, crtc, 0, 0, 0,
 						       false, false);
 
-- 
1.8.5.1



More information about the Intel-gfx mailing list