Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit efb31d15 authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Daniel Vetter
Browse files

drm/i915: Don't disable primary when color keying is used



When color keying is used, the primary may not be invisible even though
the sprite fully covers it. So check for color keying before deciding to
disable the primary plane.

Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 8553c18e
Loading
Loading
Loading
Loading
+10 −1
Original line number Original line Diff line number Diff line
@@ -636,6 +636,15 @@ format_is_yuv(uint32_t format)
	}
	}
}
}


static bool colorkey_enabled(struct intel_plane *intel_plane)
{
	struct drm_intel_sprite_colorkey key;

	intel_plane->get_colorkey(&intel_plane->base, &key);

	return key.flags != I915_SET_COLORKEY_NONE;
}

static int
static int
intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
		   struct drm_framebuffer *fb, int crtc_x, int crtc_y,
		   struct drm_framebuffer *fb, int crtc_x, int crtc_y,
@@ -821,7 +830,7 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
	 * If the sprite is completely covering the primary plane,
	 * If the sprite is completely covering the primary plane,
	 * we can disable the primary and save power.
	 * we can disable the primary and save power.
	 */
	 */
	disable_primary = drm_rect_equals(&dst, &clip);
	disable_primary = drm_rect_equals(&dst, &clip) && !colorkey_enabled(intel_plane);
	WARN_ON(disable_primary && !visible && intel_crtc->active);
	WARN_ON(disable_primary && !visible && intel_crtc->active);


	mutex_lock(&dev->struct_mutex);
	mutex_lock(&dev->struct_mutex);