From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH] drm/i915: set the AVI VIC of the HDMI mode Date: Thu, 22 Nov 2012 07:46:48 +0100 Message-ID: <20121122064648.GA22143@avionic-0098.adnet.avionic-design.de> References: <1353512389-16261-1-git-send-email-przanoni@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1523708900==" Return-path: Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by gabe.freedesktop.org (Postfix) with ESMTP id A9BFCE5CEC for ; Wed, 21 Nov 2012 22:46:54 -0800 (PST) In-Reply-To: <1353512389-16261-1-git-send-email-przanoni@gmail.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: Paulo Zanoni Cc: intel-gfx@lists.freedesktop.org, Paulo Zanoni , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1523708900== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7AUc2qLy4jB3hD7Z" Content-Disposition: inline --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 21, 2012 at 01:39:48PM -0200, Paulo Zanoni wrote: > From: Paulo Zanoni >=20 > We currently set "0" as the VIC value of the AVI InfoFrames. According > to the specs this should be fine and work for every mode, so to my > point of view we can't consider the current behavior as a bug. The > problem is that we recently received a bug report (Kernel bug #50371) > from a user that has an AV receiver that gives a black screen for any > mode with VIC set to 0. >=20 > So in order to make at least some modes work for him, this patch sets > the correct VIC number when sending AVI InfoFrames. We add a generic > drm function to calculate the VIC number and then call it from the > i915 driver. >=20 > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=3D50371 > Cc: Thierry Reding > Signed-off-by: Paulo Zanoni > --- > drivers/gpu/drm/drm_edid.c | 19 +++++++++++++++++++ > drivers/gpu/drm/drm_modes.c | 3 ++- > drivers/gpu/drm/i915/intel_hdmi.c | 2 ++ > include/drm/drm_crtc.h | 4 +++- > 4 files changed, 26 insertions(+), 2 deletions(-) >=20 > Patch applies on top of Daniel's drm-intel-next-queued. I'm not sure who = exactly > is going to merge this (Dave or Daniel). >=20 > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c > index fadcd44..c57fc46 100644 > --- a/drivers/gpu/drm/drm_edid.c > +++ b/drivers/gpu/drm/drm_edid.c > @@ -2062,3 +2062,22 @@ int drm_add_modes_noedid(struct drm_connector *con= nector, > return num_modes; > } > EXPORT_SYMBOL(drm_add_modes_noedid); > + > +/** > + * drm_mode_vic - return the CEA-861 VIC of a given mode The name in the comment here doesn't match the actual function name. > + * @mode: mode > + * > + * RETURNS: > + * The VIC number, 0 in case it's not a CEA-861 mode. > + */ > +uint8_t drm_mode_cea_vic(const struct drm_display_mode *mode) I understand the reason for returning an uint8_t here, but ... > +{ > + uint8_t i; > + > + for (i =3D 0; i < drm_num_cea_modes; i++) =2E.. maybe unsigned int would be better for the iteration variable here. Looking at drm_edid_modes.h, drm_num_cea_modes is actually signed, which isn't necessary to store an array size, so maybe that should be changed as well. > + if (drm_mode_equal(mode, &edid_cea_modes[i])) > + return i + 1; > + > + return 0; > +} > +EXPORT_SYMBOL(drm_mode_cea_vic); > diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c > index 59450f3..9ef6750 100644 > --- a/drivers/gpu/drm/drm_modes.c > +++ b/drivers/gpu/drm/drm_modes.c > @@ -768,7 +768,8 @@ EXPORT_SYMBOL(drm_mode_duplicate); > * RETURNS: > * True if the modes are equal, false otherwise. > */ > -bool drm_mode_equal(struct drm_display_mode *mode1, struct drm_display_m= ode *mode2) > +bool drm_mode_equal(const struct drm_display_mode *mode1, > + const struct drm_display_mode *mode2) I think this change warrants a separate commit. Thierry --7AUc2qLy4jB3hD7Z Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQIcBAEBAgAGBQJQrcpYAAoJEN0jrNd/PrOh5SkP/0YvfO/nEQhCfgAsgODbAtnV RM0l7sRMmwLceYeJ66XcTxmo0vnUtax9HgUJ5TPrXt09InbqTS3V5hsgXRhiCoJn guiD/gkaVSLasD+jAWeit+357wc7eJn9GtLpMuj3rjB47ZWi22HxBmqv7ouhgI7m C/aCTlBUC/Clxp4EgEYseTe9kqlLN6Q0DyF853HGD+aZ/fICLX3rYfISjcPLjOnp jEo4b2/8zwiew69Xwl1oFBJsILiGVq3xCA7Tr5lAsJGuMOt7pX6ildWGDJ6U/k5r X7VNoFh8uE6PLcARWsaPgUOuMQJ4Ki4evtwZv+pxpVmZ1nJR4GgWSxgN9LO+FZdl t6lx4OupjgbdwaWs6mQeQq0e9YUGJR2UvvAD599Veocy7aY24Im5QCF+pdPlEiyC VlRLr4sqy/iV4PUkGVjqJbGmdQEBKxhK0iIKVxclJ6mJJojBaKZTDjYOEd2sgDfF Bjb58unPuWvACdUQmURbhk32UPsST38npjnWZ6v068FsVvdbtBflI4Eo+6GNOvvd HKeFCILneG2ic9t1qpNJHNqB04E8Vzh5oJbmaQ1a9024FNJKxzWP6/wkAg0dNzIP wQB6MgWKEGtV57VIhU0/zBbMEPb5ozVahko6ZCBTU2vvVsdRhrFRuH5mbNTEZySw gSfhlnMaPjS/lYHy0gAS =ovgj -----END PGP SIGNATURE----- --7AUc2qLy4jB3hD7Z-- --===============1523708900== 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 --===============1523708900==--