Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5211827imm; Tue, 16 Oct 2018 06:58:09 -0700 (PDT) X-Google-Smtp-Source: ACcGV60jzPdO3jqq254XQapZUy9bMwB7+ghHsVK0xFryj4WpeKN3H/47PX+3vG7SSCyz+B+0MiKr X-Received: by 2002:a17:902:f08c:: with SMTP id go12mr21797687plb.263.1539698289457; Tue, 16 Oct 2018 06:58:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539698289; cv=none; d=google.com; s=arc-20160816; b=j9OQbUcyLsDVxcvcHmYQ/UiYlGyy1p8cCOZhT5gD3k7DmsznfoVMcfrBl3kU5aIwG+ zhG9TDox4Mwruif5Bo9k6wWC2vM3eRG3c5uruGwBR9nWFbrGIB0kRYm1PwK09V4GPVeD PNKH5ZQgY/nwbK4l5h0I36vtDZ4cweI/YIyOfloKs1SnUWdgIH3suVQXd1D4zlwSa1nd vNS3KFxtY+mNpRNms0RlWVanwOQKrrVGofxaKUIna5ZD20MiDVht93pkJMBrDEyQQgpv edC0zvcPOtzazQmDotcUSvWKSBXw4UdV0c45JlS6EwfgUzSYV5eTEIJQBtuCgDXSAdSA kn1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id; bh=Lk4aWMnsrxXYKJgkX2WRIjDtEPuRgECNywndIkwc6oU=; b=RTJ4znZvM5r2NQWKRCKTRN56GQIAXVXOR2+UBSC3K9ozv+cpKjIB7CeXCyEo4NawGU +MZh/lqr49GxmNJuzENpuQSCwYhmcad1FteM0lU5ZctEWCP4vBh/y//kmm3F/yfvUtaj gFZtJbwWhz9VVaIEY+63CqDIjmY0VnnM3mBHLuYO9yfouzfpwllNyn8Wq1jw7jYi2Osn 7ORGiQN+hoznP7LbUti+6/+4XJlLqtkse+ZunsP+O3RUvGEc/v4+mV+kGJMUlJp0q4lE nSJgZZ3zWuPOHqKVXQt54GEBV5bq+I19C/jZHrJWlfZ0Ch9eaBDxlOv4ZtHRKfP2mfOo t8jQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 16-v6si16537008pfc.21.2018.10.16.06.57.52; Tue, 16 Oct 2018 06:58:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727061AbeJPVr4 (ORCPT + 99 others); Tue, 16 Oct 2018 17:47:56 -0400 Received: from leonov.paulk.fr ([185.233.101.22]:38654 "EHLO leonov.paulk.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727006AbeJPVr4 (ORCPT ); Tue, 16 Oct 2018 17:47:56 -0400 Received: from gagarine.paulk.fr (gagarine [192.168.1.127]) by leonov.paulk.fr (Postfix) with ESMTPS id 97712BFE9C for ; Tue, 16 Oct 2018 15:57:19 +0200 (CEST) Received: by gagarine.paulk.fr (Postfix, from userid 114) id 183CEC1036; Tue, 16 Oct 2018 15:57:19 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on gagarine.paulk.fr X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT autolearn=disabled version=3.4.1 Received: from collins (unknown [192.168.1.1]) by gagarine.paulk.fr (Postfix) with ESMTPSA id 8E38FC102F; Tue, 16 Oct 2018 15:57:09 +0200 (CEST) Message-ID: <23f66de8a3e55cba253b89328f0f268a7c4df29d.camel@paulk.fr> Subject: Re: [PATCH 05/10] drm/sun4i: Explicitly list and check formats supported by the frontend From: Paul Kocialkowski To: Maxime Ripard Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, David Airlie , Chen-Yu Tsai , Daniel Vetter , Gustavo Padovan , Sean Paul Date: Tue, 16 Oct 2018 15:57:41 +0200 In-Reply-To: <20180323100659.vojpyt7eazioevdj@flea> References: <20180321152904.22411-1-paul.kocialkowski@bootlin.com> <20180321152904.22411-6-paul.kocialkowski@bootlin.com> <20180323100659.vojpyt7eazioevdj@flea> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-ccw5O2IjhWAC8Q6cOR/7" User-Agent: Evolution 3.30.1 Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-ccw5O2IjhWAC8Q6cOR/7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Le vendredi 23 mars 2018 =C3=A0 11:06 +0100, Maxime Ripard a =C3=A9crit : > On Wed, Mar 21, 2018 at 04:28:59PM +0100, Paul Kocialkowski wrote: > > In order to check whether the frontend supports a specific format, an > > explicit list and a related helper are introduced. > >=20 > > They are then used to determine whether the frontend can actually suppo= rt > > the requested format when it was selected to be used. > >=20 > > Signed-off-by: Paul Kocialkowski > > --- > > drivers/gpu/drm/sun4i/sun4i_backend.c | 5 ++++ > > drivers/gpu/drm/sun4i/sun4i_frontend.c | 44 ++++++++++++++++++++++++++= ++++++++ > > drivers/gpu/drm/sun4i/sun4i_frontend.h | 1 + > > 3 files changed, 50 insertions(+) > >=20 > > diff --git a/drivers/gpu/drm/sun4i/sun4i_backend.c b/drivers/gpu/drm/su= n4i/sun4i_backend.c > > index 7703ba989743..1fad0714c70e 100644 > > --- a/drivers/gpu/drm/sun4i/sun4i_backend.c > > +++ b/drivers/gpu/drm/sun4i/sun4i_backend.c > > @@ -532,6 +532,11 @@ static int sun4i_backend_atomic_check(struct sunxi= _engine *engine, > > struct drm_format_name_buf format_name; > > =20 > > if (sun4i_backend_plane_uses_frontend(plane_state)) { > > + if (!sun4i_frontend_format_is_supported(fb->format->format)) { > > + DRM_DEBUG_DRIVER("Frontend plane check failed\n"); > > + return -EINVAL; > > + } > > + >=20 > So you're checking if the frontend doesn't support it and if the > backend doesn't support it. Who supports it then? :) >=20 > Like I was saying, this should be moved to the previous patch, within > sun4i_backend_plane_uses_frontend. You're right, this isn't the right place to put it. sun4i_backend_plane_uses_frontend should definitely guarantee that the format is supported. > > +static const uint32_t sun4i_frontend_formats[] =3D { > > + /* RGB */ > > + DRM_FORMAT_XRGB8888, > > + DRM_FORMAT_BGRX8888, > > + /* YUV444 */ > > + DRM_FORMAT_YUV444, > > + DRM_FORMAT_YVU444, > > + /* YUV422 */ > > + DRM_FORMAT_YUYV, > > + DRM_FORMAT_YVYU, > > + DRM_FORMAT_UYVY, > > + DRM_FORMAT_VYUY, > > + DRM_FORMAT_NV16, > > + DRM_FORMAT_NV61, > > + DRM_FORMAT_YUV422, > > + DRM_FORMAT_YVU422, > > + /* YUV420 */ > > + DRM_FORMAT_NV12, > > + DRM_FORMAT_NV21, > > + DRM_FORMAT_YUV420, > > + DRM_FORMAT_YVU420, > > + /* YUV411 */ > > + DRM_FORMAT_YUV411, > > + DRM_FORMAT_YVU411, > > +}; >=20 > I think this list should reflect what the driver currently supports, > not what the hardware supports. Agreed, this should be updated with the follow-up patch that adds YUV support. Cheers, Paul --=20 Developer of free digital technology and hardware support. Website: https://www.paulk.fr/ Coding blog: https://code.paulk.fr/ Git repositories: https://git.paulk.fr/ https://git.code.paulk.fr/ --=-ccw5O2IjhWAC8Q6cOR/7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEAbcMXZQMtj1fphLChP3B6o/ulQwFAlvF7lUACgkQhP3B6o/u lQxHKg/9EE9HsCWeYxoBsubeXu6sLBRG5Hkrh/op4WBc+wNotPE6Kgs9XQINWGpq AUKG2VShYqUseW8bes0v0Vv2h5CIW0zgoudnT+HKuqg3RtxgcMib6ZGea8swUqCA cBBlzEDDMUvyQ9/6JdDAREGmXrSPAkI8vkCtCGQzLmw9yYgtcYG2aBFqie/hUQGn REob+cOCZA4ATOev8TVV0HJoElK5BwMGxLdcZMl3HndiX0WcpJDbMLtRCZQptRN2 2eovzGpoMENMOxQwUBp+TZP85dlq0FbJFZWuGB9TcXKIl1zWzT2nILfM/ieTDuR2 KYRMBRfy496Z0/k36V03ec9QPkz9x7dTcWlcNSDXtcVF8tDX6i8Wwof3EYcLGScM KtMhqoCdsbsX454LKpZbneUycJ/a7VoLc5uy3k9UZ/GG7PQYmdsA1PVSwc+QCEPX D0jpCdn757DDM6XjEZprhtUSAXfHqWF0u5+gIY+hvLRmQvssMMt8y5dqJpb2Ffqh 76iQdKs1JYzFRIRLgBdKKT9HTPuSaWLMR6jD3WmPc68JOiElsgP5bDKGYg0TbCVH iTAdQ5s4AWkVgzLBjeh/pIAJS2K+Ufw7eB1kdofjrEuqJgW9k+gzi1ap4I/KWvdL 9h0Ih8X/41SVHqW6BxhEGPUYnhavNHnloYJwCd1swxYSu6kVLtg= =Hfjb -----END PGP SIGNATURE----- --=-ccw5O2IjhWAC8Q6cOR/7--