linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] drm_bridge: register content protect property
@ 2022-10-12  4:20 Hsin-Yi Wang
  2022-10-17 13:48 ` Hsin-Yi Wang
  0 siblings, 1 reply; 5+ messages in thread
From: Hsin-Yi Wang @ 2022-10-12  4:20 UTC (permalink / raw)
  To: Douglas Anderson, Sean Paul
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Daniel Vetter, dri-devel, linux-kernel

Some bridges are able to update HDCP status from userspace request if
they support HDCP.

HDCP property is the same as other connector properties that need to be
created after the connecter is initialized and before the connector is
registered.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reported-by: kernel test robot <lkp@intel.com>
---
v2: Fix compile error when config is not set.
---
 drivers/gpu/drm/drm_bridge_connector.c | 3 +++
 include/drm/display/drm_hdcp_helper.h  | 8 ++++++++
 2 files changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c
index 1c7d936523df5..a3b9ef8dc3f0b 100644
--- a/drivers/gpu/drm/drm_bridge_connector.c
+++ b/drivers/gpu/drm/drm_bridge_connector.c
@@ -7,6 +7,7 @@
 #include <linux/module.h>
 #include <linux/slab.h>
 
+#include <drm/display/drm_hdcp_helper.h>
 #include <drm/drm_atomic_state_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_bridge_connector.h>
@@ -398,6 +399,8 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
 	if (panel_bridge)
 		drm_panel_bridge_set_orientation(connector, panel_bridge);
 
+	drm_connector_attach_content_protection_property(connector, true);
+
 	return connector;
 }
 EXPORT_SYMBOL_GPL(drm_bridge_connector_init);
diff --git a/include/drm/display/drm_hdcp_helper.h b/include/drm/display/drm_hdcp_helper.h
index 8aaf87bf27351..c65d9f06a2532 100644
--- a/include/drm/display/drm_hdcp_helper.h
+++ b/include/drm/display/drm_hdcp_helper.h
@@ -15,8 +15,16 @@ struct drm_device;
 struct drm_connector;
 
 int drm_hdcp_check_ksvs_revoked(struct drm_device *dev, u8 *ksvs, u32 ksv_count);
+#if defined(CONFIG_DRM_DISPLAY_HDCP_HELPER)
 int drm_connector_attach_content_protection_property(struct drm_connector *connector,
 						     bool hdcp_content_type);
+#else
+static inline int drm_connector_attach_content_protection_property(struct drm_connector *connector,
+								   bool hdcp_content_type)
+{
+	return 0;
+}
+#endif
 void drm_hdcp_update_content_protection(struct drm_connector *connector, u64 val);
 
 #endif
-- 
2.38.0.rc1.362.ged0d419d3c-goog


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] drm_bridge: register content protect property
  2022-10-12  4:20 [PATCH v2] drm_bridge: register content protect property Hsin-Yi Wang
@ 2022-10-17 13:48 ` Hsin-Yi Wang
  2022-10-18 18:25   ` Sean Paul
  0 siblings, 1 reply; 5+ messages in thread
From: Hsin-Yi Wang @ 2022-10-17 13:48 UTC (permalink / raw)
  To: Douglas Anderson, Sean Paul
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Daniel Vetter, dri-devel, linux-kernel

On Wed, Oct 12, 2022 at 12:20 PM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>
> Some bridges are able to update HDCP status from userspace request if
> they support HDCP.
>
> HDCP property is the same as other connector properties that need to be
> created after the connecter is initialized and before the connector is
> registered.
>
anx7625 is a user for this.


> Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> Reported-by: kernel test robot <lkp@intel.com>
> ---
> v2: Fix compile error when config is not set.
> ---
>  drivers/gpu/drm/drm_bridge_connector.c | 3 +++
>  include/drm/display/drm_hdcp_helper.h  | 8 ++++++++
>  2 files changed, 11 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c
> index 1c7d936523df5..a3b9ef8dc3f0b 100644
> --- a/drivers/gpu/drm/drm_bridge_connector.c
> +++ b/drivers/gpu/drm/drm_bridge_connector.c
> @@ -7,6 +7,7 @@
>  #include <linux/module.h>
>  #include <linux/slab.h>
>
> +#include <drm/display/drm_hdcp_helper.h>
>  #include <drm/drm_atomic_state_helper.h>
>  #include <drm/drm_bridge.h>
>  #include <drm/drm_bridge_connector.h>
> @@ -398,6 +399,8 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
>         if (panel_bridge)
>                 drm_panel_bridge_set_orientation(connector, panel_bridge);
>
> +       drm_connector_attach_content_protection_property(connector, true);
> +
>         return connector;
>  }
>  EXPORT_SYMBOL_GPL(drm_bridge_connector_init);
> diff --git a/include/drm/display/drm_hdcp_helper.h b/include/drm/display/drm_hdcp_helper.h
> index 8aaf87bf27351..c65d9f06a2532 100644
> --- a/include/drm/display/drm_hdcp_helper.h
> +++ b/include/drm/display/drm_hdcp_helper.h
> @@ -15,8 +15,16 @@ struct drm_device;
>  struct drm_connector;
>
>  int drm_hdcp_check_ksvs_revoked(struct drm_device *dev, u8 *ksvs, u32 ksv_count);
> +#if defined(CONFIG_DRM_DISPLAY_HDCP_HELPER)
>  int drm_connector_attach_content_protection_property(struct drm_connector *connector,
>                                                      bool hdcp_content_type);
> +#else
> +static inline int drm_connector_attach_content_protection_property(struct drm_connector *connector,
> +                                                                  bool hdcp_content_type)
> +{
> +       return 0;
> +}
> +#endif
>  void drm_hdcp_update_content_protection(struct drm_connector *connector, u64 val);
>
>  #endif
> --
> 2.38.0.rc1.362.ged0d419d3c-goog
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] drm_bridge: register content protect property
  2022-10-17 13:48 ` Hsin-Yi Wang
