[PATCH v9 1/6] drm: Add Content protection type property

Pekka Paalanen ppaalanen at gmail.com
Wed Jul 10 08:16:24 UTC 2019


On Tue, 9 Jul 2019 18:17:59 +0530
Ramalingam C <ramalingam.c at intel.com> wrote:

> On 2019-07-09 at 17:31:10 +0300, Pekka Paalanen wrote:
> > On Mon,  8 Jul 2019 16:51:11 +0530
> > Ramalingam C <ramalingam.c at intel.com> wrote:
> >   
> > > This patch adds a DRM ENUM property to the selected connectors.
> > > This property is used for mentioning the protected content's type
> > > from userspace to kernel HDCP authentication.
> > > 
> > > Type of the stream is decided by the protected content providers.
> > > Type 0 content can be rendered on any HDCP protected display wires.
> > > But Type 1 content can be rendered only on HDCP2.2 protected paths.
> > > 
> > > So when a userspace sets this property to Type 1 and starts the HDCP
> > > enable, kernel will honour it only if HDCP2.2 authentication is through
> > > for type 1. Else HDCP enable will be failed.
> > > 
> > > Need ACK for this new conenctor property from userspace consumer.
> > > 
> > > v2:
> > >   cp_content_type is replaced with content_protection_type [daniel]
> > >   check at atomic_set_property is removed [Maarten]
> > > v3:
> > >   %s/content_protection_type/hdcp_content_type [Pekka]
> > > v4:
> > >   property is created for the first requested connector and then reused.
> > > 	[Danvet]
> > > v5:
> > >   kernel doc nits addressed [Daniel]
> > >   Rebased as part of patch reordering.
> > > v6:
> > >   Kernel docs are modified [pekka]
> > > v7:
> > >   More details in Kernel docs. [pekka]
> > > 
> > > Signed-off-by: Ramalingam C <ramalingam.c at intel.com>
> > > Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> > > ---
> > >  drivers/gpu/drm/drm_atomic_uapi.c         |  4 +++
> > >  drivers/gpu/drm/drm_connector.c           | 39 +++++++++++++++++++++++
> > >  drivers/gpu/drm/drm_hdcp.c                | 36 ++++++++++++++++++++-
> > >  drivers/gpu/drm/i915/display/intel_hdcp.c |  4 ++-
> > >  include/drm/drm_connector.h               |  7 ++++
> > >  include/drm/drm_hdcp.h                    |  2 +-
> > >  include/drm/drm_mode_config.h             |  6 ++++
> > >  include/uapi/drm/drm_mode.h               |  4 +++
> > >  8 files changed, 99 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
> > > index abe38bdf85ae..19ae119f1a5d 100644
> > > --- a/drivers/gpu/drm/drm_atomic_uapi.c
> > > +++ b/drivers/gpu/drm/drm_atomic_uapi.c
> > > @@ -747,6 +747,8 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector,
> > >  			return -EINVAL;
> > >  		}
> > >  		state->content_protection = val;
> > > +	} else if (property == config->hdcp_content_type_property) {
> > > +		state->hdcp_content_type = val;
> > >  	} else if (property == connector->colorspace_property) {
> > >  		state->colorspace = val;
> > >  	} else if (property == config->writeback_fb_id_property) {
> > > @@ -831,6 +833,8 @@ drm_atomic_connector_get_property(struct drm_connector *connector,
> > >  			state->hdr_output_metadata->base.id : 0;
> > >  	} else if (property == config->content_protection_property) {
> > >  		*val = state->content_protection;
> > > +	} else if (property == config->hdcp_content_type_property) {
> > > +		*val = state->hdcp_content_type;
> > >  	} else if (property == config->writeback_fb_id_property) {
> > >  		/* Writeback framebuffer is one-shot, write and forget */
> > >  		*val = 0;
> > > diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> > > index 068d4b05f1be..732f6645643d 100644
> > > --- a/drivers/gpu/drm/drm_connector.c
> > > +++ b/drivers/gpu/drm/drm_connector.c
> > > @@ -952,6 +952,45 @@ static const struct drm_prop_enum_list hdmi_colorspaces[] = {
> > >   *	  is no longer protected and userspace should take appropriate action
> > >   *	  (whatever that might be).
> > >   *
> > > + * HDCP Content Type:
> > > + *	This Enum property is used by the userspace to declare the content type
> > > + *	of the display stream, to kernel. Here display stream stands for any
> > > + *	display content that userspace intended to render with HDCP encryption.  
> > 
> > Hi,
> > 
> > I'd suggest s/render with/display through/.
> > 
> > As a gfx dev, rendering is something quite different to me.  
> Ok.
> >   
> > > + *
> > > + *	Content Type of a stream is decided by the owner of the stream, as
> > > + *	"HDCP Type0" or "HDCP Type1".
> > > + *
> > > + *	The value of the property can be one the below:  
> > 
> > *one of the below  
> Sure.
> >   
> > > + *	  - "HDCP Type0": DRM_MODE_HDCP_CONTENT_TYPE0 = 0
> > > + *	  - "HDCP Type1": DRM_MODE_HDCP_CONTENT_TYPE1 = 1
> > > + *
> > > + *	When kernel starts the HDCP authentication upon the "DESIRED" state of
> > > + *	the "Content Protection", it refers the "HDCP Content Type" property
> > > + *	state. And perform the HDCP authentication with the display sink for
> > > + *	the content type mentioned by "HDCP Content Type".  
> > 
> > How about:
> > 
> > 	When kernel starts the HDCP authentication (see "Content Protection"
> > 	for details), it uses the content type in "HDCP Content Type"
> > 	for performing the HDCP authentication with the display sink.  
> less confusing :) Thanks.
> >   
> > > + *
> > > + *	Stream classified as HDCP Type0 can be transmitted on a link which is
> > > + *	encrypted with HDCP 1.4 or higher versions of HDCP(i.e HDCP2.2
> > > + *	and more).  
> > 
> > This is where I get confused, see my earlier email from today on the
> > previous revision of this patch series. Is it necessary to talk about
> > HDCP versions here? The only thing that matters for UAPI is the content
> > type, right?
> > 
> > Previously you said that the kernel will not use Type1 if userspace
> > only asked for Type0, but to me this text reads as quite the opposite.  
> Simple. HDCP2.2 itself support both Type 0 and Type 1. where as HDCP1.4
> by default supports the Type 0 and doesn't support the Type 1.
> 
> I guess you are getting confused by assigning the type to the versions.

Hi,

yes, I am indeed.

Is the HDCP version ever exposed to userspace in any way?

If it is, then explaining how the types relate to the versions may well
be useful. But if userspace cannot even know what HDCP version is being
used or available, explaining it in the UAPI doc seems to just confuse
the reader.

If the reader is interested in HDCP versions, I suppose it is not too
hard to figure out how the types relate to versions on their own,
right? Just search for the definitions of the types in any spec that
defines them.

> >   
> > > + *
> > > + *	Streams classified as HDCP Type1 can be transmitted on a link which is
> > > + *	encrypted only with HDCP 2.2. In future, HDCP versions >2.2 also might
> > > + *	support Type1 based on their spec.
> > > + *
> > > + *	HDCP2.2 authentication protocol itself takes the "Content Type" as a
> > > + *	parameter, which is a input for the DP HDCP2.2 encryption algo.
> > > + *
> > > + *	Note that the HDCP Content Type property is introduced at HDCP 2.2, and
> > > + *	defaults to type 0. It is only exposed by drivers supporting HDCP 2.2.
> > > + *	Based on how next versions of HDCP specs are defined content Type could
> > > + *	be used for higher versions too.  
> > 
> > Ok, userspace does not have to cope with a "HDCP Content Type" property
> > that is missing the enum value Type1. I think the Weston patch would
> > attempt something silly or misbehave if Type1 value was ever missing.
> > Not having the whole property is fine, of course.  
>  If the Type1 is not supported then there is no need for the "HDCP
>  Content Type" property itself. Thats why when a driver has the support
>  for Type1( as of now HDCP2.2) only then "HDCP Content Type" will be
>  exposed. So weston is fine at its current state.

Yes. I'm just saying that if the kernel ever exposes "HDCP Content
Type" property without the Type1 value (because it may have e.g. Type3
value from the future but does not support Type1), then it will break
userspace.

Adding new enum values is not a problem for the Weston code I have been
reviewing. It simply won't use values it doesn't know, resetting
unknown values to some value it does know.

Setting the rules on both whether enum values can be removed and added
is important for reviewing the userspace, because those need to be
explicitly taken care of in userspace code.

(It's not actually that different from reviewing Wayland protocol
extensions.)


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20190710/d882f904/attachment.sig>


More information about the dri-devel mailing list