From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Anholt Subject: Re: [PATCH 2/3] drm/vc4: Force ->x_scaling[1] should never be set to VC4_SCALING_NONE Date: Thu, 08 Nov 2018 07:12:37 -0800 Message-ID: <87sh0bob6i.fsf@anholt.net> References: <20181024100505.22436-1-boris.brezillon@bootlin.com> <20181024100505.22436-2-boris.brezillon@bootlin.com> <87va57oc3n.fsf@anholt.net> <20181108155659.7039c04f@bbrezillon> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0760188917==" Return-path: Received: from anholt.net (anholt.net [50.246.234.109]) by gabe.freedesktop.org (Postfix) with ESMTP id 05FCD6E4DF for ; Thu, 8 Nov 2018 15:12:40 +0000 (UTC) In-Reply-To: <20181108155659.7039c04f@bbrezillon> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Boris Brezillon Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0760188917== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Boris Brezillon writes: > On Thu, 08 Nov 2018 06:52:44 -0800 > Eric Anholt wrote: > >> Boris Brezillon writes: >>=20 >> > For the YUV conversion to work properly, ->x_scaling[0,1] should never >> > be set to VC4_SCALING_NONE, but vc4_get_scaling_mode() might return >> > VC4_SCALING_NONE if the horizontal scaling ratio exactly matches the >> > horizontal subsampling factor. Add a test to turn VC4_SCALING_NONE >> > into VC4_SCALING_PPF when that happens. >> > >> > Fixes: fc04023fafec ("drm/vc4: Add support for YUV planes.") >> > Signed-off-by: Boris Brezillon =20=20 >>=20 >> I couldn't find a spec justification for this -- did you have a testcase >> that fails? > > Yep. Just set the downscaling ratio to 0.5 with an NV12 format and > you'll hit the issue (I used modetest to do that): > > # modetest -M vc4 -s 29:1920x1080-60 -P 96@95:1920x1080*0.5@NV12 I found that the firmware has a similar behavior to your patch ("if Y is !unity (x or scaling) and UV is unity, set UV to HPPF/VPPF scaling"). They also select the unity flag after the YUV scaling fixup. Regardless, if this works, it's got my reviewed-by. Hopefully we can do some IGT with writeback or chamelium testing all of the X/Y scaling options with a focus on hitting these 1:1 ratios. The state space is big and the docs are just ambiguous enough. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE/JuuFDWp9/ZkuCBXtdYpNtH8nugFAlvkUmUACgkQtdYpNtH8 nujHLg/9EuTuq8BH9Sh55UeEmujHs+vxyfwjDU2OKIKrTMWdMhX6/RabFDtE1/5v PzY+CorS0xSby83AUCMuK62KHp0D+O72tzpQufKnV2p37Y7IgsDerB3mau4l6z06 h6512ectG11D/UwEkr86DZkpQH+h7OSKBoNF36gViLLbontdKOuiCtPW3xjhvTOB SETLTzO1/nKz6BetUXmgAcJrNjv89XpC81OlIEeg1bIyQgVE1ZCOBVaY/SE5/aJ0 5eMOpGZRN8DLZY4JL8RBQiYoSEwS0q7oqHMExMFHFztJhJjJb0gk9RxLpml+X9Hc 0F0pkDAut1lLsyKq5dgaRkmT1oFe/0SWwoKktblBTezwJngSgY5/6C02G5+bXYQF gf/YKazeT0m4zLHFLTLWEMEkSAN9qFWN8fRKMWqvaVgwJj04m2MkUsp0jg9SXWDz TVS8MzpJFncuUpTnxovI854G/8N5xpv9FT1rhn51HHoRIbrXUar2MmVReoU7NDtX MdhxaWE+YbMz1P7ug9PqXayFkqNxNA1I3nvwzXnbC8wmzHDtEk/+E36F/jMho9mc JW6PsbSPogYncbQEYhvYZN6/ERYyxEOGUHKKvV61TijyEI2V9KqkDDsvBVYncm07 L0OkubZFNOg+HMpL5tYwYWH6hJSdTKFWrd8q85O9RrpDzWJu3K0= =amZy -----END PGP SIGNATURE----- --=-=-=-- --===============0760188917== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============0760188917==--