@ 2022-10-18 18:25   ` Sean Paul
  2022-10-19  6:25     ` Hsin-Yi Wang
  2022-11-02 11:19     ` Hsin-Yi Wang
  0 siblings, 2 replies; 5+ messages in thread
From: Sean Paul @ 2022-10-18 18:25 UTC (permalink / raw)
  To: Hsin-Yi Wang
  Cc: Douglas Anderson, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Daniel Vetter, dri-devel,
	Linux Kernel Mailing List

On Mon, Oct 17, 2022 at 9:49 AM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>
> On Wed, Oct 12, 2022 at 12:20 PM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
> >
> > Some bridges are able to update HDCP status from userspace request if
> > they support HDCP.
> >
> > HDCP property is the same as other connector properties that need to be
> > created after the connecter is initialized and before the connector is
> > registered.
> >
> anx7625 is a user for this.

I feel like we should not unconditionally attach this property for
bridges, this should be done in the driver which supports it IMO.

Sean

>
>
> > Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> > Reported-by: kernel test robot <lkp@intel.com>
> > ---
> > v2: Fix compile error when config is not set.
> > ---
> >  drivers/gpu/drm/drm_bridge_connector.c | 3 +++
> >  include/drm/display/drm_hdcp_helper.h  | 8 ++++++++
> >  2 files changed, 11 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c
> > index 1c7d936523df5..a3b9ef8dc3f0b 100644
> > --- a/drivers/gpu/drm/drm_bridge_connector.c
> > +++ b/drivers/gpu/drm/drm_bridge_connector.c
> > @@ -7,6 +7,7 @@
> >  #include <linux/module.h>
> >  #include <linux/slab.h>
> >
> > +#include <drm/display/drm_hdcp_helper.h>
> >  #include <drm/drm_atomic_state_helper.h>
> >  #include <drm/drm_bridge.h>
> >  #include <drm/drm_bridge_connector.h>
> > @@ -398,6 +399,8 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
> >         if (panel_bridge)
> >                 drm_panel_bridge_set_orientation(connector, panel_bridge);
> >
> > +       drm_connector_attach_content_protection_property(connector, true);
> > +
> >         return connector;
> >  }
> >  EXPORT_SYMBOL_GPL(drm_bridge_connector_init);
> > diff --git a/include/drm/display/drm_hdcp_helper.h b/include/drm/display/drm_hdcp_helper.h
> > index 8aaf87bf27351..c65d9f06a2532 100644
> > --- a/include/drm/display/drm_hdcp_helper.h
> > +++ b/include/drm/display/drm_hdcp_helper.h
> > @@ -15,8 +15,16 @@ struct drm_device;
> >  struct drm_connector;
> >
> >  int drm_hdcp_check_ksvs_revoked(struct drm_device *dev, u8 *ksvs, u32 ksv_count);
> > +#if defined(CONFIG_DRM_DISPLAY_HDCP_HELPER)
> >  int drm_connector_attach_content_protection_property(struct drm_connector *connector,
> >                                                      bool hdcp_content_type);
> > +#else
> > +static inline int drm_connector_attach_content_protection_property(struct drm_connector *connector,
> > +                                                                  bool hdcp_content_type)
> > +{
> > +       return 0;
> > +}
> > +#endif
> >  void drm_hdcp_update_content_protection(struct drm_connector *connector, u64 val);
> >
> >  #endif
> > --
> > 2.38.0.rc1.362.ged0d419d3c-goog
> >

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] drm_bridge: register content protect property
  2022-10-18 18:25   ` Sean Paul
