OSDN Git Service

Merge "drm/msm: add HDCP 2.2 module for DRM HDMI"
authorLinux Build Service Account <lnxbuild@quicinc.com>
Sun, 18 Jun 2017 16:47:20 +0000 (09:47 -0700)
committerGerrit - the friendly Code Review server <code-review@localhost>
Sun, 18 Jun 2017 16:47:20 +0000 (09:47 -0700)
1  2 
arch/arm/boot/dts/qcom/msm8998.dtsi
drivers/gpu/drm/msm/Makefile
drivers/gpu/drm/msm/hdmi-staging/sde_hdmi.c

                qcom,xprt-linkid = <1>;
                qcom,xprt-version = <1>;
                qcom,fragmented-data;
 +              qcom,dynamic-wakeup-source;
        };
  
        qcom,spcom {
                hyplog-size-offset = <0x414>;    /* 0x066BFB34 */
        };
  
+       qcom_msmhdcp: qcom,msm_hdcp {
+               compatible = "qcom,msm-hdcp";
+       };
        qcom_crypto: qcrypto@1DE0000 {
                compatible = "qcom,qcrypto";
                reg = <0x1DE0000 0x20000>,
@@@ -107,6 -107,7 +107,7 @@@ msm_drm-$(CONFIG_DRM_SDE_HDMI) += 
        hdmi-staging/sde_hdmi.o \
        hdmi-staging/sde_hdmi_bridge.o \
        hdmi-staging/sde_hdmi_audio.o \
+       hdmi-staging/sde_hdmi_hdcp2p2.o \
  
  msm_drm-$(CONFIG_DRM_MSM_DSI_PLL) += dsi/pll/dsi_pll.o \
                                dsi/pll/dsi_pll_28nm.o
@@@ -147,7 -148,6 +148,7 @@@ msm_drm-$(CONFIG_DRM_MSM) += 
        msm_rd.o \
        msm_ringbuffer.o \
        msm_prop.o \
 -      msm_snapshot.o
 +      msm_snapshot.o \
 +      msm_submitqueue.o
  
  obj-$(CONFIG_DRM_MSM) += msm_drm.o
@@@ -51,9 -51,6 +51,9 @@@ static LIST_HEAD(sde_hdmi_list)
  #define HDMI_SCDC_ERR_DET_2_H           0x55
  #define HDMI_SCDC_ERR_DET_CHECKSUM      0x56
  
 +#define HDMI_DISPLAY_MAX_WIDTH          4096
 +#define HDMI_DISPLAY_MAX_HEIGHT         2160
 +
  static const struct of_device_id sde_hdmi_dt_match[] = {
        {.compatible = "qcom,hdmi-display"},
        {}
@@@ -1039,6 -1036,7 +1039,7 @@@ static void _sde_hdmi_cec_update_phys_a
  static void _sde_hdmi_init_ddc(struct sde_hdmi *display, struct hdmi *hdmi)
  {
        display->ddc_ctrl.io = &display->io[HDMI_TX_CORE_IO];
+       init_completion(&display->ddc_ctrl.rx_status_done);
  }
  
  static void _sde_hdmi_map_regs(struct sde_hdmi *display, struct hdmi *hdmi)
@@@ -1127,32 -1125,39 +1128,39 @@@ static void _sde_hdmi_cec_irq(struct sd
  
  static irqreturn_t _sde_hdmi_irq(int irq, void *dev_id)
  {
-       struct sde_hdmi *sde_hdmi = dev_id;
+       struct sde_hdmi *display = dev_id;
        struct hdmi *hdmi;
  
-       if (!sde_hdmi || !sde_hdmi->ctrl.ctrl) {
-               SDE_ERROR("sde_hdmi=%p or hdmi is NULL\n", sde_hdmi);
+       if (!display || !display->ctrl.ctrl) {
+               SDE_ERROR("sde_hdmi=%pK or hdmi is NULL\n", display);
                return IRQ_NONE;
        }
-       hdmi = sde_hdmi->ctrl.ctrl;
+       hdmi = display->ctrl.ctrl;
        /* Process HPD: */
-       _sde_hdmi_connector_irq(sde_hdmi);
+       _sde_hdmi_connector_irq(display);
+       /* Process Scrambling ISR */
+       sde_hdmi_ddc_scrambling_isr((void *)display);
+       /* Process DDC2 */
+       sde_hdmi_ddc_hdcp2p2_isr((void *)display);
  
        /* Process DDC: */
        hdmi_i2c_irq(hdmi->i2c);
  
        /* Process HDCP: */
-       if (sde_hdmi->hdcp_ops && sde_hdmi->hdcp_data) {
-               if (sde_hdmi->hdcp_ops->isr) {
-                       if (sde_hdmi->hdcp_ops->isr(
-                               sde_hdmi->hdcp_data))
+       if (display->hdcp_ops && display->hdcp_data) {
+               if (display->hdcp_ops->isr) {
+                       if (display->hdcp_ops->isr(
+                               display->hdcp_data))
                                DEV_ERR("%s: hdcp_1x_isr failed\n",
                                                __func__);
                }
        }
  
        /* Process CEC: */
-       _sde_hdmi_cec_irq(sde_hdmi);
+       _sde_hdmi_cec_irq(display);
  
        return IRQ_HANDLED;
  }
@@@ -1519,8 -1524,8 +1527,8 @@@ int sde_hdmi_get_info(struct msm_displa
                                MSM_DISPLAY_CAP_EDID | MSM_DISPLAY_CAP_VID_MODE;
        }
        info->is_connected = hdmi_display->connected;
 -      info->max_width = 4096;
 -      info->max_height = 2160;
 +      info->max_width = HDMI_DISPLAY_MAX_WIDTH;
 +      info->max_height = HDMI_DISPLAY_MAX_HEIGHT;
        info->compression = MSM_DISPLAY_COMPRESS_NONE;
  
        mutex_unlock(&hdmi_display->display_lock);
@@@ -1717,11 -1722,22 +1725,22 @@@ static int _sde_hdmi_init_hdcp(struct s
                        kfree(hdcp_data);
                        goto end;
                } else {
-                       hdmi_ctrl->hdcp_feature_data[SDE_HDCP_1x] = hdcp_data;
+                       hdmi_ctrl->hdcp_feat_data[SDE_HDCP_1x] = hdcp_data;
                        SDE_HDMI_DEBUG("%s: HDCP 1.4 initialized\n", __func__);
                }
        }
  
+       hdcp_data = sde_hdmi_hdcp2p2_init(&hdcp_init_data);
+       if (IS_ERR_OR_NULL(hdcp_data)) {
+               DEV_ERR("%s: hdcp 2.2 init failed\n", __func__);
+               rc = -EINVAL;
+               goto end;
+       } else {
+               hdmi_ctrl->hdcp_feat_data[SDE_HDCP_2P2] = hdcp_data;
+               SDE_HDMI_DEBUG("%s: HDCP 2.2 initialized\n", __func__);
+       }
  end:
        return rc;
  }
@@@ -1905,8 -1921,11 +1924,11 @@@ int sde_hdmi_dev_deinit(struct sde_hdm
                SDE_ERROR("Invalid params\n");
                return -EINVAL;
        }
-       if (display->hdcp_feature_data[SDE_HDCP_1x])
-               sde_hdcp_1x_deinit(display->hdcp_feature_data[SDE_HDCP_1x]);
+       if (display->hdcp_feat_data[SDE_HDCP_1x])
+               sde_hdcp_1x_deinit(display->hdcp_feat_data[SDE_HDCP_1x]);
+       if (display->hdcp_feat_data[SDE_HDCP_2P2])
+               sde_hdmi_hdcp2p2_deinit(display->hdcp_feat_data[SDE_HDCP_2P2]);
  
        return 0;
  }
@@@ -1993,6 -2012,8 +2015,8 @@@ static int sde_hdmi_bind(struct device 
        _sde_hdmi_map_regs(display, priv->hdmi);
        _sde_hdmi_init_ddc(display, priv->hdmi);
  
+       display->enc_lvl = HDCP_STATE_AUTH_ENC_NONE;
        INIT_DELAYED_WORK(&display->hdcp_cb_work,
                                          sde_hdmi_tx_hdcp_cb_work);
        mutex_init(&display->hdcp_mutex);