From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH v4 13/16] drm/dsi: Implement DCS {get,set}_pixel_format commands Date: Tue, 4 Nov 2014 14:34:06 +0100 Message-ID: <20141104133404.GA31200@ulmo> References: <1415006021-29313-1-git-send-email-thierry.reding@gmail.com> <1415006021-29313-13-git-send-email-thierry.reding@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1907817264==" Return-path: Received: from mail-wg0-f54.google.com (mail-wg0-f54.google.com [74.125.82.54]) by gabe.freedesktop.org (Postfix) with ESMTP id 90A386E5EE for ; Tue, 4 Nov 2014 05:34:08 -0800 (PST) Received: by mail-wg0-f54.google.com with SMTP id n12so8123152wgh.13 for ; Tue, 04 Nov 2014 05:34:07 -0800 (PST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Sean Paul Cc: Andrzej Hajda , dri-devel List-Id: dri-devel@lists.freedesktop.org --===============1907817264== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NzB8fVQJ5HfG6fxh" Content-Disposition: inline --NzB8fVQJ5HfG6fxh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 03, 2014 at 12:10:29PM -0500, Sean Paul wrote: > On Mon, Nov 3, 2014 at 4:13 AM, Thierry Reding = wrote: > > From: Thierry Reding > > > > Provide small convenience wrappers to query or set the pixel format used > > by the interface. > > > > Signed-off-by: Thierry Reding > > --- > > drivers/gpu/drm/drm_mipi_dsi.c | 42 ++++++++++++++++++++++++++++++++++= ++++++++ > > include/drm/drm_mipi_dsi.h | 2 ++ > > 2 files changed, 44 insertions(+) > > > > diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_= dsi.c > > index da34469b9b98..226822a44457 100644 > > --- a/drivers/gpu/drm/drm_mipi_dsi.c > > +++ b/drivers/gpu/drm/drm_mipi_dsi.c > > @@ -553,6 +553,27 @@ int mipi_dsi_dcs_get_power_mode(struct mipi_dsi_de= vice *dsi, u8 *mode) > > EXPORT_SYMBOL(mipi_dsi_dcs_get_power_mode); > > > > /** > > + * mipi_dsi_dcs_get_pixel_format() - gets the pixel format for the RGB= image > > + * data used by the interface > > + * @dsi: DSI peripheral device > > + * @format: return location for the pixel format > > + * > > + * Return: 0 on success or a negative error code on failure. > > + */ > > +int mipi_dsi_dcs_get_pixel_format(struct mipi_dsi_device *dsi, u8 *for= mat) > > +{ > > + ssize_t err; > > + > > + err =3D mipi_dsi_dcs_read(dsi, MIPI_DCS_GET_PIXEL_FORMAT, forma= t, > > + sizeof(*format)); > > + if (err < 0) > > + return err; >=20 > This should probably return -ENODATA when err !=3D sizeof(*format), like > the previous patch did. Done. > It might be worth moving that logic into mipi_dsi_dcs_read, assuming > we're not interested in partial data. Agreed. I think we can leave that for a subsequent refactoring once these function have matured a bit more and patterns appear. Thierry --NzB8fVQJ5HfG6fxh Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUWNXMAAoJEN0jrNd/PrOhubIP/iyH8N0oiaLJr8ab2bHbUMRO 2ak0TqvqzKIItKbZgSOK2wOQvJpzTlByNrbwVkxKLG2JzC7NBaQkMXW0I2OoaIk3 4QUb+OmIEFXHpDCa7WzPr1AJM/3MAmxZ7UBjT16E2cGghNzEoz9rcLobHuJ/cLrA uGSrwHd8/+TRVMsNAkK+MbnJTcGH6X0aRu3v+oLKizZsA2gVwrV5+Fyzfpl94aAH FonLqunjq5a3E/Vw9PIwBdd0Lxvs1FXqw2HtElcG4nSQMB/Va0bt8OMRo+xZw6vu KuhFJYq5rb3+k8wOP6tXCGSufPUmekBOdnA56jAmxUw6WN5cax1uQkb7Ixb/cmjl +evdvKUMHZdKfoGEstGzP0Cln61IMYKzVKoWk6N1cY2Ge7PhRjcZGFI3ITFNnTya FBI4hNYW2FIxJCeUyXYErui8NPN4eEaCGdLTZxqjff/FTOHbTF8EeYJWTgiIOLCr LP83wsjhce/AXLuaJsu2GArAOwmqtOeLI0cnSGlP6sLk0geQKN7nU0w8HpRtbO+Q gPl8XDy+R/uxlwm1/ECmWL187eP1sffUC6mrwC+EvRNFK5jgkybmjiIcjGP+Wvbs z/95TZ6zpqJb/qGTbV6AILVbi9LyLCRoDVIjYmXU0N2HzamE9bzYW0dfFxPe84cn h8svxnr7xj14aIIB2b15 =Bv6E -----END PGP SIGNATURE----- --NzB8fVQJ5HfG6fxh-- --===============1907817264== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHA6Ly9saXN0 cy5mcmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9kcmktZGV2ZWwK --===============1907817264==--