From patchwork Tue Dec 3 17:36:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 11271769 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3B6C7930 for ; Tue, 3 Dec 2019 17:37:24 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1EA09206EC for ; Tue, 3 Dec 2019 17:37:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1EA09206EC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D8B426EA42; Tue, 3 Dec 2019 17:37:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yb1-xb43.google.com (mail-yb1-xb43.google.com [IPv6:2607:f8b0:4864:20::b43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0B0336EA46 for ; Tue, 3 Dec 2019 17:37:22 +0000 (UTC) Received: by mail-yb1-xb43.google.com with SMTP id h23so1865872ybg.2 for ; Tue, 03 Dec 2019 09:37:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Zdk7jcACJGexHRY9r9jbCWjX0hzsKELzVolsTiUAB1M=; b=LpcDf/fV2UC9+lox8+lInXrpYYkZSFLvPhe53f1DIMXZfo8PUKLOUDUtfND7jY6LLC TQ1ObGD5BWo1+kjommm61wTIJKFQRnlKdmWV9PO1RZY1uCDDJWPZwT4KWF5EvwJLM6I+ P2g6j0o16AKsFvSM8xdbqL04jWk1iCKkbLoVtFXP1TritQ7hi111iqnCy+Fgi9WQFTiK WHr3boF7Xd4CQ6mkWM1HeJJOL2uv3mO8d9Z2njBt1/GR24gPuJUHGBcvWXA6xQ2ZBOnp ng9neDgD2yW1e/tSa+t6I+Jzwpr8n1MCJSkeVnT2YWck+QkZaf+RLSm8NL2wOERaMh0l pmrQ== X-Gm-Message-State: APjAAAXqh3WnMBaMweqBm/YaDF8A1X/VhjbouoFok+3Dmy/kcN2y/JC6 vZwXH5i0/AuK8K6PSeDT8x2+RoXienmmvw== X-Google-Smtp-Source: APXvYqy6lhu568vyWQOFd++ZJT4fguyh/U2k8NyI+ygsi10Yzs7Uiyx3F24BuibC24NMGrwMGBMHHw== X-Received: by 2002:a25:2d0a:: with SMTP id t10mr5413145ybt.506.1575394640801; Tue, 03 Dec 2019 09:37:20 -0800 (PST) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:89c6:2139:5435:371d]) by smtp.gmail.com with ESMTPSA id g190sm1729426ywf.41.2019.12.03.09.37.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2019 09:37:20 -0800 (PST) From: Sean Paul To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, ramalingm.c@intel.com Subject: [PATCH 05/11] drm/i915: Change toggle_signalling() argument to connector Date: Tue, 3 Dec 2019 12:36:28 -0500 Message-Id: <20191203173638.94919-6-sean@poorly.run> X-Mailer: git-send-email 2.24.0.393.g34dc348eaf-goog In-Reply-To: <20191203173638.94919-1-sean@poorly.run> References: <20191203173638.94919-1-sean@poorly.run> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Zdk7jcACJGexHRY9r9jbCWjX0hzsKELzVolsTiUAB1M=; b=HqiIdJSbgXUmCo2ZzpX1v+CT8gwA8z5iEC2XyTiT1+QEIZjPMddQm7BVixnzaHJ0je c8hWr2xudzArZ8kgEtxRM6mrFcWj8nU+DsUMxwvz5jRR8KczDwaO7fBOrcT6i43dmR+3 qNaryGsrQWts7rSksDBD9wl8uwLJDp8GXOZg7LKQUOc65c58MieSM+B8EkPJtFJxHhD9 q+eF7NP+jWUxLsoVwbbhbZyZYuN3LmPAMLpPA0Xm6va8qrkrXkRZpHPKR6P/MUJD+IRA VUVV8Zh+a+Giny6uFSW4XjRmUwcluN6qoxDYD+VxeE+r0pPuQqyavDL4a7d47OgoefPG 73Rw== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Sean Paul , Rodrigo Vivi Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul HDCP over MST requires us to toggle ddi signalling. Since we'll want to toggle signalling on the pipe associated with the fake encoder as opposed to the digital port's base, we need to get it from connector. This patch converts all existing callers and implementations to use connector instead of digital port. Signed-off-by: Sean Paul --- drivers/gpu/drm/i915/display/intel_display_types.h | 2 +- drivers/gpu/drm/i915/display/intel_dp.c | 2 +- drivers/gpu/drm/i915/display/intel_hdcp.c | 10 ++++------ drivers/gpu/drm/i915/display/intel_hdmi.c | 8 ++++---- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index 4341bd66a418..bbd44772b9b0 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -300,7 +300,7 @@ struct intel_hdcp_shim { int i, u32 *part); /* Enables HDCP signalling on the port */ - int (*toggle_signalling)(struct intel_digital_port *intel_dig_port, + int (*toggle_signalling)(struct intel_connector *connector, bool enable); /* Ensures the link is still protected */ diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 7a407c651fb2..e26fb26b1909 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -6038,7 +6038,7 @@ int intel_dp_hdcp_read_v_prime_part(struct intel_digital_port *intel_dig_port, } static -int intel_dp_hdcp_toggle_signalling(struct intel_digital_port *intel_dig_port, +int intel_dp_hdcp_toggle_signalling(struct intel_connector *connector, bool enable) { /* Not used for single stream DisplayPort setups */ diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c index 8325bf9501e4..0966a8ec47d2 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c @@ -693,7 +693,7 @@ static int intel_hdcp_auth(struct intel_connector *connector) intel_hdcp_get_repeater_ctl(dev_priv, cpu_transcoder, port)); - ret = shim->toggle_signalling(intel_dig_port, true); + ret = shim->toggle_signalling(connector, true); if (ret) return ret; @@ -787,7 +787,7 @@ static int _intel_hdcp_disable(struct intel_connector *connector) return -ETIMEDOUT; } - ret = hdcp->shim->toggle_signalling(intel_dig_port, false); + ret = hdcp->shim->toggle_signalling(connector, false); if (ret) { DRM_ERROR("Failed to disable HDCP signalling\n"); return ret; @@ -1537,7 +1537,6 @@ static int hdcp2_authenticate_sink(struct intel_connector *connector) static int hdcp2_enable_encryption(struct intel_connector *connector) { - struct intel_digital_port *intel_dig_port = conn_to_dig_port(connector); struct drm_i915_private *dev_priv = to_i915(connector->base.dev); struct intel_hdcp *hdcp = &connector->hdcp; enum port port = connector->encoder->port; @@ -1547,7 +1546,7 @@ static int hdcp2_enable_encryption(struct intel_connector *connector) WARN_ON(I915_READ(HDCP2_STATUS(dev_priv, cpu_transcoder, port)) & LINK_ENCRYPTION_STATUS); if (hdcp->shim->toggle_signalling) { - ret = hdcp->shim->toggle_signalling(intel_dig_port, true); + ret = hdcp->shim->toggle_signalling(connector, true); if (ret) { DRM_ERROR("Failed to enable HDCP signalling. %d\n", ret); @@ -1575,7 +1574,6 @@ static int hdcp2_enable_encryption(struct intel_connector *connector) static int hdcp2_disable_encryption(struct intel_connector *connector) { - struct intel_digital_port *intel_dig_port = conn_to_dig_port(connector); struct drm_i915_private *dev_priv = to_i915(connector->base.dev); struct intel_hdcp *hdcp = &connector->hdcp; enum port port = connector->encoder->port; @@ -1598,7 +1596,7 @@ static int hdcp2_disable_encryption(struct intel_connector *connector) DRM_DEBUG_KMS("Disable Encryption Timedout"); if (hdcp->shim->toggle_signalling) { - ret = hdcp->shim->toggle_signalling(intel_dig_port, false); + ret = hdcp->shim->toggle_signalling(connector, false); if (ret) { DRM_ERROR("Failed to disable HDCP signalling. %d\n", ret); diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c index f6f5312205c4..6a1e711c4f7a 100644 --- a/drivers/gpu/drm/i915/display/intel_hdmi.c +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c @@ -1475,18 +1475,18 @@ static int kbl_repositioning_enc_en_signal(struct intel_connector *connector) } static -int intel_hdmi_hdcp_toggle_signalling(struct intel_digital_port *intel_dig_port, +int intel_hdmi_hdcp_toggle_signalling(struct intel_connector *connector, bool enable) { - struct intel_hdmi *hdmi = &intel_dig_port->hdmi; - struct intel_connector *connector = hdmi->attached_connector; + struct intel_encoder *encoder = + intel_attached_encoder(&connector->base); struct drm_i915_private *dev_priv = to_i915(connector->base.dev); int ret; if (!enable) usleep_range(6, 60); /* Bspec says >= 6us */ - ret = intel_ddi_toggle_hdcp_signalling(&intel_dig_port->base, enable); + ret = intel_ddi_toggle_hdcp_signalling(encoder, enable); if (ret) { DRM_ERROR("%s HDCP signalling failed (%d)\n", enable ? "Enable" : "Disable", ret);