From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [RFC v2 5/5] drm/i915: Use generic HDMI infoframe helpers Date: Thu, 6 Dec 2012 15:23:33 +0100 Message-ID: <20121206142333.GA15982@avionic-0098.adnet.avionic-design.de> References: <1354725944-1862-1-git-send-email-thierry.reding@avionic-design.de> <1354725944-1862-6-git-send-email-thierry.reding@avionic-design.de> <20121206141631.GU11556@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1362269923==" Return-path: Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.10]) by gabe.freedesktop.org (Postfix) with ESMTP id 95EC7E66AA for ; Thu, 6 Dec 2012 06:23:37 -0800 (PST) In-Reply-To: <20121206141631.GU11556@phenom.ffwll.local> 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: Daniel Vetter Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1362269923== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ew6BAiZeqk4r7MaW" Content-Disposition: inline --ew6BAiZeqk4r7MaW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 06, 2012 at 03:16:31PM +0100, Daniel Vetter wrote: > On Wed, Dec 05, 2012 at 05:45:44PM +0100, Thierry Reding wrote: > > Use the generic HDMI infoframe helpers to get rid of the duplicate > > implementation in the i915 driver. > >=20 > > Signed-off-by: Thierry Reding >=20 > > diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/i= ntel_sdvo.c > > index 4b07401..192d791 100644 > > --- a/drivers/gpu/drm/i915/intel_sdvo.c > > +++ b/drivers/gpu/drm/i915/intel_sdvo.c > > @@ -29,6 +29,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -935,20 +936,17 @@ static bool intel_sdvo_write_infoframe(struct int= el_sdvo *intel_sdvo, > > =20 > > static bool intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo) > > { > > - struct dip_infoframe avi_if =3D { > > - .type =3D DIP_TYPE_AVI, > > - .ver =3D DIP_VERSION_AVI, > > - .len =3D DIP_LEN_AVI, > > - }; > > - uint8_t sdvo_data[4 + sizeof(avi_if.body.avi)]; > > + uint8_t sdvo_data[HDMI_AVI_INFOFRAME_SIZE]; > > + struct hdmi_avi_infoframe frame; > > + ssize_t len; > > =20 > > - intel_dip_infoframe_csum(&avi_if); > > + len =3D hdmi_avi_infoframe_init(&frame); > > + if (len < 0) > > + return false; > > =20 > > - /* sdvo spec says that the ecc is handled by the hw, and it looks like > > - * we must not send the ecc field, either. */ > > - memcpy(sdvo_data, &avi_if, 3); > > - sdvo_data[3] =3D avi_if.checksum; >=20 > This difference between how we need to send the infoframe to the hw > between sdvo (without ecc field present) and native hdmi (ecc field > present, but still computed by the hw) seems to have been lost. On a quick > read from your infoframe packer it looks like the ecc field isn't part of > the packed infoframe, so this patch would break native hdmi ports (in the > intel_hdmi.c file). Actually this ECC field seems to be something specific to Intel hardware. It doesn't appear in the HDMI specification nor in CEA-861-D. So it the binary infoframe representation doesn't contain it, therefore it should be handled by the respective drivers. So in fact the code should be working fine for HDMI and SDVO, since for the HDMI ports I explicitly left the fourth byte of the header empty, while for SDVO, the checksum is the one as computed by hdmi_avi_infoframe_pack(), which is at byte 3 and therefore matches the previous code. Thierry --ew6BAiZeqk4r7MaW Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQIcBAEBAgAGBQJQwKplAAoJEN0jrNd/PrOhiBYP/1Ni+Y10HCaV4j+1LmySwtim lpJqxAIgmot2deZPA34CDwk7G7rjE5jABlPSUE6ByUC4i9gNONhXXc9Ua8vOLTsX hxnK4Cm7fQtv2/q7jKYetdAl7W5yxBB4i1RHFeOujljeM7pKBUuXIzW9h5pK82Cx NOdJg3tKp+FaftlvjGk7n7XWKsacGo7oVDxHKGpQgGa0Xeie+lM7aF1w1hHJkBOg QVLjBi+2a/TiVR699A9PQt1YPabsvxrQ+k9xwvg72Ua6xOb3Y4JIJ0xVEW//dHTt 7o/QuUEhXJGLZSIo4kWHrdihldjo3pHTqFuLgaCVflOkvHtfFfONyodiHQPOIix7 OjFGvlFwv1ssWex4OCKAdJadjxkkR59zeBFzM1wrTT21m2oT5mr05rjQJL7rpMjF 6NY489+KiXpVQo+EaIQPcUA2xoDUGGobpoZx+teLU/X8j/KXfKftn4XMnz3aCTDC 46IFhD39hC1UIY7FCdcbbH9RC6rDNHfCzzTmumFu6peyql9ayc4rRo2J91RSKSGT lMS2OL9Y9kclqdWS5RGoU89CUH9vV9YKr3B8rdzhcZ9L97sL24gpI0qzZjhEwL1V ReM9Py+bFnjwsUUeSPlZh5RJD62HrdJPQb4U1qDSCk9bgKfLulGWV+KRCZG2YlBY 3+bRoF/uEmYkHsP5A6yu =A6rO -----END PGP SIGNATURE----- --ew6BAiZeqk4r7MaW-- --===============1362269923== 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 --===============1362269923==--