From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Anholt Subject: Re: [PATCH 2/3] drm/vc4: Check if plane requires background fill Date: Wed, 07 Mar 2018 07:50:41 -0800 Message-ID: <87y3j351gu.fsf@anholt.net> References: <1520300919-103427-1-git-send-email-stschake@gmail.com> <1520300919-103427-3-git-send-email-stschake@gmail.com> <20180306194316.GJ5453@intel.com> <877eqoiw3q.fsf@anholt.net> <20180307150539.GO5453@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0664644329==" Return-path: Received: from anholt.net (anholt.net [50.246.234.109]) by gabe.freedesktop.org (Postfix) with ESMTP id 71CBB6E0D4 for ; Wed, 7 Mar 2018 15:50:44 +0000 (UTC) In-Reply-To: <20180307150539.GO5453@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Ville =?utf-8?B?U3lyasOkbMOk?= Cc: airlied@linux.ie, linux-rpi-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, Stefan Schake List-Id: dri-devel@lists.freedesktop.org --===============0664644329== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ville Syrj=C3=A4l=C3=A4 writes: > On Tue, Mar 06, 2018 at 04:10:33PM -0800, Eric Anholt wrote: >> Ville Syrj=C3=A4l=C3=A4 writes: >>=20 >> > On Tue, Mar 06, 2018 at 02:48:38AM +0100, Stefan Schake wrote: >> >> Considering a single plane only, we have to enable background color >> >> when the plane has an alpha format and could be blending from the >> >> background or when it doesn't cover the entire screen. >> >>=20 >> >> Signed-off-by: Stefan Schake >> >> --- >> >> drivers/gpu/drm/vc4/vc4_drv.h | 6 ++++++ >> >> drivers/gpu/drm/vc4/vc4_plane.c | 15 ++++++++++++++- >> >> 2 files changed, 20 insertions(+), 1 deletion(-) >> >>=20 >> >> diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_= drv.h >> >> index fefa166..7cc6390 100644 >> >> --- a/drivers/gpu/drm/vc4/vc4_drv.h >> >> +++ b/drivers/gpu/drm/vc4/vc4_drv.h >> >> @@ -302,6 +302,12 @@ struct vc4_hvs { >> >>=20=20 >> >> struct vc4_plane { >> >> struct drm_plane base; >> >> + >> >> + /* Set when the plane has per-pixel alpha content or does not cover >> >> + * the entire screen. This is a hint to the CRTC that it might need >> >> + * to enable background color fill. >> >> + */ >> >> + bool needs_bg_fill; >> > >> > Looks to me like that should really be a bitmask (or something similar) >> > in the crtc state. >>=20 >> Why? >>=20 >> In particular, VC4 really doesn't have a fixed number of planes, and the >> fact that we're exposing just a handful so far is probably a bug. > > The problem is that this seems to clobber the device state from the > .atomic_check() hook. So if you do a CHECK_ONLY atomic ioctl (or > some later check simply fails and the operation is aborted) you've > already modified the state of the device, and some later operation > may then end up doing the wrong thing. > > I guess you could track this in the plane struct like here, but as > with the actual hardware state that shouldn't get modified until > we're sure the checked state is really meant to be commited to the > hardware. Oh, I hadn't noticed it was in vc4_plane, not vc4_plane_state. Yeah, it should be in the plane state. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE/JuuFDWp9/ZkuCBXtdYpNtH8nugFAlqgClEACgkQtdYpNtH8 nuglCA//Tl5QDM0RFCnyRa2PN/wE2YsJdLTuI6NNUDeLRWwCxcnmNLMzbKgB4VnB mBa+gK3sgxGBexw07ZvWH/7iefFCSNDY9uYkTX89QJ03WsWoIbZ7lCCRRC9jDxqK S1cncnTgWnx+vdBX7MkGcLwdBALEJ3/9XiQxGTLUioYR+A9ocxnciPKZ4a9u8QuG ZSS35Q/YQFVVHpP3OTvUxeLXEglpwzVtimLXv4Bzyst1zM38A9eaBZoXxOSnAnoz CiCNB5I7adU9vlvEysHZ+aipwA4/+yEAubuCv5Loq5wuzdY6zzhAz+WJ0mxf8UWB 6ILy3edls7Yj6BIkXTx3uWQn6RgfBU0pNuY6aJuFUtBeMJHQB23sUhEQW/IWCQNu EDdw/nDS3x4AGbygIrQJkUEULzuoLiq6CckYjx32UijTa2tdznCtF/Guc9yq2+Ww KL18kGgG1CYYXj404gMb42ezr6YVpq6l7uyRpex4l8GDXwRR/zQ3qWDAqsgg4TdQ oY1Qh54b7mME/BHsnfdX/sG6g30+oRKvo384UAQEvmPe7N571U1oAjtH4fVF0uUj DD5Fb5z9AMC8bh0bscFji0cmcl3d21SjcxH7CMqqJiT61wNef2Bn6NVPfEH/GwUG r/jXVT49qhPvpOBL26qMqKVwV2gs6Qw4iixNp6ltUlH/m+Ouay0= =ZiXm -----END PGP SIGNATURE----- --=-=-=-- --===============0664644329== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============0664644329==--