@ 2022-10-19  6:25     ` Hsin-Yi Wang
  2022-11-02 11:19     ` Hsin-Yi Wang
  1 sibling, 0 replies; 5+ messages in thread
From: Hsin-Yi Wang @ 2022-10-19  6:25 UTC (permalink / raw)
  To: Sean Paul
  Cc: Douglas Anderson, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Daniel Vetter, dri-devel,
	Linux Kernel Mailing List

On Wed, Oct 19, 2022 at 2:26 AM Sean Paul <seanpaul@chromium.org> wrote:
>
> On Mon, Oct 17, 2022 at 9:49 AM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
> >
> > On Wed, Oct 12, 2022 at 12:20 PM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
> > >
> > > Some bridges are able to update HDCP status from userspace request if
> > > they support HDCP.
> > >
> > > HDCP property is the same as other connector properties that need to be
> > > created after the connecter is initialized and before the connector is
> > > registered.
> > >
> > anx7625 is a user for this.
>
> I feel like we should not unconditionally attach this property for
> bridges, this should be done in the driver which supports it IMO.
>
I sent another version to register the property in drm driver:
https://lore.kernel.org/lkml/20221019061936.3599965-1-hsinyi@chromium.org/T/#u

Ideally it should be registered by the bridge driver. But some bridge
drivers have already changed to DRM_BRIDGE_ATTACH_NO_CONNECTOR, so
they can't get a connector during the attach stage (or any time before
the connector is registered). Is it acceptable that drm driver help
register the property if CONFIG_DRM_DISPLAY_HDCP_HELPER is defined?

Thanks

> Sean
>
> >
> >
> > > Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> > > Reported-by: kernel test robot <lkp@intel.com>
> > > ---
> > > v2: Fix compile error when config is not set.
> > > ---
> > >  drivers/gpu/drm/drm_bridge_connector.c | 3 +++
> > >  include/drm/display/drm_hdcp_helper.h  | 8 ++++++++
> > >  2 files changed, 11 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c
> > > index 1c7d936523df5..a3b9ef8dc3f0b 100644
> > > --- a/drivers/gpu/drm/drm_bridge_connector.c
> > > +++ b/drivers/gpu/drm/drm_bridge_connector.c
> > > @@ -7,6 +7,7 @@
> > >  #include <linux/module.h>
> > >  #include <linux/slab.h>
> > >
> > > +#include <drm/display/drm_hdcp_helper.h>
> > >  #include <drm/drm_atomic_state_helper.h>
> > >  #include <drm/drm_bridge.h>
> > >  #include <drm/drm_bridge_connector.h>
> > > @@ -398,6 +399,8 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
> > >         if (panel_bridge)
> > >                 drm_panel_bridge_set_orientation(connector, panel_bridge);
> > >
> > > +       drm_connector_attach_content_protection_property(connector, true);
> > > +
> > >         return connector;
> > >  }
> > >  EXPORT_SYMBOL_GPL(drm_bridge_connector_init);
> > > diff --git a/include/drm/display/drm_hdcp_helper.h b/include/drm/display/drm_hdcp_helper.h
> > > index 8aaf87bf27351..c65d9f06a2532 100644
> > > --- a/include/drm/display/drm_hdcp_helper.h
> > > +++ b/include/drm/display/drm_hdcp_helper.h
> > > @@ -15,8 +15,16 @@ struct drm_device;
> > >  struct drm_connector;
> > >
> > >  int drm_hdcp_check_ksvs_revoked(struct drm_device *dev, u8 *ksvs, u32 ksv_count);
> > > +#if defined(CONFIG_DRM_DISPLAY_HDCP_HELPER)
> > >  int drm_connector_attach_content_protection_property(struct drm_connector *connector,
> > >                                                      bool hdcp_content_type);
> > > +#else
> > > +static inline int drm_connector_attach_content_protection_property(struct drm_connector *connector,
> > > +                                                                  bool hdcp_content_type)
> > > +{
> > > +       return 0;
> > > +}
> > > +#endif
> > >  void drm_hdcp_update_content_protection(struct drm_connector *connector, u64 val);
> > >
> > >  #endif
> > > --
> > > 2.38.0.rc1.362.ged0d419d3c-goog
> > >

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] drm_bridge: register content protect property
  2022-10-18 18:25   ` Sean Paul
  2022-10-19  6:25     ` Hsin-Yi Wang
