From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [RFC v2 3/5] drm: Add HDMI infoframe helpers Date: Thu, 6 Dec 2012 08:28:36 +0100 Message-ID: <20121206072836.GA25316@avionic-0098.adnet.avionic-design.de> References: <1354725944-1862-1-git-send-email-thierry.reding@avionic-design.de> <1354725944-1862-4-git-send-email-thierry.reding@avionic-design.de> <50BF8998.6060207@metafoo.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1961258774==" Return-path: Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.8]) by gabe.freedesktop.org (Postfix) with ESMTP id 2148AE5C26 for ; Wed, 5 Dec 2012 23:28:40 -0800 (PST) In-Reply-To: <50BF8998.6060207@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 --===============1961258774== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SUOF0GtieIMvvwua" Content-Disposition: inline --SUOF0GtieIMvvwua Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 05, 2012 at 06:51:20PM +0100, Lars-Peter Clausen wrote: > On 12/05/2012 05:45 PM, Thierry Reding wrote: > > Add a generic helper to fill in an HDMI AVI infoframe with data > > extracted from a DRM display mode. >=20 > That's a very nice patch series, comes in pretty handy. Thanks :) >=20 > I've just one comment. >=20 > > [...] > > +static inline enum hdmi_picture_aspect > > +drm_display_mode_get_aspect(const struct drm_display_mode *mode) > > +{ > > + enum hdmi_picture_aspect aspect =3D HDMI_PICTURE_ASPECT_NONE; > > + > > + if ((mode->hdisplay * 9) / 16 =3D=3D mode->vdisplay) > > + aspect =3D HDMI_PICTURE_ASPECT_16_9; > > + else if ((mode->hdisplay * 3) / 4 =3D=3D mode->vdisplay) > > + aspect =3D HDMI_PICTURE_ASPECT_4_3; > > + > > + return aspect; > > +} > > + > > +/** > > + * drm_hdmi_avi_infoframe_from_display_mode() - fill an HDMI AVI infof= rame with > > + * data from a DRM displa= y mode > > + * @frame: HDMI AVI infoframe > > + * @mode: DRM display mode > > + * > > + * Returns 0 on success or a negative error code on failure. > > + */ > > +int > > +drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *fr= ame, > > + const struct drm_display_mode *mode) > > +{ > [...] > > + > > + frame->picture_aspect =3D drm_display_mode_get_aspect(mode); >=20 > As far as I know the picture aspect ratio is supposed to be the aspect ra= tio > of the displayed content not the pixel aspect ratio. The receiver already > knows the pixel aspect ratio since it knows both the pixel width and the > height. The picture aspect ratio is something that could be set by a > userspace application running in fullscreen, e.g. a video player. Isn't that what the active aspect ratio is supposed to do? Unfortunately neither the HDMI specification nor CEA-861-D seem to be very specific about this. What I did in the above was basically just refactoring from what the Tegra driver does. None of the other drivers are filling in any useful values here. Most equipment seems to work just fine if you pass a zeroed out AVI infoframe. =3D) Given that we don't have a way to pass any kind of information to the kernel about this, the only options we have are to either use this or go with HDMI_PICTURE_ASPECT_NONE. I suppose that the latter will work fine too. Does anybody else have more information about what the correct value for this is? Thierry --SUOF0GtieIMvvwua Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQIcBAEBAgAGBQJQwEkkAAoJEN0jrNd/PrOh++QP/jTKHjzF7DFOxoCKUWIcwFe8 /6K8vBCri3qg1xsfXY6Max/zfCGMrSwjOWL50vnxGRX1yjluvCcJ2RhqK8FgDHpZ o6omhpRfMszRGZ0ZQXl69hC4GD/kBQTqGk0WgZ3P0gtYXo4teUe+TRqgoTV3GhNW Fn3CsVXYRonGY1BukGitfRe8L8hXYIZ1sEXi5sehZ5cZUk91Iz9ZGvwHXlcZQcwP uos++AbDz7LMBvw83+uOcAjow1Ey9S0VWg2oKY1dSFOvpGMfhWZWSHYSvJrgJEoZ JrgT+dQ0tGzfBWgBRcX1VllW6x0/a2lsMRrXmn3jgmngTnCTNDrAVz6QYAvvluxp yVCapdf0LKBkZDr4jS3rl5WroheWfcJxPGJTbOC/57Pp6sebcrs8IgXHuH8uIiZT tOvAJINlT9lB/kxJLA967b4Y6xiW7ZDjJOlElonQ0LRnSlc01yy5QiUDE7+E3D77 kv7BWDExM9zKptf5PHASAfLKuTMWKLkBxDpcsUUYUewzr2lCqbfe0hfVEGH1lkBS R3ZaN7BcYO9aJR10T4xefl7hMGYKxvRe7ccFwHTOx5TO5aqglrIH/N4eHzI5BoGT NUJgUiWZGKwPiFEcE2kOQdp//NhPiFe124oh5uTRikuqPFRFGVy5qGIZnem4IsBI bt5T5NE5y0Aw8s234BzE =FwJP -----END PGP SIGNATURE----- --SUOF0GtieIMvvwua-- --===============1961258774== 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 --===============1961258774==--