From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH v2 3/3] drm/edid: Implement SCDC Read Request capability detection Date: Mon, 5 Dec 2016 12:14:56 +0100 Message-ID: <20161205111456.GD19891@ulmo.ba.sec> References: <20161202192415.16110-1-thierry.reding@gmail.com> <20161202192415.16110-3-thierry.reding@gmail.com> <2c9513c5-2b71-e786-f202-eb1acc027578@synopsys.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1499342381==" Return-path: Received: from mail-pg0-x244.google.com (mail-pg0-x244.google.com [IPv6:2607:f8b0:400e:c05::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9757C6E1E7 for ; Mon, 5 Dec 2016 11:15:01 +0000 (UTC) Received: by mail-pg0-x244.google.com with SMTP id x23so16174992pgx.3 for ; Mon, 05 Dec 2016 03:15:01 -0800 (PST) In-Reply-To: <2c9513c5-2b71-e786-f202-eb1acc027578@synopsys.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Jose Abreu Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1499342381== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="sgneBHv3152wZ8jf" Content-Disposition: inline --sgneBHv3152wZ8jf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 05, 2016 at 11:06:15AM +0000, Jose Abreu wrote: > Hi Thierry, >=20 >=20 > Do you think while you are at it you could implement a > set_scrambling() callback? It should be pretty straight forward: > you read the SCDC_TMDS_CONFIG reg, do a mask, and then write it > again. >=20 >=20 > I think this is an important feature that we should have. Yeah, agreed. I was actually thinking about going one step further and provide more of the polling functionality as a helper. Even if we have accessors that wrap the low-level functionality, most drivers would still have to provide their own delayed workqueue to deal with sinks (or sources) that don't support read requests. Having this in standard helpers would help reduce the boilerplate a lot further. Does your hardware by any chance support read requests on SCDC? It'd be interesting to see how that works in practice. Unfortunately Tegra does not seem to support it. Thierry > On 02-12-2016 19:24, Thierry Reding wrote: > > From: Thierry Reding > > > > Sinks that support SCDC can optionally have the capability to initiate > > read requests, which are a mechanism by which a sink can notify its > > source that it should read the Update Flags. If either the sink or the > > source are not Read Request capable, polling of the Update Flags shall > > be employed. > > > > Signed-off-by: Thierry Reding > > --- > > Changes in v2: > > - new patch > > > > drivers/gpu/drm/drm_edid.c | 36 ++++++++++++++++++++++++++++++++++++ > > include/drm/drm_edid.h | 1 + > > 2 files changed, 37 insertions(+) > > > > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c > > index 369961597ee5..8211cce3e09e 100644 > > --- a/drivers/gpu/drm/drm_edid.c > > +++ b/drivers/gpu/drm/drm_edid.c > > @@ -3736,6 +3736,42 @@ bool drm_detect_hdmi_scdc(struct edid *edid) > > EXPORT_SYMBOL(drm_detect_hdmi_scdc); > > =20 > > /** > > + * drm_detect_hdmi_scdc_rr_capable - detect whether an HDMI sink is ca= pable of > > + * initiating an SCDC Read Request > > + * @edid: sink EDID information > > + * > > + * Parse the CEA extension according to CEA-861-B to find an HF-VSDB as > > + * defined in HDMI 2.0, section 10.3.2 "HDMI Forum Vendor Specific Data > > + * Block" and checks if the RR_Capable bit (bit 6 of byte 6) is set. > > + * > > + * Returns: > > + * True if the sink is capable of initiating an SCDC Read Request, fal= se > > + * otherwise. > > + */ > > +bool drm_detect_hdmi_scdc_rr_capable(struct edid *edid) > > +{ > > + unsigned int start, end, i; > > + const u8 *cea; > > + > > + cea =3D drm_find_cea_extension(edid); > > + if (!cea) > > + return false; > > + > > + if (cea_db_offsets(cea, &start, &end)) > > + return false; > > + > > + for_each_cea_db(cea, i, start, end) { > > + if (cea_db_is_hdmi_forum_vsdb(&cea[i])) { > > + if (cea[i + 6] & 0x40) > > + return true; > > + } > > + } > > + > > + return false; > > +} > > +EXPORT_SYMBOL(drm_detect_hdmi_scdc_rr_capable); > > + > > +/** > > * drm_detect_monitor_audio - check monitor audio capability > > * @edid: EDID block to scan > > * > > diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h > > index 7ea7e90846d8..d1c29586035e 100644 > > --- a/include/drm/drm_edid.h > > +++ b/include/drm/drm_edid.h > > @@ -441,6 +441,7 @@ 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); > > bool drm_detect_hdmi_monitor(struct edid *edid); > > bool drm_detect_hdmi_scdc(struct edid *edid); > > +bool drm_detect_hdmi_scdc_rr_capable(struct edid *edid); > > bool drm_detect_monitor_audio(struct edid *edid); > > bool drm_rgb_quant_range_selectable(struct edid *edid); > > int drm_add_modes_noedid(struct drm_connector *connector, >=20 --sgneBHv3152wZ8jf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAABCAAGBQJYRUwwAAoJEN0jrNd/PrOh1WkP/3grujLGGodRUWMNqOwCANg6 9ZHgWA4xRSVBamL+BayLzyy1bhYdlBRtDftZwJtY0X4xYepABUWJpy51I02UOBIa hU5Fc6AUOqmSDsq66mzJWENtpC0MgU8vdcOKCp8zGqM8CgZy9dt6M7YP4gQSCk65 xLhSM7ZkaMKrZ9AzpdQccOtkfnsB3eNCzISPqrxYXbZYIYEPbNPOASVfD589mvcX 3fhSjLgRmLcm2R3qgbjXscTGrwjhOtRG5HSlbKAneSsJynVuWQSsizxihz0sLRha GjEBwFV13cVWHVhCwyFnamun8JZRHB4/PgwQ468KDxdIXzAWWwLxT4KcwIlK9GT3 itok+Hqu9KoxOxuNj+Zf+YX2R4Lnfc/dTT+evS+Zy/K+TQuOs1y2q22VoI6zquK3 UDJfgGcQASDzFimmW3biGIuO+RHeU+V3IvXqlXPygDQIk0qXJ95IZ7enyUUztuS+ emk4l1qxiDgbEvl0ayrjLu7y27ByNmqse0plmJHEQFkP9igSHPqUJCmE+XoYe+g0 7fuhmhSG0M57dQOQZ1HBOG91AYkXpZ4DpIUNO8nA4O70HiMUHZ2VEsNGc4k2OmqW gFaZ7wS3+omk+DWaVdg+a2w4SNQu81lzEWLYPaCCpVeNeRHMsVfJSYAaVeiZlPs8 KG9ZS5Gs3DEhTPdrXcMQ =H59T -----END PGP SIGNATURE----- --sgneBHv3152wZ8jf-- --===============1499342381== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1499342381==--