From patchwork Fri Jan 12 07:41:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kandpal, Suraj" X-Patchwork-Id: 13518017 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 37730C4707C for ; Fri, 12 Jan 2024 07:43:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A381C10EA7A; Fri, 12 Jan 2024 07:43:29 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id F3EFA10EA7A for ; Fri, 12 Jan 2024 07:43:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705045408; x=1736581408; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TDrM10sqZX5Ztf06/NW2p7t+H2+tlhn8LQINu4R0Icc=; b=E+pDySVy/YR6/BxAfrugxv2Agu0SNXaSqWQyd+qhiuttDvTD+orhx6Wh vA8LZsnrRmhBJoOtyzUyCLhQZO05hXrqE6OsDjBdIO+seIH0OoCobN0Vq v4Uh+F4sMQO7JiABEDzZhbb9nXMauEx63DrCd5wxBNFn12oUZzq/E9KFS IXHLeH9jwq6Zhcr+eF94FYBkJuwQLEek/A1dlUD4R/4wNRoNU4zP/onoR FmLyKa8zTciGgzV6QWc26X1E3kz2oNAn2e506MA9Y6b+O1L0hzqG5yaqh FfVNeZVX9HeevtU1lXzEDulh/38qko/TpVc+hmCVHFsNdoXZ07cFyIX4U A==; X-IronPort-AV: E=McAfee;i="6600,9927,10950"; a="5866973" X-IronPort-AV: E=Sophos;i="6.04,188,1695711600"; d="scan'208";a="5866973" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2024 23:43:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,188,1695711600"; d="scan'208";a="17317576" Received: from kandpal-x299-ud4-pro.iind.intel.com ([10.190.239.32]) by fmviesa002.fm.intel.com with ESMTP; 11 Jan 2024 23:43:25 -0800 From: Suraj Kandpal To: intel-gfx@lists.freedesktop.org Subject: [PATCH 1/7] drm/i915/hdcp: Move to direct reads for HDCP Date: Fri, 12 Jan 2024 13:11:14 +0530 Message-Id: <20240112074120.159797-2-suraj.kandpal@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240112074120.159797-1-suraj.kandpal@intel.com> References: <20240112074120.159797-1-suraj.kandpal@intel.com> MIME-Version: 1.0 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Even for MST scenarios we need to do direct reads only on the immediate downstream device the rest of the authentication is taken care by that device. Remote reads will only be used to check capability of the monitors in MST topology. Signed-off-by: Suraj Kandpal --- drivers/gpu/drm/i915/display/intel_dp_hdcp.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c index 3a595cd433d4..bec49061b2e1 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c @@ -331,11 +331,11 @@ static const struct hdcp2_dp_msg_data hdcp2_dp_msg_data[] = { }; static struct drm_dp_aux * -intel_dp_hdcp_get_aux(struct intel_connector *connector) +intel_dp_hdcp_get_aux(struct intel_connector *connector, bool remote_req) { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); - if (intel_encoder_is_mst(connector->encoder)) + if (intel_encoder_is_mst(connector->encoder) && remote_req) return &connector->port->aux; else return &dig_port->dp.aux; @@ -346,7 +346,7 @@ intel_dp_hdcp2_read_rx_status(struct intel_connector *connector, u8 *rx_status) { struct drm_i915_private *i915 = to_i915(connector->base.dev); - struct drm_dp_aux *aux = intel_dp_hdcp_get_aux(connector); + struct drm_dp_aux *aux = intel_dp_hdcp_get_aux(connector, false); ssize_t ret; ret = drm_dp_dpcd_read(aux, @@ -463,7 +463,7 @@ int intel_dp_hdcp2_write_msg(struct intel_connector *connector, offset = hdcp2_msg_data->offset; - aux = intel_dp_hdcp_get_aux(connector); + aux = intel_dp_hdcp_get_aux(connector, false); /* No msg_id in DP HDCP2.2 msgs */ bytes_to_write = size - 1; @@ -490,7 +490,7 @@ static ssize_t get_receiver_id_list_rx_info(struct intel_connector *connector, u32 *dev_cnt, u8 *byte) { - struct drm_dp_aux *aux = intel_dp_hdcp_get_aux(connector); + struct drm_dp_aux *aux = intel_dp_hdcp_get_aux(connector, false); ssize_t ret; u8 *rx_info = byte; @@ -530,7 +530,7 @@ int intel_dp_hdcp2_read_msg(struct intel_connector *connector, return -EINVAL; offset = hdcp2_msg_data->offset; - aux = intel_dp_hdcp_get_aux(connector); + aux = intel_dp_hdcp_get_aux(connector, false); ret = intel_dp_hdcp2_wait_for_msg(connector, hdcp2_msg_data); if (ret < 0) @@ -655,7 +655,7 @@ int intel_dp_hdcp2_capable(struct intel_connector *connector, u8 rx_caps[3]; int ret; - aux = intel_dp_hdcp_get_aux(connector); + aux = intel_dp_hdcp_get_aux(connector, true); *capable = false; ret = drm_dp_dpcd_read(aux, From patchwork Fri Jan 12 07:41:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kandpal, Suraj" X-Patchwork-Id: 13518018 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 620F7C47422 for ; Fri, 12 Jan 2024 07:43:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0B5FA10EA7D; Fri, 12 Jan 2024 07:43:33 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id 01DEB10EA7C for ; Fri, 12 Jan 2024 07:43:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705045411; x=1736581411; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=X8EyKOgpByCciDb9uqxI6dhPRz8r6i9wRZQ2V5Aq8ko=; b=FpW/LBNx5kv9qEGwP19CgjtDPHg4ejbkbJ+xc8lSDwSAEBhun9c0wam3 SS8/OeZ+2kVSDqsYMIP1jNqCbUgh/SX3q23zGmaI1MlSdq0F85bv/hcdY zI5MBEIkn70dgAUWAh0q4RI8eMGKKFqPi3VD5Etrcpyn2r7xWGg6rDvu4 Wu6wk6fBZVHNirK039DSLfc4DQTKfz6TtidRbJHY1c2WniMDPilFz3Ps4 UDpfAXlpigcAL/5eIJrD+DQ9/CgXNBayalmL2vVtY9wbXAf4QAX90MRyU s2f1ixykoEwLd+3uzJTeBJ3gcSfP54OytVUoVOoj7eDgUiLlmd1DhmqSD A==; X-IronPort-AV: E=McAfee;i="6600,9927,10950"; a="5866991" X-IronPort-AV: E=Sophos;i="6.04,188,1695711600"; d="scan'208";a="5866991" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2024 23:43:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,188,1695711600"; d="scan'208";a="17317582" Received: from kandpal-x299-ud4-pro.iind.intel.com ([10.190.239.32]) by fmviesa002.fm.intel.com with ESMTP; 11 Jan 2024 23:43:28 -0800 From: Suraj Kandpal To: intel-gfx@lists.freedesktop.org Subject: [PATCH 2/7] drm/i915/hdcp: HDCP Capability for the downstream device Date: Fri, 12 Jan 2024 13:11:15 +0530 Message-Id: <20240112074120.159797-3-suraj.kandpal@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240112074120.159797-1-suraj.kandpal@intel.com> References: <20240112074120.159797-1-suraj.kandpal@intel.com> MIME-Version: 1.0 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Currently we are only checking capability of remote device and not immediate downstream device but during capability check we need are concerned with only the HDCP capability of downstream device. During i915_display_info reporting we need HDCP Capability for both the monitors and downstream branch device if any this patch adds that. Signed-off-by: Suraj Kandpal --- .../drm/i915/display/intel_display_debugfs.c | 19 +++++++++++++++---- .../drm/i915/display/intel_display_types.h | 2 +- drivers/gpu/drm/i915/display/intel_dp_hdcp.c | 4 ++-- drivers/gpu/drm/i915/display/intel_hdcp.c | 6 +++--- drivers/gpu/drm/i915/display/intel_hdcp.h | 2 +- drivers/gpu/drm/i915/display/intel_hdmi.c | 2 +- 6 files changed, 23 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c index d951edb36687..457f13357fad 100644 --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c @@ -210,7 +210,8 @@ static void intel_panel_info(struct seq_file *m, } static void intel_hdcp_info(struct seq_file *m, - struct intel_connector *intel_connector) + struct intel_connector *intel_connector, + bool remote_req) { bool hdcp_cap, hdcp2_cap; @@ -220,7 +221,7 @@ static void intel_hdcp_info(struct seq_file *m, } hdcp_cap = intel_hdcp_capable(intel_connector); - hdcp2_cap = intel_hdcp2_capable(intel_connector); + hdcp2_cap = intel_hdcp2_capable(intel_connector, remote_req); if (hdcp_cap) seq_puts(m, "HDCP1.4 "); @@ -307,7 +308,12 @@ static void intel_connector_info(struct seq_file *m, } seq_puts(m, "\tHDCP version: "); - intel_hdcp_info(m, intel_connector); + intel_hdcp_info(m, intel_connector, true); + + if (intel_encoder_is_mst(encoder)) { + seq_puts(m, "\tHDCP Branch Device version: "); + intel_hdcp_info(m, intel_connector, false); + } seq_printf(m, "\tmax bpc: %u\n", connector->display_info.bpc); @@ -1153,7 +1159,12 @@ static int i915_hdcp_sink_capability_show(struct seq_file *m, void *data) seq_printf(m, "%s:%d HDCP version: ", connector->base.name, connector->base.base.id); - intel_hdcp_info(m, connector); + intel_hdcp_info(m, connector, true); + + if (intel_encoder_is_mst(connector->encoder)) { + seq_puts(m, "\tHDCP Branch Device version: "); + intel_hdcp_info(m, connector, false); + } out: drm_modeset_unlock(&i915->drm.mode_config.connection_mutex); diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index ae2e8cff9d69..aa559598f049 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -507,7 +507,7 @@ struct intel_hdcp_shim { /* Detects whether sink is HDCP2.2 capable */ int (*hdcp_2_2_capable)(struct intel_connector *connector, - bool *capable); + bool *capable, bool remote_req); /* Write HDCP2.2 messages */ int (*write_2_2_msg)(struct intel_connector *connector, diff --git a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c index bec49061b2e1..90b027ba3302 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c @@ -649,13 +649,13 @@ int intel_dp_hdcp2_check_link(struct intel_digital_port *dig_port, static int intel_dp_hdcp2_capable(struct intel_connector *connector, - bool *capable) + bool *capable, bool remote_req) { struct drm_dp_aux *aux; u8 rx_caps[3]; int ret; - aux = intel_dp_hdcp_get_aux(connector, true); + aux = intel_dp_hdcp_get_aux(connector, remote_req); *capable = false; ret = drm_dp_dpcd_read(aux, diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c index c3e692e7f790..b88a4713e6a8 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c @@ -161,7 +161,7 @@ bool intel_hdcp_capable(struct intel_connector *connector) } /* Is HDCP2.2 capable on Platform and Sink */ -bool intel_hdcp2_capable(struct intel_connector *connector) +bool intel_hdcp2_capable(struct intel_connector *connector, bool remote_req) { struct drm_i915_private *i915 = to_i915(connector->base.dev); struct intel_hdcp *hdcp = &connector->hdcp; @@ -186,7 +186,7 @@ bool intel_hdcp2_capable(struct intel_connector *connector) mutex_unlock(&i915->display.hdcp.hdcp_mutex); /* Sink's capability for HDCP2.2 */ - hdcp->shim->hdcp_2_2_capable(connector, &capable); + hdcp->shim->hdcp_2_2_capable(connector, &capable, remote_req); return capable; } @@ -2374,7 +2374,7 @@ static int _intel_hdcp_enable(struct intel_atomic_state *state, * Considering that HDCP2.2 is more secure than HDCP1.4, If the setup * is capable of HDCP2.2, it is preferred to use HDCP2.2. */ - if (intel_hdcp2_capable(connector)) { + if (intel_hdcp2_capable(connector, false)) { ret = intel_hdcp_set_streams(dig_port, state); if (!ret) { ret = _intel_hdcp2_enable(connector); diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.h b/drivers/gpu/drm/i915/display/intel_hdcp.h index a9c784fd9ba5..72268e593cec 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.h +++ b/drivers/gpu/drm/i915/display/intel_hdcp.h @@ -39,7 +39,7 @@ void intel_hdcp_update_pipe(struct intel_atomic_state *state, const struct drm_connector_state *conn_state); bool is_hdcp_supported(struct drm_i915_private *i915, enum port port); bool intel_hdcp_capable(struct intel_connector *connector); -bool intel_hdcp2_capable(struct intel_connector *connector); +bool intel_hdcp2_capable(struct intel_connector *connector, bool remote_req); void intel_hdcp_component_init(struct drm_i915_private *i915); void intel_hdcp_component_fini(struct drm_i915_private *i915); void intel_hdcp_cleanup(struct intel_connector *connector); diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c index 7020e5806109..d7feef05bc47 100644 --- a/drivers/gpu/drm/i915/display/intel_hdmi.c +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c @@ -1733,7 +1733,7 @@ int intel_hdmi_hdcp2_check_link(struct intel_digital_port *dig_port, static int intel_hdmi_hdcp2_capable(struct intel_connector *connector, - bool *capable) + bool *capable, bool remote_req) { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); u8 hdcp2_version; From patchwork Fri Jan 12 07:41:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kandpal, Suraj" X-Patchwork-Id: 13518019 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 550BDC47DA2 for ; Fri, 12 Jan 2024 07:43:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EC14B10EA80; Fri, 12 Jan 2024 07:43:34 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id D60E110EA80 for ; Fri, 12 Jan 2024 07:43:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705045414; x=1736581414; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=X0Luayn117dQKrWPnpceTBKj2wP82BhluZecgTGd5cw=; b=CLnhkel98AnrHAY92hY5HDHbV4qMUCEJjFSPNgJZKHb3lFA88S6ZjYtl 5mF/qrIsFpXD/WbJVpKa+Q0E6HT+BIqxSyUJIG9yPCdMz4P1MPxi2BAKY 0kKcic7R8dX7fBnhif0GcLiG5GqxPsIHbeTP/GLh3MFJaJnMs8gq9Z7Sh m85oKKHPe4cPBevEBUeXM0nvRwyCMsDgHtVGHTxYSWbgFTYZztS4R9C8Q w6ZhwQCs71ecPX4SrzTUXMb5BFSFauWixHS6FTOroBjSpN+1fXqdEWpqY VRiATY1VupeBYevNJexF6gPlY2XoQ7CJrOLGLohwyTxTTrXKKnyZ7EYT1 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10950"; a="5867002" X-IronPort-AV: E=Sophos;i="6.04,188,1695711600"; d="scan'208";a="5867002" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2024 23:43:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,188,1695711600"; d="scan'208";a="17317586" Received: from kandpal-x299-ud4-pro.iind.intel.com ([10.190.239.32]) by fmviesa002.fm.intel.com with ESMTP; 11 Jan 2024 23:43:31 -0800 From: Suraj Kandpal To: intel-gfx@lists.freedesktop.org Subject: [PATCH 3/7] drm/i915/hdcp: Remove additional timing for reading mst hdcp message Date: Fri, 12 Jan 2024 13:11:16 +0530 Message-Id: <20240112074120.159797-4-suraj.kandpal@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240112074120.159797-1-suraj.kandpal@intel.com> References: <20240112074120.159797-1-suraj.kandpal@intel.com> MIME-Version: 1.0 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Now that we have moved back to direct reads the additional timing is not required hence this can be removed. Signed-off-by: Suraj Kandpal Reviewed-by: Ankit Nautiyal --- drivers/gpu/drm/i915/display/intel_dp_hdcp.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c index 90b027ba3302..cde42b756f6a 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c @@ -561,13 +561,8 @@ int intel_dp_hdcp2_read_msg(struct intel_connector *connector, /* Entire msg read timeout since initiate of msg read */ if (bytes_to_recv == size - 1 && hdcp2_msg_data->msg_read_timeout > 0) { - if (intel_encoder_is_mst(connector->encoder)) - msg_end = ktime_add_ms(ktime_get_raw(), - hdcp2_msg_data->msg_read_timeout * - connector->port->parent->num_ports); - else - msg_end = ktime_add_ms(ktime_get_raw(), - hdcp2_msg_data->msg_read_timeout); + msg_end = ktime_add_ms(ktime_get_raw(), + hdcp2_msg_data->msg_read_timeout); } ret = drm_dp_dpcd_read(aux, offset, From patchwork Fri Jan 12 07:41:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kandpal, Suraj" X-Patchwork-Id: 13518020 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C0DADC4707C for ; Fri, 12 Jan 2024 07:43:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1BA5410EA83; Fri, 12 Jan 2024 07:43:38 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9195310EA83 for ; Fri, 12 Jan 2024 07:43:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705045416; x=1736581416; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aa2AkFAQP0nT292PbO51m3c88eG0Ro+KIaJiy30Z1Sg=; b=giqIJdlpnmGl5w0zSff/r45CpzDwfWr/n1wuD+hNEeNviEQV1kQPFc6Z fbz524sqC9PJ44dcHRFuH8vVz5zsoORJmTGiNtzjC4PybvZ0xdMR7y+yr Jf9g0rQeSLi1SAD4Sh3hRj1JpSJOUQj6+g7zUFYkL1ifv05dIC/W0EAWL /Nerq/u4rvnnsA7cS8mBtZKqcCcATms8K6K9hq6Yo1xb4HPBx5odxRmUO PnDpFfb0+FC3Pgs4+WPre5/fu6OGRZkoB1zuSHE6utU/+rLS/WrksR69m 1PQL9tN9sae6HW1YMu5MGvZ2wTHMzS69IGwcoxcnYLKK0NZYThEKn1/Gm A==; X-IronPort-AV: E=McAfee;i="6600,9927,10950"; a="5867014" X-IronPort-AV: E=Sophos;i="6.04,188,1695711600"; d="scan'208";a="5867014" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2024 23:43:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,188,1695711600"; d="scan'208";a="17317589" Received: from kandpal-x299-ud4-pro.iind.intel.com ([10.190.239.32]) by fmviesa002.fm.intel.com with ESMTP; 11 Jan 2024 23:43:34 -0800 From: Suraj Kandpal To: intel-gfx@lists.freedesktop.org Subject: [PATCH 4/7] drm/i915/hdcp: Extract hdcp structure from correct connector Date: Fri, 12 Jan 2024 13:11:17 +0530 Message-Id: <20240112074120.159797-5-suraj.kandpal@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240112074120.159797-1-suraj.kandpal@intel.com> References: <20240112074120.159797-1-suraj.kandpal@intel.com> MIME-Version: 1.0 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Currently intel_hdcp is not being extracted from primary connector this patch fixes that. Signed-off-by: Suraj Kandpal --- drivers/gpu/drm/i915/display/intel_dp_hdcp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c index cde42b756f6a..eff2da976d2c 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c @@ -399,7 +399,9 @@ intel_dp_hdcp2_wait_for_msg(struct intel_connector *connector, const struct hdcp2_dp_msg_data *hdcp2_msg_data) { struct drm_i915_private *i915 = to_i915(connector->base.dev); - struct intel_hdcp *hdcp = &connector->hdcp; + struct intel_digital_port *dig_port = intel_attached_dig_port(connector); + struct intel_dp *dp = &dig_port->dp; + struct intel_hdcp *hdcp = &dp->attached_connector->hdcp; u8 msg_id = hdcp2_msg_data->msg_id; int ret, timeout; bool msg_ready = false; @@ -515,7 +517,8 @@ int intel_dp_hdcp2_read_msg(struct intel_connector *connector, { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); - struct intel_hdcp *hdcp = &connector->hdcp; + struct intel_dp *dp = &dig_port->dp; + struct intel_hdcp *hdcp = &dp->attached_connector->hdcp; struct drm_dp_aux *aux; unsigned int offset; u8 *byte = buf; From patchwork Fri Jan 12 07:41:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kandpal, Suraj" X-Patchwork-Id: 13518021 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 41AFEC4707C for ; Fri, 12 Jan 2024 07:43:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CD27C10EA85; Fri, 12 Jan 2024 07:43:40 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id B4B1010EA85 for ; Fri, 12 Jan 2024 07:43:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705045419; x=1736581419; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4jsWUXVpmAORdy6inE0MCgqp7kJScH43sUF3oU0PTdE=; b=eFLXhvu232kIO9OiPIRkbmcsBENNadDqJ5YY8JBnyJlc0z6YnxDrDhhu 16W8fnUFmaUscJ4fI/IfyL42vfK79I2DS3v3vnZZs3/guyzhzZjfIP4lQ 286eg7Nhg14AIaafW+VSJEyP6DFPTCBiT0FxMz1EnoIkztwx2DnDkRPIj xjZbLOudM8LTZt31Pc6vG6RnbG8MaOBlNjuA2wFzE++geUj1bFVhfNphD J2beutzy1fWoE7h+YcYukrtm4ETt5Ef91I8QKyTN2AOFev9Mj+Qtr1jw2 73I9oaNemrpaBX/UBkNVLAdPf5mXTnjmIfY2pvyLc6yx4HafM6lz5UOm+ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10950"; a="5867040" X-IronPort-AV: E=Sophos;i="6.04,188,1695711600"; d="scan'208";a="5867040" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2024 23:43:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,188,1695711600"; d="scan'208";a="17317593" Received: from kandpal-x299-ud4-pro.iind.intel.com ([10.190.239.32]) by fmviesa002.fm.intel.com with ESMTP; 11 Jan 2024 23:43:37 -0800 From: Suraj Kandpal To: intel-gfx@lists.freedesktop.org Subject: [PATCH 5/7] drm/i915/hdcp: Allocate stream id after HDCP AKE stage Date: Fri, 12 Jan 2024 13:11:18 +0530 Message-Id: <20240112074120.159797-6-suraj.kandpal@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240112074120.159797-1-suraj.kandpal@intel.com> References: <20240112074120.159797-1-suraj.kandpal@intel.com> MIME-Version: 1.0 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Allocate stream id after HDCP AKE stage and not before so that it can also be done during link integrity check. Right now for MST scenarios LIC fails after hdcp enablement for this reason. Signed-off-by: Suraj Kandpal --- .../drm/i915/display/intel_display_types.h | 1 + drivers/gpu/drm/i915/display/intel_hdcp.c | 124 ++++++++---------- 2 files changed, 59 insertions(+), 66 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index aa559598f049..d627cedc11a1 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -541,6 +541,7 @@ struct intel_hdcp { u64 value; struct delayed_work check_work; struct work_struct prop_work; + struct drm_modeset_acquire_ctx *acquire_ctx; /* HDCP1.4 Encryption status */ bool hdcp_encrypted; diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c index b88a4713e6a8..1ba9ebe67a29 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c @@ -30,8 +30,9 @@ #define KEY_LOAD_TRIES 5 #define HDCP2_LC_RETRY_CNT 3 -static int intel_conn_to_vcpi(struct drm_atomic_state *state, - struct intel_connector *connector) +static int +intel_conn_to_vcpi(struct drm_modeset_acquire_ctx *acquire_ctx, + struct intel_connector *connector) { struct drm_dp_mst_topology_mgr *mgr; struct drm_dp_mst_atomic_payload *payload; @@ -43,7 +44,7 @@ static int intel_conn_to_vcpi(struct drm_atomic_state *state, return 0; mgr = connector->port->mgr; - drm_modeset_lock(&mgr->base.lock, state->acquire_ctx); + drm_modeset_lock(&mgr->base.lock, acquire_ctx); mst_state = to_drm_dp_mst_topology_state(mgr->base.state); payload = drm_atomic_get_mst_payload_state(mst_state, connector->port); if (drm_WARN_ON(mgr->dev, !payload)) @@ -68,19 +69,51 @@ static int intel_conn_to_vcpi(struct drm_atomic_state *state, * DP MST topology. Though it is not compulsory, security fw should change its * policy to mark different content_types for different streams. */ -static void -intel_hdcp_required_content_stream(struct intel_digital_port *dig_port) +static int +intel_hdcp_required_content_stream(struct intel_hdcp *hdcp, + struct intel_digital_port *dig_port) { + struct drm_connector_list_iter conn_iter; + struct intel_digital_port *conn_dig_port; + struct intel_connector *connector; + struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); struct hdcp_port_data *data = &dig_port->hdcp_port_data; bool enforce_type0 = false; int k; if (dig_port->hdcp_auth_status) - return; + return 0; + + data->k = 0; if (!dig_port->hdcp_mst_type1_capable) enforce_type0 = true; + drm_connector_list_iter_begin(&i915->drm, &conn_iter); + for_each_intel_connector_iter(connector, &conn_iter) { + if (connector->base.status == connector_status_disconnected) + continue; + + if (!intel_encoder_is_mst(intel_attached_encoder(connector))) + continue; + + conn_dig_port = intel_attached_dig_port(connector); + if (conn_dig_port != dig_port) + continue; + + data->streams[data->k].stream_id = + intel_conn_to_vcpi(hdcp->acquire_ctx, connector); + data->k++; + + /* if there is only one active stream */ + if (dig_port->dp.active_mst_links <= 1) + break; + } + drm_connector_list_iter_end(&conn_iter); + + if (drm_WARN_ON(&i915->drm, data->k > INTEL_NUM_PIPES(i915) || data->k == 0)) + return -EINVAL; + /* * Apply common protection level across all streams in DP MST Topology. * Use highest supported content type for all streams in DP MST Topology. @@ -88,18 +121,23 @@ intel_hdcp_required_content_stream(struct intel_digital_port *dig_port) for (k = 0; k < data->k; k++) data->streams[k].stream_type = enforce_type0 ? DRM_MODE_HDCP_CONTENT_TYPE0 : DRM_MODE_HDCP_CONTENT_TYPE1; + + return 0; } -static void intel_hdcp_prepare_streams(struct intel_connector *connector) +static int intel_hdcp_prepare_streams(struct intel_connector *connector) { struct intel_digital_port *dig_port = intel_attached_dig_port(connector); struct hdcp_port_data *data = &dig_port->hdcp_port_data; struct intel_hdcp *hdcp = &connector->hdcp; if (!intel_encoder_is_mst(intel_attached_encoder(connector))) { + data->k = 1; + data->streams[0].stream_id = 0; data->streams[0].stream_type = hdcp->content_type; + return 0; } else { - intel_hdcp_required_content_stream(dig_port); + return intel_hdcp_required_content_stream(hdcp, dig_port); } } @@ -1880,7 +1918,13 @@ static int hdcp2_authenticate_and_encrypt(struct intel_connector *connector) for (i = 0; i < tries && !dig_port->hdcp_auth_status; i++) { ret = hdcp2_authenticate_sink(connector); if (!ret) { - intel_hdcp_prepare_streams(connector); + ret = intel_hdcp_prepare_streams(connector); + if (ret) { + drm_dbg_kms(&i915->drm, + "Prepare stream failed.(%d)\n", + ret); + break; + } ret = hdcp2_propagate_stream_management_info(connector); if (ret) { @@ -2284,52 +2328,6 @@ int intel_hdcp_init(struct intel_connector *connector, return 0; } -static int -intel_hdcp_set_streams(struct intel_digital_port *dig_port, - struct intel_atomic_state *state) -{ - struct drm_connector_list_iter conn_iter; - struct intel_digital_port *conn_dig_port; - struct intel_connector *connector; - struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); - struct hdcp_port_data *data = &dig_port->hdcp_port_data; - - if (!intel_encoder_is_mst(&dig_port->base)) { - data->k = 1; - data->streams[0].stream_id = 0; - return 0; - } - - data->k = 0; - - drm_connector_list_iter_begin(&i915->drm, &conn_iter); - for_each_intel_connector_iter(connector, &conn_iter) { - if (connector->base.status == connector_status_disconnected) - continue; - - if (!intel_encoder_is_mst(intel_attached_encoder(connector))) - continue; - - conn_dig_port = intel_attached_dig_port(connector); - if (conn_dig_port != dig_port) - continue; - - data->streams[data->k].stream_id = - intel_conn_to_vcpi(&state->base, connector); - data->k++; - - /* if there is only one active stream */ - if (dig_port->dp.active_mst_links <= 1) - break; - } - drm_connector_list_iter_end(&conn_iter); - - if (drm_WARN_ON(&i915->drm, data->k > INTEL_NUM_PIPES(i915) || data->k == 0)) - return -EINVAL; - - return 0; -} - static int _intel_hdcp_enable(struct intel_atomic_state *state, struct intel_encoder *encoder, const struct intel_crtc_state *pipe_config, @@ -2370,22 +2368,16 @@ static int _intel_hdcp_enable(struct intel_atomic_state *state, dig_port->hdcp_port_data.hdcp_transcoder = intel_get_hdcp_transcoder(hdcp->cpu_transcoder); + hdcp->acquire_ctx = state->base.acquire_ctx; /* * Considering that HDCP2.2 is more secure than HDCP1.4, If the setup * is capable of HDCP2.2, it is preferred to use HDCP2.2. */ if (intel_hdcp2_capable(connector, false)) { - ret = intel_hdcp_set_streams(dig_port, state); - if (!ret) { - ret = _intel_hdcp2_enable(connector); - if (!ret) - check_link_interval = - DRM_HDCP2_CHECK_PERIOD_MS; - } else { - drm_dbg_kms(&i915->drm, - "Set content streams failed: (%d)\n", - ret); - } + ret = _intel_hdcp2_enable(connector); + if (!ret) + check_link_interval = + DRM_HDCP2_CHECK_PERIOD_MS; } /* From patchwork Fri Jan 12 07:41:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kandpal, Suraj" X-Patchwork-Id: 13518022 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 7BB26C4706C for ; Fri, 12 Jan 2024 07:43:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D795210EA86; Fri, 12 Jan 2024 07:43:43 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7434C10EA86 for ; Fri, 12 Jan 2024 07:43:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705045422; x=1736581422; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SpWAwf74Rr6RQlBR0XppFZVnKeRr3A/xyCfzZhCZuZA=; b=MzE+NI+3S9wf93FFb6ENCJl0ZxVRDLhgSWD8fVhaOT+/6kh63cEb+hoP tScJi6tOc2JRH8WP8oiBsni5S0v4CoIQqHFLzFsWf31JFFDOCARaV9beh ElIkvLQMYyWgF3OwywDnEZwMOOMMn538IWJhFP+sECyFCf8wceEi0k5ha 4aRq+Z3g0MhELqBotb7UWd4Ja3/dXNh8l1rb3DxuSyxnlxJAbdIUqv+lZ /eH8i56jxw1I+bYvnKp8IHda/WPuKO8j9bzyFCFdAwU6pBXKlGq/0+fOP 7L1+RAsLlyOBUpTsvp6f2EBc0GFo6zuLF4cMfQwe139Y0P2uLMqKBaW9q Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10950"; a="5867059" X-IronPort-AV: E=Sophos;i="6.04,188,1695711600"; d="scan'208";a="5867059" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2024 23:43:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,188,1695711600"; d="scan'208";a="17317596" Received: from kandpal-x299-ud4-pro.iind.intel.com ([10.190.239.32]) by fmviesa002.fm.intel.com with ESMTP; 11 Jan 2024 23:43:40 -0800 From: Suraj Kandpal To: intel-gfx@lists.freedesktop.org Subject: [PATCH 6/7] drm/i915/hdcp: Read Rxcaps for robustibility Date: Fri, 12 Jan 2024 13:11:19 +0530 Message-Id: <20240112074120.159797-7-suraj.kandpal@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240112074120.159797-1-suraj.kandpal@intel.com> References: <20240112074120.159797-1-suraj.kandpal@intel.com> MIME-Version: 1.0 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" We see some monitors and docks report incorrect hdcp version and capability in first few reads so we read rx_caps three times before we conclude the monitor's or docks HDCP capability Signed-off-by: Suraj Kandpal --- drivers/gpu/drm/i915/display/intel_dp_hdcp.c | 22 ++++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c index eff2da976d2c..fce9b4e27f67 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c @@ -651,20 +651,24 @@ int intel_dp_hdcp2_capable(struct intel_connector *connector, { struct drm_dp_aux *aux; u8 rx_caps[3]; - int ret; + int ret, i; aux = intel_dp_hdcp_get_aux(connector, remote_req); *capable = false; - ret = drm_dp_dpcd_read(aux, - DP_HDCP_2_2_REG_RX_CAPS_OFFSET, - rx_caps, HDCP_2_2_RXCAPS_LEN); - if (ret != HDCP_2_2_RXCAPS_LEN) - return ret >= 0 ? -EIO : ret; + for (i = 0; i < 3; i++) { + ret = drm_dp_dpcd_read(aux, + DP_HDCP_2_2_REG_RX_CAPS_OFFSET, + rx_caps, HDCP_2_2_RXCAPS_LEN); + if (ret != HDCP_2_2_RXCAPS_LEN) + return ret >= 0 ? -EIO : ret; - if (rx_caps[0] == HDCP_2_2_RX_CAPS_VERSION_VAL && - HDCP_2_2_DP_HDCP_CAPABLE(rx_caps[2])) - *capable = true; + if (rx_caps[0] == HDCP_2_2_RX_CAPS_VERSION_VAL && + HDCP_2_2_DP_HDCP_CAPABLE(rx_caps[2])) { + *capable = true; + break; + } + } return 0; } From patchwork Fri Jan 12 07:41:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Kandpal, Suraj" X-Patchwork-Id: 13518023 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 78364C4707C for ; Fri, 12 Jan 2024 07:43:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 03DCF10EA87; Fri, 12 Jan 2024 07:43:47 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id E155710EA87 for ; Fri, 12 Jan 2024 07:43:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705045426; x=1736581426; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=t8jblCgzeW4n9lrl3dga9yAy6U1+2T1v+luwT4WP0d4=; b=BZotQSZxKtBWs/cm7eOmpuFfiptXOFFZv8VCHt22C/DCCNFQiglP4fNB tkyu0CfSYH1NlpdJ0efSyDOxU07ZfKOYjyJY4eXXrTxLPptEGO8baCO3O oiEtqBXUzaY0DauSNR1ojvjVMZxkOVj5MVNhAl9jZ+qds5W+jakjbucBX yPotslkyuolfp54UI2UfcESOKJGvoqF2Jmaj6c82iEDH9jBokrkkLPjJZ dCQJM1X4OJgbOJzbwlsy09RTE0kwpcVaUUZaNKtrVqtGfd9I2CvRdgq+Y Swzf4M1Gwk43VWebLn82j09KBA/6PNGV25LkaLazRhysls6FX07hHkSwX w==; X-IronPort-AV: E=McAfee;i="6600,9927,10950"; a="5867072" X-IronPort-AV: E=Sophos;i="6.04,188,1695711600"; d="scan'208";a="5867072" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2024 23:43:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,188,1695711600"; d="scan'208";a="17317600" Received: from kandpal-x299-ud4-pro.iind.intel.com ([10.190.239.32]) by fmviesa002.fm.intel.com with ESMTP; 11 Jan 2024 23:43:42 -0800 From: Suraj Kandpal To: intel-gfx@lists.freedesktop.org Subject: [PATCH 7/7] drm/i915/display: fastset tbt pll thing Date: Fri, 12 Jan 2024 13:11:20 +0530 Message-Id: <20240112074120.159797-8-suraj.kandpal@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240112074120.159797-1-suraj.kandpal@intel.com> References: <20240112074120.159797-1-suraj.kandpal@intel.com> MIME-Version: 1.0 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Ville Syrjälä Some DPCD registers(HDCP related) were not accessible due to some fastset config this fixes that. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c index ef57dad1a9cb..1008e18177c9 100644 --- a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c +++ b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c @@ -3308,6 +3308,8 @@ static int icl_compute_tc_phy_dplls(struct intel_atomic_state *state, struct drm_i915_private *i915 = to_i915(state->base.dev); struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); + const struct intel_crtc_state *old_crtc_state = + intel_atomic_get_old_crtc_state(state, crtc); struct icl_port_dpll *port_dpll = &crtc_state->icl_port_dplls[ICL_PORT_DPLL_DEFAULT]; struct skl_wrpll_params pll_params = {}; @@ -3326,7 +3328,11 @@ static int icl_compute_tc_phy_dplls(struct intel_atomic_state *state, return ret; /* this is mainly for the fastset check */ - icl_set_active_port_dpll(crtc_state, ICL_PORT_DPLL_MG_PHY); + if (old_crtc_state->shared_dpll && + old_crtc_state->shared_dpll->info->id == DPLL_ID_ICL_TBTPLL) + icl_set_active_port_dpll(crtc_state, ICL_PORT_DPLL_DEFAULT); + else + icl_set_active_port_dpll(crtc_state, ICL_PORT_DPLL_MG_PHY); crtc_state->port_clock = icl_ddi_mg_pll_get_freq(i915, NULL, &port_dpll->hw_state);