From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Souza, Jose" Subject: Re: [PATCH 1/2] drm/edid: Add and export function to parse manufacturer id Date: Thu, 8 Nov 2018 20:42:52 +0000 Message-ID: References: <20181108002353.19020-1-jose.souza@intel.com> <20181108083148.GA4266@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0427321183==" Return-path: In-Reply-To: <20181108083148.GA4266@phenom.ffwll.local> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: "daniel@ffwll.ch" Cc: "intel-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" List-Id: dri-devel@lists.freedesktop.org --===============0427321183== Content-Language: en-US Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="=-G2nqlZuFq5DcUz2ma964" --=-G2nqlZuFq5DcUz2ma964 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2018-11-08 at 09:31 +0100, Daniel Vetter wrote: > On Wed, Nov 07, 2018 at 04:23:52PM -0800, Jos=C3=A9 Roberto de Souza > wrote: > > This function will be helpful to drivers that wants to add its own > > quirks to sinks. >=20 > Why would you want to do that? The point of a shared edid parsing > code is > that we can share all these quirks ... >=20 > For these kind of patches, always include the driver code that makes > use > of your new code too. That makes it much easier to answer these > questions. This will be used to disable or enable with quirks PSR in some panels that do not behave like eDP spec states. As this would be specifc to i915, I guess is better keep the list only in i915. What is your opinion about that? >=20 > Thanks, Daniel >=20 >=20 > > Signed-off-by: Jos=C3=A9 Roberto de Souza > > --- > > drivers/gpu/drm/drm_edid.c | 20 ++++++++++++++++---- > > include/drm/drm_edid.h | 1 + > > 2 files changed, 17 insertions(+), 4 deletions(-) > >=20 > > diff --git a/drivers/gpu/drm/drm_edid.c > > b/drivers/gpu/drm/drm_edid.c > > index b506e3622b08..1a0ddf3d326b 100644 > > --- a/drivers/gpu/drm/drm_edid.c > > +++ b/drivers/gpu/drm/drm_edid.c > > @@ -1755,6 +1755,21 @@ EXPORT_SYMBOL(drm_edid_duplicate); > > =20 > > /*** EDID parsing ***/ > > =20 > > +/** > > + * drm_edid_manufacturer_parse - parse the EDID manufacturer id to > > readable > > + * characters and set into manufacturer parameter. > > + * @edid: EDID to get the manufacturer > > + * @manufacturer: the char buffer to store the id > > + */ > > +void drm_edid_manufacturer_parse(const struct edid *edid, char > > manufacturer[3]) > > +{ > > + manufacturer[0] =3D ((edid->mfg_id[0] & 0x7c) >> 2) + '@'; > > + manufacturer[1] =3D (((edid->mfg_id[0] & 0x3) << 3) | > > + ((edid->mfg_id[1] & 0xe0) >> 5)) + '@'; > > + manufacturer[2] =3D (edid->mfg_id[1] & 0x1f) + '@'; > > +} > > +EXPORT_SYMBOL(drm_edid_manufacturer_parse); > > + > > /** > > * edid_vendor - match a string against EDID's obfuscated vendor > > field > > * @edid: EDID to match > > @@ -1766,10 +1781,7 @@ static bool edid_vendor(const struct edid > > *edid, const char *vendor) > > { > > char edid_vendor[3]; > > =20 > > - edid_vendor[0] =3D ((edid->mfg_id[0] & 0x7c) >> 2) + '@'; > > - edid_vendor[1] =3D (((edid->mfg_id[0] & 0x3) << 3) | > > - ((edid->mfg_id[1] & 0xe0) >> 5)) + '@'; > > - edid_vendor[2] =3D (edid->mfg_id[1] & 0x1f) + '@'; > > + drm_edid_manufacturer_parse(edid, edid_vendor); > > =20 > > return !strncmp(edid_vendor, vendor, 3); > > } > > diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h > > index e3c404833115..e4f3f7f34d6a 100644 > > --- a/include/drm/drm_edid.h > > +++ b/include/drm/drm_edid.h > > @@ -466,6 +466,7 @@ struct edid *drm_get_edid_switcheroo(struct > > drm_connector *connector, > > struct i2c_adapter *adapter); > > struct edid *drm_edid_duplicate(const struct edid *edid); > > int drm_add_edid_modes(struct drm_connector *connector, struct > > edid *edid); > > +void drm_edid_manufacturer_parse(const struct edid *edid, char > > manufacturer[3]); > > =20 > > u8 drm_match_cea_mode(const struct drm_display_mode *to_match); > > enum hdmi_picture_aspect drm_get_cea_aspect_ratio(const u8 > > video_code); > > --=20 > > 2.19.1 > >=20 > > _______________________________________________ > > Intel-gfx mailing list > > Intel-gfx@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx --=-G2nqlZuFq5DcUz2ma964 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEVNG051EijGa0MiaQVenbO/mOWkkFAlvkn8oACgkQVenbO/mO Wkn7nAgAtpVowtDQtbe4+gdJ2NLpT2kb8jYP7CvJ+FV/uk3l52oTeoaWWe2tV9/B ICdU4k8jfmsaj4jhHJ9TX+p4e+eJZXOfRp6KoSdVYcT8WHFl/wpl2CDSO223xwri yyfF59ndIGz7qZanB3JZf95+5XS5PybLfwGI/7wyckCva9HKLIPnCCg/QwSTdjSj CqxoJWHeAcCXif2nHhalSVzGexsbyCb2gAFVvs+dBnz0JfaECs+zbV3FM0oiVXTl GBqdodKkl8A0TMpgMD02jWnZaq4s5XY7cySSn4l60pGyCXU2+BzEavbPh2j9Afqr nU+20qXrsEMtnTF0/DdfF58YPs+4gw== =0hhV -----END PGP SIGNATURE----- --=-G2nqlZuFq5DcUz2ma964-- --===============0427321183== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4Cg== --===============0427321183==--