From fb997ad6c00fcd16102805aa1cd98ede592dc577 Mon Sep 17 00:00:00 2001 From: Kevin Mihelich Date: Sun, 23 Apr 2017 13:42:34 -0600 Subject: [PATCH 4/4] skip HDCP setup This causes a lockup immediately upon starting X. --- drivers/gpu/drm/rockchip/cdn-dp-core.c | 89 ---------------------------------- 1 file changed, 89 deletions(-) diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c index e10ac220ef4b..c9d94e17b13c 100644 --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c @@ -1151,88 +1151,6 @@ static int cdn_dp_pd_event(struct notifier_block *nb, return NOTIFY_DONE; } -static int cdn_dp_set_hdcp_drm_property(struct cdn_dp_device *dp, uint64_t val) -{ - struct drm_connector *connector = &dp->connector; - struct drm_mode_config *mc = &connector->dev->mode_config; - - return drm_object_property_set_value(&connector->base, - mc->content_protection_property, - val); -} - -static bool cdn_dp_hdcp_authorize(struct cdn_dp_device *dp) -{ - bool auth_done = false; - u16 tx_status; - u32 sw_event; - int ret; - - mutex_lock(&dp->lock); - - /* - * HDCP authentication might cause the disconnect hpd event, just - * stop the hdcp event SM. - */ - if (!dp->connected) { - auth_done = true; - goto out; - } - - sw_event = cdn_dp_get_event(dp); - - if (sw_event & HDCP_TX_STATUS_EVENT) { - auth_done = true; - - ret = cdn_dp_hdcp_tx_status_req(dp, &tx_status); - if (ret) - goto out; - if (HDCP_TX_STATUS_ERROR(tx_status)) { - dev_err(dp->dev, "hdcp status error: %x\n", - HDCP_TX_STATUS_ERROR(tx_status)); - goto out; - } else if (tx_status & HDCP_TX_STATUS_AUTHENTICATED) { - cdn_dp_set_hdcp_drm_property(dp, - DRM_MODE_CONTENT_PROTECTION_ENABLED); - goto out; - } else { - auth_done = false; - } - } - - if (sw_event & HDCP_TX_IS_RECEIVER_ID_VALID_EVENT) { - ret = cdn_dp_hdcp_tx_is_receiver_id_valid_req(dp); - if (ret) { - auth_done = true; - goto out; - } - ret = cdn_dp_hdcp_tx_respond_id_valid(dp, true); - if (ret) - auth_done = true; - } - -out: - mutex_unlock(&dp->lock); - - return auth_done; -} - -static void cdn_dp_hdcp_event_work(struct work_struct *work) -{ - struct cdn_dp_device *dp = container_of(work, struct cdn_dp_device, - hdcp_event_work.work); - unsigned long timeout = jiffies + - msecs_to_jiffies(HDCP_EVENT_TIMEOUT_MS); - - while (time_before(jiffies, timeout)) { - if (cdn_dp_hdcp_authorize(dp)) - return; - msleep(HDCP_RETRY_INTERVAL_MS); - } - - dev_err(dp->dev, "Failed to authorize hdcp\n"); -} - static int cdn_dp_bind(struct device *dev, struct device *master, void *data) { struct cdn_dp_device *dp = dev_get_drvdata(dev); @@ -1240,7 +1158,6 @@ static int cdn_dp_bind(struct device *dev, struct device *master, void *data) struct drm_connector *connector; struct cdn_dp_port *port; struct drm_device *drm_dev = data; - struct drm_mode_config *mode_config; int ret, i; ret = cdn_dp_parse_dt(dp); @@ -1253,7 +1170,6 @@ static int cdn_dp_bind(struct device *dev, struct device *master, void *data) dp->active_port = -1; INIT_WORK(&dp->event_work, cdn_dp_pd_event_work); - INIT_DELAYED_WORK(&dp->hdcp_event_work, cdn_dp_hdcp_event_work); encoder = &dp->encoder; @@ -1310,11 +1226,6 @@ static int cdn_dp_bind(struct device *dev, struct device *master, void *data) schedule_work(&dp->event_work); - mode_config = &connector->dev->mode_config; - drm_object_attach_property(&connector->base, - mode_config->content_protection_property, - DRM_MODE_CONTENT_PROTECTION_UNDESIRED); - return 0; err_free_connector: -- 2.12.2