OSDN Git Service

drm/msm: add HDCP_VERSION property for connector
authorAbhinav Kumar <abhinavk@codeaurora.org>
Wed, 20 Sep 2017 03:37:31 +0000 (20:37 -0700)
committerAbhinav Kumar <abhinavk@codeaurora.org>
Tue, 26 Sep 2017 02:42:30 +0000 (19:42 -0700)
Expose a HDCP_VERSION property for the connector.
This property is used by the userspace to decide the
proper handling of secure streams based on HDCP version
of the sink.

This also guarantees that sinks do not receive
secure content higher than their capability.

Change-Id: Ia4ada2f26a5cde088b24c8792c10c9f9097602b1
Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
drivers/gpu/drm/msm/hdmi-staging/sde_hdmi.c
drivers/gpu/drm/msm/hdmi-staging/sde_hdmi.h
drivers/gpu/drm/msm/hdmi-staging/sde_hdmi_bridge.c
drivers/gpu/drm/msm/hdmi-staging/sde_hdmi_util.h
drivers/gpu/drm/msm/msm_drv.h
drivers/gpu/drm/msm/sde/sde_connector.c

index c98f451..fa111d5 100644 (file)
@@ -2153,6 +2153,8 @@ int sde_hdmi_get_property(struct drm_connector *connector,
        mutex_lock(&hdmi_display->display_lock);
        if (property_index == CONNECTOR_PROP_PLL_ENABLE)
                *value = hdmi_display->pll_update_enable ? 1 : 0;
+       if (property_index == CONNECTOR_PROP_HDCP_VERSION)
+               *value = hdmi_display->sink_hdcp_ver;
        mutex_unlock(&hdmi_display->display_lock);
 
        return rc;
index 672a9f1..865998c 100644 (file)
@@ -108,14 +108,34 @@ enum hdmi_tx_feature_type {
  * @mode:             Current display mode.
  * @connected:        If HDMI display is connected.
  * @is_tpg_enabled:   TPG state.
+ * @hdmi_tx_version:  HDMI TX version
+ * @hdmi_tx_major_version: HDMI TX major version
+ * @max_pclk_khz: Max pixel clock supported
+ * @hdcp1_use_sw_keys: If HDCP1 engine uses SW keys
+ * @hdcp14_present: If the sink supports HDCP 1.4
+ * @hdcp22_present: If the sink supports HDCP 2.2
+ * @hdcp_status: Current HDCP status
+ * @sink_hdcp_ver: HDCP version of the sink
+ * @enc_lvl: Current encryption level
+ * @curr_hdr_state: Current HDR state of the HDMI connector
+ * @auth_state: Current authentication state of HDCP
+ * @sink_hdcp22_support: If the sink supports HDCP 2.2
+ * @src_hdcp22_support: If the source supports HDCP 2.2
+ * @hdcp_data: Call back data registered by the client with HDCP lib
+ * @hdcp_feat_data: Handle to HDCP feature data
+ * @hdcp_ops: Function ops registered by the client with the HDCP lib
+ * @ddc_ctrl: Handle to HDMI DDC Controller
  * @hpd_work:         HPD work structure.
  * @codec_ready:      If audio codec is ready.
  * @client_notify_pending: If there is client notification pending.
  * @irq_domain:       IRQ domain structure.
+ * @notifier:         CEC notifider to convey physical address information.
  * @pll_update_enable: if it's allowed to update HDMI PLL ppm.
  * @dc_enable:        If deep color is enabled. Only DC_30 so far.
  * @dc_feature_supported: If deep color feature is supported.
- * @notifier:         CEC notifider to convey physical address information.
+ * @bt2020_colorimetry: If BT2020 colorimetry is supported by sink
+ * @hdcp_cb_work: Callback function for HDCP
+ * @io: Handle to IO base addresses for HDMI
  * @root:             Debug fs root entry.
  */
 struct sde_hdmi {
@@ -146,6 +166,7 @@ struct sde_hdmi {
        u32 hdcp14_present;
        u32 hdcp22_present;
        u8 hdcp_status;
+       u8 sink_hdcp_ver;
        u32 enc_lvl;
        u8 curr_hdr_state;
        bool auth_state;
index e6b6d15..3c470ca 100644 (file)
@@ -511,6 +511,11 @@ static void sde_hdmi_update_hdcp_info(struct drm_connector *connector)
                }
        }
 
+       if (display->sink_hdcp22_support)
+               display->sink_hdcp_ver = SDE_HDMI_HDCP_22;
+       else
+               display->sink_hdcp_ver = SDE_HDMI_HDCP_14;
+
        /* update internal data about hdcp */
        display->hdcp_data = fd;
        display->hdcp_ops = ops;
@@ -543,6 +548,7 @@ static void _sde_hdmi_bridge_disable(struct drm_bridge *bridge)
        mutex_lock(&display->display_lock);
 
        display->pll_update_enable = false;
+       display->sink_hdcp_ver = SDE_HDMI_HDCP_NONE;
 
        mutex_unlock(&display->display_lock);
 }
index 3c6b0f1..421bdf7 100644 (file)
 #define SDE_HDMI_USE_EXTENDED_COLORIMETRY 0x3
 #define SDE_HDMI_BT2020_COLORIMETRY 0x6
 
+#define SDE_HDMI_HDCP_22 0x22
+#define SDE_HDMI_HDCP_14 0x14
+#define SDE_HDMI_HDCP_NONE 0x0
+
 /*
  * Bits 1:0 in HDMI_HW_DDC_CTRL that dictate how the HDCP 2.2 RxStatus will be
  * read by the hardware
index ae3a930..25dc5f9 100644 (file)
@@ -158,6 +158,7 @@ enum msm_mdp_conn_property {
        CONNECTOR_PROP_DST_H,
        CONNECTOR_PROP_PLL_DELTA,
        CONNECTOR_PROP_PLL_ENABLE,
+       CONNECTOR_PROP_HDCP_VERSION,
 
        /* enum/bitmask properties */
        CONNECTOR_PROP_TOPOLOGY_NAME,
index 2ca9167..90a6b19 100644 (file)
@@ -933,6 +933,10 @@ struct drm_connector *sde_connector_init(struct drm_device *dev,
                        "PLL_ENABLE", 0x0, 0, 1, 0,
                        CONNECTOR_PROP_PLL_ENABLE);
 
+       msm_property_install_volatile_range(&c_conn->property_info,
+                       "HDCP_VERSION", 0x0, 0, U8_MAX, 0,
+                       CONNECTOR_PROP_HDCP_VERSION);
+
        /* enum/bitmask properties */
        msm_property_install_enum(&c_conn->property_info, "topology_name",
                        DRM_MODE_PROP_IMMUTABLE, 0, e_topology_name,