From patchwork Tue Jun 23 15:59:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 11621007 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 32ED7913 for ; Tue, 23 Jun 2020 15:59:57 +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 1137C2073E for ; Tue, 23 Jun 2020 15:59:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=poorly.run header.i=@poorly.run header.b="JCsKmtgj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1137C2073E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 316DF6E9F4; Tue, 23 Jun 2020 15:59:49 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qv1-xf41.google.com (mail-qv1-xf41.google.com [IPv6:2607:f8b0:4864:20::f41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3DBC96E9FB for ; Tue, 23 Jun 2020 15:59:41 +0000 (UTC) Received: by mail-qv1-xf41.google.com with SMTP id t7so1038815qvl.8 for ; Tue, 23 Jun 2020 08:59:41 -0700 (PDT) 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; bh=DG2oCGEEbDEz7rhKPqzYsdU18dk6ckyluQv+uSJ4My0=; b=JCsKmtgj11Qlm0tY0uqiKOsfuw0TUyl2c2Stzra5K3xTJFEPf02NhG2yjspnqapjGn h6VXsGH/ncqategfHCnGxbGuAsHwYH1I+/guVxWuZlhtP3uvqBDvXHrMmJ2VsipMkS2+ L4pKr4glZ5qaUo16d/hsQpf4OkN2XWaQKWiWau7sXgKhnUN7isNMUfoCRXne6aHpTmQO nwYK7T+uEBeelCqXd1FK7xyoO2Uzt0PsVFy3YHfXR8MhlJLnONqWbWImn4Om89XXJcCZ ly6iocwF5GbSU/eNCgs953M3PImjeHxo3bfMxGe5T+lixbVP54pa0zSFWva4+tTds7Pw jreQ== 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; bh=DG2oCGEEbDEz7rhKPqzYsdU18dk6ckyluQv+uSJ4My0=; b=GgcDsbUQW54HACiFYBqjcmtioHzt2yZZofFfSDdMBBVJVKoXY+62T/GQiaC9GtBUX/ WPdYFIRWyomXbjeNeDkBiMT3guXfd4zXOOsYomssf6Mllol8h5NLalfWvpdCu8skJ993 YQ7zyfjxfNEkA62vI07LynZ8QlD+2VRs2aqefWNJeahd69FHr7eO8g/3tLRwzqy2dSXr leQ5s+cetn8Bgvp1fxi4DisZ2Ij9Oastwse0xCcqKLStzmKdRfdhOztc1BdA2sRGRrVG kgBN/MpAqoVsw93jM5JzUQHY9+avgSf7yiGXZYs4VdCxwsQeEb9qLNv1wJMcNt31W0R8 Plrw== X-Gm-Message-State: AOAM533ZZdnbXD3V4p13Dmzf8P1Zo8d7dqFQ2aWWX6/8krEH91LFytC/ QID4pIuz87LQRGuuepOXaBSpxw== X-Google-Smtp-Source: ABdhPJzpSsMewoGVJNuFSvuvQ7rrUOQAKvEdPSN18whMWb+gVr1LQp3qIdem+LDifiEIQxMJ1aPJjg== X-Received: by 2002:a05:6214:10e5:: with SMTP id q5mr27165509qvt.47.1592927979574; Tue, 23 Jun 2020 08:59:39 -0700 (PDT) Received: from localhost ([166.137.96.174]) by smtp.gmail.com with ESMTPSA id a25sm1005585qtk.40.2020.06.23.08.59.38 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jun 2020 08:59:39 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Date: Tue, 23 Jun 2020 11:59:04 -0400 Message-Id: <20200623155907.22961-15-sean@poorly.run> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200623155907.22961-1-sean@poorly.run> References: <20200623155907.22961-1-sean@poorly.run> Subject: [Intel-gfx] [PATCH v7 14/17] drm/i915: Add connector to hdcp_shim->check_link() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: daniel.vetter@ffwll.ch, Sean Paul MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Sean Paul Currently we derive the connector from digital port in check_link(). For MST, this isn't sufficient since the digital port passed into the function can have multiple connectors downstream. This patch adds connector to the check_link() arguments so we have it when we need it. Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200218220242.107265-13-sean@poorly.run #v4 Link: https://patchwork.freedesktop.org/patch/msgid/20200305201236.152307-14-sean@poorly.run #v5 Link: https://patchwork.freedesktop.org/patch/msgid/20200429195502.39919-14-sean@poorly.run #v6 Changes in v4: -Added to the set Changes in v5: -None Changes in v6: -None Changes in v7: -None Reviewed-by: Anshuman Gupta Reviewed-by: Ramalingam C --- drivers/gpu/drm/i915/display/intel_display_types.h | 3 ++- drivers/gpu/drm/i915/display/intel_dp_hdcp.c | 3 ++- drivers/gpu/drm/i915/display/intel_hdcp.c | 2 +- drivers/gpu/drm/i915/display/intel_hdmi.c | 5 ++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index 811085ef3fba..94211b8fc159 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -318,7 +318,8 @@ struct intel_hdcp_shim { bool enable); /* Ensures the link is still protected */ - bool (*check_link)(struct intel_digital_port *intel_dig_port); + bool (*check_link)(struct intel_digital_port *intel_dig_port, + struct intel_connector *connector); /* Detects panel's hdcp capability. This is optional for HDMI. */ int (*hdcp_capable)(struct intel_digital_port *intel_dig_port, diff --git a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c index e26a45f880cb..43446a6cae8d 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c @@ -223,7 +223,8 @@ int intel_dp_hdcp_toggle_signalling(struct intel_digital_port *intel_dig_port, } static -bool intel_dp_hdcp_check_link(struct intel_digital_port *intel_dig_port) +bool intel_dp_hdcp_check_link(struct intel_digital_port *intel_dig_port, + struct intel_connector *connector) { struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev); ssize_t ret; diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c index d79d4142aea7..6bd0e4616ee1 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c @@ -953,7 +953,7 @@ static int intel_hdcp_check_link(struct intel_connector *connector) goto out; } - if (hdcp->shim->check_link(intel_dig_port)) { + if (hdcp->shim->check_link(intel_dig_port, connector)) { if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_UNDESIRED) { intel_hdcp_update_value(connector, DRM_MODE_CONTENT_PROTECTION_ENABLED, true); diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c index ca71ee3dd1c7..b12f1af0611d 100644 --- a/drivers/gpu/drm/i915/display/intel_hdmi.c +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c @@ -1546,11 +1546,10 @@ int intel_hdmi_hdcp_toggle_signalling(struct intel_digital_port *intel_dig_port, } static -bool intel_hdmi_hdcp_check_link(struct intel_digital_port *intel_dig_port) +bool intel_hdmi_hdcp_check_link(struct intel_digital_port *intel_dig_port, + struct intel_connector *connector) { struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev); - struct intel_connector *connector = - intel_dig_port->hdmi.attached_connector; enum port port = intel_dig_port->base.port; enum transcoder cpu_transcoder = connector->hdcp.cpu_transcoder; int ret;