From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesse Barnes Subject: Re: [PATCH resend 2/2] drm: Parse color format information in CEA blocks Date: Tue, 28 Feb 2012 10:06:05 -0800 Message-ID: <20120228100605.4e50bf02@jbarnes-desktop> References: <1330420905-6137-1-git-send-email-lars@metafoo.de> <1330420905-6137-2-git-send-email-lars@metafoo.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1998491218==" Return-path: Received: from oproxy6-pub.bluehost.com (oproxy6-pub.bluehost.com [67.222.54.6]) by gabe.freedesktop.org (Postfix) with SMTP id 2FD099E771 for ; Tue, 28 Feb 2012 10:06:10 -0800 (PST) In-Reply-To: <1330420905-6137-2-git-send-email-lars@metafoo.de> 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: Lars-Peter Clausen Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1998491218== Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/0bkgDZ=.gZFWA/.ZWjjyZVf"; protocol="application/pgp-signature" --Sig_/0bkgDZ=.gZFWA/.ZWjjyZVf Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 28 Feb 2012 10:21:45 +0100 Lars-Peter Clausen wrote: > The CEA extension block has a field which describes which YCbCr modes are > supported by the device, use it to fill the drm_display_info color_formats > fields. Also the existence of a CEA extension block is used as indication > that the device supports RGB. >=20 > Signed-off-by: Lars-Peter Clausen > --- > drivers/gpu/drm/drm_edid.c | 31 +++++++++++++++++++++---------- > 1 files changed, 21 insertions(+), 10 deletions(-) >=20 > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c > index a6bb2f5..390aeca 100644 > --- a/drivers/gpu/drm/drm_edid.c > +++ b/drivers/gpu/drm/drm_edid.c > @@ -1313,6 +1313,8 @@ add_detailed_modes(struct drm_connector *connector,= struct edid *edid, > #define VENDOR_BLOCK 0x03 > #define SPEAKER_BLOCK 0x04 > #define EDID_BASIC_AUDIO (1 << 6) > +#define EDID_CEA_YCRCB444 (1 << 5) > +#define EDID_CEA_YCRCB422 (1 << 4) > =20 > /** > * Search EDID for CEA extension block. > @@ -1667,13 +1669,29 @@ static void drm_add_display_info(struct edid *edi= d, > info->bpc =3D 0; > info->color_formats =3D 0; > =20 > - /* Only defined for 1.4 with digital displays */ > - if (edid->revision < 4) > + if (edid->revision < 3) > return; > =20 > if (!(edid->input & DRM_EDID_INPUT_DIGITAL)) > return; > =20 > + /* Get data from CEA blocks if present */ > + edid_ext =3D drm_find_cea_extension(edid); > + if (edid_ext) { > + info->cea_rev =3D edid_ext[1]; > + > + /* The existence of a CEA block should imply RGB support */ > + info->color_formats =3D DRM_COLOR_FORMAT_RGB444; > + if (edid_ext[3] & EDID_CEA_YCRCB444) > + info->color_formats |=3D DRM_COLOR_FORMAT_YCRCB444; > + if (edid_ext[3] & EDID_CEA_YCRCB422) > + info->color_formats |=3D DRM_COLOR_FORMAT_YCRCB422; > + } > + > + /* Only defined for 1.4 with digital displays */ > + if (edid->revision < 4) > + return; > + > switch (edid->input & DRM_EDID_DIGITAL_DEPTH_MASK) { > case DRM_EDID_DIGITAL_DEPTH_6: > info->bpc =3D 6; > @@ -1699,18 +1717,11 @@ static void drm_add_display_info(struct edid *edi= d, > break; > } > =20 > - info->color_formats =3D DRM_COLOR_FORMAT_RGB444; > + info->color_formats |=3D DRM_COLOR_FORMAT_RGB444; > if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB444) > info->color_formats |=3D DRM_COLOR_FORMAT_YCRCB444; > if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB422) > info->color_formats |=3D DRM_COLOR_FORMAT_YCRCB422; > - > - /* Get data from CEA blocks if present */ > - edid_ext =3D drm_find_cea_extension(edid); > - if (!edid_ext) > - return; > - > - info->cea_rev =3D edid_ext[1]; > } > =20 > /** Reviewed-by: Jesse Barnes --=20 Jesse Barnes, Intel Open Source Technology Center --Sig_/0bkgDZ=.gZFWA/.ZWjjyZVf Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBAgAGBQJPTReNAAoJEIEoDkX4Qk9hvI8P/judTyz4QDucO/lUHuA5xwpu CpxoHInVV0wCsJygU+QUEYbj/UnUAwQtMSNbgxxRAoUypbZPPhMNSB25JEXWD/sv Wrj75rAseR3zcFqlfJW561XW6jq+ymkHTrKI+gDzEB2Zk9EjvL1WYUi9EXy8TcHA v7MUMCEpd/VOuKGzsA8Vmfg7ep7kqNHSumAK6cEFVzq1q1Gg9iRGKE2GExSriv05 PqvqohQz0i90mk8B9dld/K4PZzaJMjmEng+beSKxOX0CBdCD/SeNqILcxmtY+bVj Bv0ej8En8TGdcZKsfS1EqBlUsQdHNCmC30ZGHEZNr5gYPKC9EBhGfGUIfMZv8oRP jvUSbQWSoNtirT6KdCxK6AFaTzhrX2iShqSimGQ26jkzMD64xpJBFP7KhZN439yC g8RyTlNwGipcTptDV3Ajp4lgNHM7XzMTc6w5OzU/WnNWdKjkg8XJdoHRO9OnjsOd 5HUzk3FM0XXI97Mhm4eGkkHG7DsBvimey/GeULR5R7TJ4a7M93AZwsscVtxm9PH4 NtMjiN/SejToLoqLc/+Dih4Q5ZmnRn7Ke4kDHCxRShdFBhhen1XysdXfVlKpKPa9 grmENvsdwDPvfPCwcaZgL6aLlem36KbnUODxoQGo9HmpPcTkVYezYA5jPE4Pnuy4 95VSkC5b7CEveMa6tYFG =ZUEL -----END PGP SIGNATURE----- --Sig_/0bkgDZ=.gZFWA/.ZWjjyZVf-- --===============1998491218== 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 --===============1998491218==--