From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH 1/7] drm/i915: Don't disable primary when color keying is used Date: Fri, 13 Dec 2013 10:41:31 +0200 Message-ID: <20131213084131.GK10036@intel.com> References: <1382039599-31605-1-git-send-email-ville.syrjala@linux.intel.com> <1382039599-31605-2-git-send-email-ville.syrjala@linux.intel.com> <20131212125619.4d4c58bb@jbarnes-desktop> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 6B533FAC68 for ; Fri, 13 Dec 2013 00:41:53 -0800 (PST) Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: Daniel Vetter Cc: intel-gfx List-Id: intel-gfx@lists.freedesktop.org On Thu, Dec 12, 2013 at 09:58:25PM +0100, Daniel Vetter wrote: > On Thu, Dec 12, 2013 at 9:56 PM, Jesse Barnes = wrote: > > On Thu, 17 Oct 2013 22:53:13 +0300 > > ville.syrjala@linux.intel.com wrote: > > > >> From: Ville Syrj=E4l=E4 > >> > >> 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: Ville Syrj=E4l=E4 > >> --- > >> drivers/gpu/drm/i915/intel_sprite.c | 11 ++++++++++- > >> 1 file changed, 10 insertions(+), 1 deletion(-) > >> > >> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i91= 5/intel_sprite.c > >> index 07b13dc..74f6bd4 100644 > >> --- a/drivers/gpu/drm/i915/intel_sprite.c > >> +++ b/drivers/gpu/drm/i915/intel_sprite.c > >> @@ -643,6 +643,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 !=3D I915_SET_COLORKEY_NONE; > >> +} > >> + > >> static int > >> intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, > >> struct drm_framebuffer *fb, int crtc_x, int crtc_y, > >> @@ -828,7 +837,7 @@ intel_update_plane(struct drm_plane *plane, struct= drm_crtc *crtc, > >> * If the sprite is completely covering the primary plane, > >> * we can disable the primary and save power. > >> */ > >> - disable_primary =3D drm_rect_equals(&dst, &clip); > >> + disable_primary =3D drm_rect_equals(&dst, &clip) && !colorkey_en= abled(intel_plane); > >> WARN_ON(disable_primary && !visible && intel_crtc->active); > >> > >> mutex_lock(&dev->struct_mutex); > > > > Reviewed-by: Jesse Barnes > = > Ready your canisters with gallons full of sore acid and raw hatred, > maintainer party-crasher coming in: Where's the igt? > = > Should be fairly simple to exercise with those fancy CRCs we have ... Whoever ends up writing the basic plane crc tests gets to add some colorkey tests too. But this fixes a real bug, so my preference would to to apply it asap, test or no test. -- = Ville Syrj=E4l=E4 Intel OTC