@ 2022-11-02 11:19     ` Hsin-Yi Wang
  1 sibling, 0 replies; 5+ messages in thread
From: Hsin-Yi Wang @ 2022-11-02 11:19 UTC (permalink / raw)
  To: Sean Paul
  Cc: Douglas Anderson, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Daniel Vetter, dri-devel,
	Linux Kernel Mailing List

On Wed, Oct 19, 2022 at 2:26 AM Sean Paul <seanpaul@chromium.org> wrote:
>
> On Mon, Oct 17, 2022 at 9:49 AM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
> >
> > On Wed, Oct 12, 2022 at 12:20 PM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
> > >
> > > Some bridges are able to update HDCP status from userspace request if
> > > they support HDCP.
> > >
> > > HDCP property is the same as other connector properties that need to be
> > > created after the connecter is initialized and before the connector is
> > > registered.
> > >
> > anx7625 is a user for this.
>
> I feel like we should not unconditionally attach this property for
> bridges, this should be done in the driver which supports it IMO.
>
> Sean
>

hi Sean,

v3 is sent: connector will check if any bridge in that chain supports
hdcp by looking up a variable in the bridge:
https://patchwork.kernel.org/project/dri-devel/patch/20221102111148.1810314-1-hsinyi@chromium.org/



> >
> >
> > > Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> > > Reported-by: kernel test robot <lkp@intel.com>
> > > ---
> > > v2: Fix compile error when config is not set.
> > > ---
> > >  drivers/gpu/drm/drm_bridge_connector.c | 3 +++
> > >  include/drm/display/drm_hdcp_helper.h  | 8 ++++++++
> > >  2 files changed, 11 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c
> > > index 1c7d936523df5..a3b9ef8dc3f0b 100644
> > > --- a/drivers/gpu/drm/drm_bridge_connector.c
> > > +++ b/drivers/gpu/drm/drm_bridge_connector.c
> > > @@ -7,6 +7,7 @@
> > >  #include <linux/module.h>
> > >  #include <linux/slab.h>
> > >
> > > +#include <drm/display/drm_hdcp_helper.h>
> > >  #include <drm/drm_atomic_state_helper.h>
> > >  #include <drm/drm_bridge.h>
> > >  #include <drm/drm_bridge_connector.h>
> > > @@ -398,6 +399,8 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
> > >         if (panel_bridge)
> > >                 drm_panel_bridge_set_orientation(connector, panel_bridge);
> > >
> > > +       drm_connector_attach_content_protection_property(connector, true);
> > > +
> > >         return connector;
> > >  }
> > >  EXPORT_SYMBOL_GPL(drm_bridge_connector_init);
> > > diff --git a/include/drm/display/drm_hdcp_helper.h b/include/drm/display/drm_hdcp_helper.h
> > > index 8aaf87bf27351..c65d9f06a2532 100644
> > > --- a/include/drm/display/drm_hdcp_helper.h
> > > +++ b/include/drm/display/drm_hdcp_helper.h
> > > @@ -15,8 +15,16 @@ struct drm_device;
> > >  struct drm_connector;
> > >
> > >  int drm_hdcp_check_ksvs_revoked(struct drm_device *dev, u8 *ksvs, u32 ksv_count);
> > > +#if defined(CONFIG_DRM_DISPLAY_HDCP_HELPER)
> > >  int drm_connector_attach_content_protection_property(struct drm_connector *connector,
> > >                                                      bool hdcp_content_type);
> > > +#else
> > > +static inline int drm_connector_attach_content_protection_property(struct drm_connector *connector,
> > > +                                                                  bool hdcp_content_type)
> > > +{
> > > +       return 0;
> > > +}
> > > +#endif
> > >  void drm_hdcp_update_content_protection(struct drm_connector *connector, u64 val);
> > >
> > >  #endif
> > > --
> > > 2.38.0.rc1.362.ged0d419d3c-goog
> > >

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-11-02 11:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-12  4:20 [PATCH v2] drm_bridge: register content protect property Hsin-Yi Wang
2022-10-17 13:48 ` Hsin-Yi Wang
2022-10-18 18:25   ` Sean Paul
2022-10-19  6:25     ` Hsin-Yi Wang
2022-11-02 11:19     ` Hsin-Yi Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).