From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesse Barnes Subject: Re: [PATCH 2/2] drm: add an fb creation ioctl that takes a pixel format v4 Date: Tue, 15 Nov 2011 12:55:53 -0800 Message-ID: <20111115125553.659dff49@jbarnes-desktop> References: <1321302115-23159-1-git-send-email-jbarnes@virtuousgeek.org> <1321302115-23159-2-git-send-email-jbarnes@virtuousgeek.org> <20111114211644.GH3477@intel.com> <20111114132210.68b40638@jbarnes-desktop> <20111115125702.GL3477@intel.com> <20111115081604.2e3b6dfa@jbarnes-desktop> <20111115203036.GM3477@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0278678313==" Return-path: Received: from oproxy5-pub.bluehost.com (oproxy5-pub.bluehost.com [67.222.38.55]) by gabe.freedesktop.org (Postfix) with SMTP id 30B6C9E7D3 for ; Tue, 15 Nov 2011 12:55:13 -0800 (PST) In-Reply-To: <20111115203036.GM3477@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Ville =?ISO-8859-1?B?U3lyauRs5A==?= Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0278678313== Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/UyEQa7Mzgk3MmhovUTB/31k"; protocol="application/pgp-signature" --Sig_/UyEQa7Mzgk3MmhovUTB/31k Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Tue, 15 Nov 2011 22:30:36 +0200 Ville Syrj=E4l=E4 wrote: > On Tue, Nov 15, 2011 at 08:16:04AM -0800, Jesse Barnes wrote: > > On Tue, 15 Nov 2011 14:57:02 +0200 > > Ville Syrj=E4l=E4 wrote: > > > I'm fine with fourccs as long as the defines are named and documented > > > in way that avoids guesswork. > > >=20 > > > So what I'm thinking is something like this: > > >=20 > > > DRM_FOURCC_RGB332 ... /* [7:0] R:G:B 3:3:2 */ > > > DRM_FOURCC_XRGB1555 ... /* [15:0] x:R:G:B 1:5:5:5, native endian */ > > > DRM_FOURCC_RGB565 ... /* [15:0] R:G:B 5:6:5, native endian */ > > > DRM_FOURCC_XRGB8888 ... /* [31:0] x:R:G:B 8:8:8:8, native endian */ > > > DRM_FOURCC_XRGB2101010 ... /* [31:0] x:R:G:B 2:10:10:10, native endia= n */ > > >=20 > > > DRM_FOURCC_RGB888 ... /* [23:0] R:G:B 8:8:8, little endian */ > > > DRM_FOURCC_BGR888 ... /* [23:0] B:G:R 8:8:8, little endian */ > > >=20 > > > DRM_FOURCC_YUYV ... /* [31:0] Cr:Y1:Cb:Y0 8:8:8:8, little endi= an */ > > > DRM_FOURCC_UYVY ... /* [31:0] Y1:Cr:Y0:Cb 8:8:8:8, little endi= an */ > > > DRM_FOURCC_YVYU ... /* [31:0] Cb:Y1:Cr:Y0 8:8:8:8, little endi= an */ > > > DRM_FOURCC_VYUY ... /* [31:0] Y1:Cb:Y0:Cr 8:8:8:8, little endi= an */ > > >=20 > > > That leaves no room for guesswork. > >=20 > > Looks great. Want to send Dave an incremental patch? I'll apply the > > final version to libdrm for use by userland code. >=20 > What I listed there doesn't match what v4l2 has. So I'm not sure what > to put in a patch. >=20 > It looks like the v4l2 fourccs have explicit endianness (ie. LE or BE). > If we follow that, and assuming people still want to use hardware byte > swappers, it means user space needs some ifdefs to select the approriate > format based on the host endianness. Or, we could do that in the header > file itself, so we would provide three definitions for each format LE, > BE, and NE (which would point to LE or BE depending on host endianness). >=20 > One extra issue I just realized is that the 8bpp and 16bpp v4l2 formats > are in fact BGR nor RGB, that is the component order is such that blue > occupies the most significant bit, red the lsb. I've never even seen > a PC graphics card that supports such formats. Adding insult to injury > PIX_FMT_RGB444 is defined the opposite way, ie. matching what most > graphics cards would expect. Heh, well you can just pick whatever makes sense then for RGB, and remove the _FOURCC_ strings to make it clear we're using sane RGB definitions and not some half-specified fourcc stuff. Thanks, --=20 Jesse Barnes, Intel Open Source Technology Center --Sig_/UyEQa7Mzgk3MmhovUTB/31k Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAEBAgAGBQJOwtHZAAoJEIEoDkX4Qk9heAgQAMQ4Bd6EdvM9D5+4z+c8TilT EmqMRPavQWqlfCObh18XT65YyLCGIkMV8iFj4LsnDA15hPH2dXPWsQfKgWeIszav ldmezz1oAc3U/TiMLMlVBJgvlVvuQaVOz9eBVOdAnNXn59cgn3TYiWBC1u5aI8iu qyq3J1pQbHrfcJe2wA7wiAm/eQzuL862KWYuiXVbW9kinuS1pNrov/g8fvTaNqFw o9gLe5ErgFHgFawR6kVMlX36LgNILU/R6Rb+vYVjnmF7c5k4v9egoN1Vu6T/3S8s 4bN+sqxoZ5z0W9TZtCAIcyvT387NQKpDRIYgpyhS4zKGB0wRzgbikVvZfFkLlv5B Qlb/Q0tvMDIZMiePrZkslv+nMQYWxVrFM3gl3/e6kbpYzUubp6+jHI+BqvUM1+fp GdtHfsANc1Qo+od6x9pJuuBvAg0FBtqlFV/+DJ17PzSctqe/Hxb2ql7kwTtcG4vg hBWV0Ah3adgawJxQab0ftWBGHfIwOvU/hori6U7RI1UZmBMvgM23m+anj2+STboN uSnYKNvhNomQy+zRsTLu8T2fTequa3EjjAvqUw20cpNsazlNU4ddGSoyLhnMUrMV 8o/Ql2zfH+LAHF66BYWh+SLNlniWbGeabnQETUI4W2dHVP+tucPXE3Tz4qjnt3/c LJKvp5XkNKoJdTo+jtka =L1lQ -----END PGP SIGNATURE----- --Sig_/UyEQa7Mzgk3MmhovUTB/31k-- --===============0278678313== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --===============0278678313==--