From patchwork Fri Feb 7 10:41:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13964775 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 45DBAC02194 for ; Fri, 7 Feb 2025 10:41:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DA86010EAA5; Fri, 7 Feb 2025 10:41:27 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="BJU724J9"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1D21A10EAA5; Fri, 7 Feb 2025 10:41:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738924886; x=1770460886; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FFTejVT4fMS/SHOodQ9Mww67LbT9pzXnFtyerAgxPZY=; b=BJU724J92zt2JYiAcbb+joUgcW3S9jyYwMb4GoWf1ARPV2VT96WPKr2y +m7sjh1UYxFtG7iUQYQQKrIoxMBwgP9c46CM5GDumK0xFvPQgUv0QnxeW 02IyNeO+xlOg4IIb2HRZu8hepxuqhzE3QeVCKWqFc/LcyGy0Kpx2itZgt EXAJbxso9X3vVN5Y4rzRKtzXqev3g8TlpnzunwLTl+sKJdUHicpX3IkUJ 0LcExMijxif/3wV+lPRLmi4ZYdgqLypE5YhTrfJ7Dnyea/Sn3h6jVQKlX 7NXDCiPU+Kd1ufxImLK6TqHk52WT3gZHooFaxS63kSo8M/PwiAiI9aUSV Q==; X-CSE-ConnectionGUID: eaFN7y37QoCMTduuWV56Ag== X-CSE-MsgGUID: JdeayuThR7uU6p8kFoIu5g== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50200463" X-IronPort-AV: E=Sophos;i="6.13,266,1732608000"; d="scan'208";a="50200463" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2025 02:41:25 -0800 X-CSE-ConnectionGUID: 4bkvpk0QRheJajabD2gkyg== X-CSE-MsgGUID: fjuwf1UJRo2ZljFdhhTB9g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="111341621" Received: from dprybysh-mobl.ger.corp.intel.com (HELO localhost) ([10.245.246.122]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2025 02:41:23 -0800 From: Jani Nikula To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jani.nikula@intel.com, suraj.kandpal@intel.com Subject: [PATCH 1/3] drm/i915/hdcp: Move HDCP debugfs to intel_hdcp.c Date: Fri, 7 Feb 2025 12:41:10 +0200 Message-Id: X-Mailer: git-send-email 2.39.5 In-Reply-To: References: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" Continue with placing debugfs next to the implementation. intel_connector_info() still needs intel_hdcp_info(), so we'll need to expose that too. Cc: Suraj Kandpal Signed-off-by: Jani Nikula Reviewed-by: Suraj Kandpal --- .../drm/i915/display/intel_display_debugfs.c | 74 +---------------- drivers/gpu/drm/i915/display/intel_hdcp.c | 82 +++++++++++++++++++ drivers/gpu/drm/i915/display/intel_hdcp.h | 4 + 3 files changed, 88 insertions(+), 72 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c index 926f09c35084..e547ea66657d 100644 --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c @@ -213,38 +213,6 @@ static void intel_panel_info(struct seq_file *m, intel_seq_print_mode(m, 2, fixed_mode); } -static void intel_hdcp_info(struct seq_file *m, - struct intel_connector *intel_connector, - bool remote_req) -{ - bool hdcp_cap = false, hdcp2_cap = false; - - if (!intel_connector->hdcp.shim) { - seq_puts(m, "No Connector Support"); - goto out; - } - - if (remote_req) { - intel_hdcp_get_remote_capability(intel_connector, - &hdcp_cap, - &hdcp2_cap); - } else { - hdcp_cap = intel_hdcp_get_capability(intel_connector); - hdcp2_cap = intel_hdcp2_get_capability(intel_connector); - } - - if (hdcp_cap) - seq_puts(m, "HDCP1.4 "); - if (hdcp2_cap) - seq_puts(m, "HDCP2.2 "); - - if (!hdcp_cap && !hdcp2_cap) - seq_puts(m, "None"); - -out: - seq_puts(m, "\n"); -} - static void intel_dp_info(struct seq_file *m, struct intel_connector *connector) { struct intel_encoder *intel_encoder = intel_attached_encoder(connector); @@ -309,12 +277,7 @@ static void intel_connector_info(struct seq_file *m, break; } - seq_puts(m, "\tHDCP version: "); - if (intel_connector->mst_port) { - intel_hdcp_info(m, intel_connector, true); - seq_puts(m, "\tMST Hub HDCP version: "); - } - intel_hdcp_info(m, intel_connector, false); + intel_hdcp_info(m, intel_connector); seq_printf(m, "\tmax bpc: %u\n", connector->display_info.bpc); @@ -893,33 +856,6 @@ void intel_display_debugfs_register(struct drm_i915_private *i915) intel_display_debugfs_params(display); } -static int i915_hdcp_sink_capability_show(struct seq_file *m, void *data) -{ - struct intel_connector *connector = m->private; - struct drm_i915_private *i915 = to_i915(connector->base.dev); - int ret; - - ret = drm_modeset_lock_single_interruptible(&i915->drm.mode_config.connection_mutex); - if (ret) - return ret; - - if (!connector->base.encoder || - connector->base.status != connector_status_connected) { - ret = -ENODEV; - goto out; - } - - seq_printf(m, "%s:%d HDCP version: ", connector->base.name, - connector->base.base.id); - intel_hdcp_info(m, connector, false); - -out: - drm_modeset_unlock(&i915->drm.mode_config.connection_mutex); - - return ret; -} -DEFINE_SHOW_ATTRIBUTE(i915_hdcp_sink_capability); - static int i915_lpsp_capability_show(struct seq_file *m, void *data) { struct intel_connector *connector = m->private; @@ -1401,18 +1337,12 @@ void intel_connector_debugfs_add(struct intel_connector *connector) return; intel_drrs_connector_debugfs_add(connector); + intel_hdcp_connector_debugfs_add(connector); intel_pps_connector_debugfs_add(connector); intel_psr_connector_debugfs_add(connector); intel_alpm_lobf_debugfs_add(connector); intel_dp_link_training_debugfs_add(connector); - if (connector_type == DRM_MODE_CONNECTOR_DisplayPort || - connector_type == DRM_MODE_CONNECTOR_HDMIA || - connector_type == DRM_MODE_CONNECTOR_HDMIB) { - debugfs_create_file("i915_hdcp_sink_capability", 0444, root, - connector, &i915_hdcp_sink_capability_fops); - } - if (DISPLAY_VER(i915) >= 11 && ((connector_type == DRM_MODE_CONNECTOR_DisplayPort && !connector->mst_port) || connector_type == DRM_MODE_CONNECTOR_eDP)) { diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c index 7cc0399b2a5d..718d8bad77a0 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c @@ -9,6 +9,7 @@ */ #include +#include #include #include @@ -2731,3 +2732,84 @@ void intel_hdcp_handle_cp_irq(struct intel_connector *connector) queue_delayed_work(i915->unordered_wq, &hdcp->check_work, 0); } + +static void __intel_hdcp_info(struct seq_file *m, struct intel_connector *intel_connector, + bool remote_req) +{ + bool hdcp_cap = false, hdcp2_cap = false; + + if (!intel_connector->hdcp.shim) { + seq_puts(m, "No Connector Support"); + goto out; + } + + if (remote_req) { + intel_hdcp_get_remote_capability(intel_connector, + &hdcp_cap, + &hdcp2_cap); + } else { + hdcp_cap = intel_hdcp_get_capability(intel_connector); + hdcp2_cap = intel_hdcp2_get_capability(intel_connector); + } + + if (hdcp_cap) + seq_puts(m, "HDCP1.4 "); + if (hdcp2_cap) + seq_puts(m, "HDCP2.2 "); + + if (!hdcp_cap && !hdcp2_cap) + seq_puts(m, "None"); + +out: + seq_puts(m, "\n"); +} + +void intel_hdcp_info(struct seq_file *m, struct intel_connector *connector) +{ + seq_puts(m, "\tHDCP version: "); + if (connector->mst_port) { + __intel_hdcp_info(m, connector, true); + seq_puts(m, "\tMST Hub HDCP version: "); + } + __intel_hdcp_info(m, connector, false); +} + +static int intel_hdcp_sink_capability_show(struct seq_file *m, void *data) +{ + struct intel_connector *connector = m->private; + struct drm_i915_private *i915 = to_i915(connector->base.dev); + int ret; + + ret = drm_modeset_lock_single_interruptible(&i915->drm.mode_config.connection_mutex); + if (ret) + return ret; + + if (!connector->base.encoder || + connector->base.status != connector_status_connected) { + ret = -ENODEV; + goto out; + } + + seq_printf(m, "%s:%d HDCP version: ", connector->base.name, + connector->base.base.id); + __intel_hdcp_info(m, connector, false); + +out: + drm_modeset_unlock(&i915->drm.mode_config.connection_mutex); + + return ret; +} +DEFINE_SHOW_ATTRIBUTE(intel_hdcp_sink_capability); + +void intel_hdcp_connector_debugfs_add(struct intel_connector *connector) +{ + struct dentry *root = connector->base.debugfs_entry; + int connector_type = connector->base.connector_type; + + if (connector_type == DRM_MODE_CONNECTOR_DisplayPort || + connector_type == DRM_MODE_CONNECTOR_HDMIA || + connector_type == DRM_MODE_CONNECTOR_HDMIB) { + debugfs_create_file("i915_hdcp_sink_capability", 0444, root, + connector, &intel_hdcp_sink_capability_fops); + } +} diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.h b/drivers/gpu/drm/i915/display/intel_hdcp.h index d99830cfb798..76bd3996f636 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.h +++ b/drivers/gpu/drm/i915/display/intel_hdcp.h @@ -19,6 +19,7 @@ struct intel_digital_port; struct intel_display; struct intel_encoder; struct intel_hdcp_shim; +struct seq_file; enum port; enum transcoder; @@ -48,4 +49,7 @@ void intel_hdcp_component_fini(struct intel_display *display); void intel_hdcp_cleanup(struct intel_connector *connector); void intel_hdcp_handle_cp_irq(struct intel_connector *connector); +void intel_hdcp_info(struct seq_file *m, struct intel_connector *connector); +void intel_hdcp_connector_debugfs_add(struct intel_connector *connector); + #endif /* __INTEL_HDCP_H__ */ From patchwork Fri Feb 7 10:41:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13964777 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 B18C3C02196 for ; Fri, 7 Feb 2025 10:41:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 57E8710EAAA; Fri, 7 Feb 2025 10:41:32 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Z+XN4uQ5"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id EBF5E10EAAA; Fri, 7 Feb 2025 10:41: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=1738924891; x=1770460891; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZcJzxECwPGKlc3m0U1BxpG72AZ3DoQtePbUKYbIAS6w=; b=Z+XN4uQ5o5w3dJxK1gO753fR4JAkk9AZ3DydKIZf20BKedvOcfh7zV6R iaUYyzEl9f15ZX5tOb3BosJ+J9oJ+krH/icOfG3HzJ/pmyN2GU5ZCCyDJ NgLVHfBjCk+Z091I/Uz/38CCauKqHp0yHHzyw/uLrseagsm7pHYeW2VHa 2lJN7GxNmCfayIx1Y3Sl4UUn/+QLC2aIbvIkFZ1PxgvzXZ/yZi0MstPdt O0LS/33/tTTOZf19GamuL5xjxgY5gzrmlicMtGQfrSah29ou42UxB2kbi 2aZdk1GcXdZvPRy2st4WPCl/EQ0kr2FCLIRfN/zvyXGQxqsM7t5YALT7B A==; X-CSE-ConnectionGUID: dYerjIatS6aL3hSfNVXlYA== X-CSE-MsgGUID: vS8igWI/QTWL/BNaxEG+sA== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50200467" X-IronPort-AV: E=Sophos;i="6.13,266,1732608000"; d="scan'208";a="50200467" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2025 02:41:31 -0800 X-CSE-ConnectionGUID: ge0BBDYHTG+bWwxRmtKWZQ== X-CSE-MsgGUID: gsAw/ErETuSpqJqtVy33PA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="111341635" Received: from dprybysh-mobl.ger.corp.intel.com (HELO localhost) ([10.245.246.122]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2025 02:41:29 -0800 From: Jani Nikula To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jani.nikula@intel.com, suraj.kandpal@intel.com Subject: [PATCH 2/3] drm/i915/hdcp: rename intel_connector to connector Date: Fri, 7 Feb 2025 12:41:11 +0200 Message-Id: <8f43542a8f0ce0ec5725b769c077d3cea723bde0.1738924826.git.jani.nikula@intel.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: References: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" Follow the current convention of naming struct intel_connector pointers connector. Cc: Suraj Kandpal Signed-off-by: Jani Nikula Reviewed-by: Suraj Kandpal --- drivers/gpu/drm/i915/display/intel_hdcp.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c index 718d8bad77a0..9880192adfe9 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c @@ -2733,23 +2733,21 @@ void intel_hdcp_handle_cp_irq(struct intel_connector *connector) queue_delayed_work(i915->unordered_wq, &hdcp->check_work, 0); } -static void __intel_hdcp_info(struct seq_file *m, struct intel_connector *intel_connector, +static void __intel_hdcp_info(struct seq_file *m, struct intel_connector *connector, bool remote_req) { bool hdcp_cap = false, hdcp2_cap = false; - if (!intel_connector->hdcp.shim) { + if (!connector->hdcp.shim) { seq_puts(m, "No Connector Support"); goto out; } if (remote_req) { - intel_hdcp_get_remote_capability(intel_connector, - &hdcp_cap, - &hdcp2_cap); + intel_hdcp_get_remote_capability(connector, &hdcp_cap, &hdcp2_cap); } else { - hdcp_cap = intel_hdcp_get_capability(intel_connector); - hdcp2_cap = intel_hdcp2_get_capability(intel_connector); + hdcp_cap = intel_hdcp_get_capability(connector); + hdcp2_cap = intel_hdcp2_get_capability(connector); } if (hdcp_cap) From patchwork Fri Feb 7 10:41:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13964778 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 BFE96C02196 for ; Fri, 7 Feb 2025 10:41:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 691A110EAB2; Fri, 7 Feb 2025 10:41:38 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="kYhxSPNL"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id C21B210EAB0; Fri, 7 Feb 2025 10:41: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=1738924897; x=1770460897; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tjDmmSKeIpybed6DhNXALqx3irxrvxz7I48P+eMzm0Y=; b=kYhxSPNL0MiDds+bdMU0UoMd38NAJRBDuGhYPQHTogdRPIn4kKDwoX2+ UsOd7libo/emvZkqumCWkzaLRMkXQ5/KSCUZMh1UXgtuD8Xft9WFugz2Q E+pR5/buqmcluF4CFCp3Wag7glwxCi/tWOiGgme65cONTa/NPz0oXRH7y EAwYhpwdDOiIS6H/S82Wb6VCAramGxlBJHi5xbMcME1cJCoEiW0cYTvro 9C2lhnJjC1J7jpnJnzYtUUaxljKxO+b6oSeWd2/CrH/DditC7MnkPhl0Z aYSfWiqUTkl8ijdd0t7vwW31MkooA/qkxudZvs2boyWtoWn2gNaLyqRMu w==; X-CSE-ConnectionGUID: wV5cEXioThy+xv1qmPgZ8Q== X-CSE-MsgGUID: xD4kzW3cQJaeMh8lQ1sjog== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="50200469" X-IronPort-AV: E=Sophos;i="6.13,266,1732608000"; d="scan'208";a="50200469" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2025 02:41:36 -0800 X-CSE-ConnectionGUID: D4Hjua75TIW4fiHcSyEetA== X-CSE-MsgGUID: PSRnrc4fRV+OjDdlYCh7HQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="111341643" Received: from dprybysh-mobl.ger.corp.intel.com (HELO localhost) ([10.245.246.122]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2025 02:41:34 -0800 From: Jani Nikula To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jani.nikula@intel.com, suraj.kandpal@intel.com Subject: [PATCH 3/3] drm/i915/hdcp: Convert platform checks to use display->platform Date: Fri, 7 Feb 2025 12:41:12 +0200 Message-Id: <58bad1e888a57a014acbaae67ccddd4f895091a7.1738924826.git.jani.nikula@intel.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: References: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" Prefer display->platform. over IS_(i915), and reducate struct drm_i915_private usages while at it. Cc: Suraj Kandpal Signed-off-by: Jani Nikula Reviewed-by: Suraj Kandpal --- drivers/gpu/drm/i915/display/intel_hdcp.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c index 9880192adfe9..3d83db793baf 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c @@ -343,7 +343,7 @@ static bool hdcp_key_loadable(struct intel_display *display) * On HSW and BDW, Display HW loads the Key as soon as Display resumes. * On all BXT+, SW can load the keys only when the PW#1 is turned on. */ - if (IS_HASWELL(i915) || IS_BROADWELL(i915)) + if (display->platform.haswell || display->platform.broadwell) id = HSW_DISP_PW_GLOBAL; else id = SKL_DISP_PW_1; @@ -382,7 +382,7 @@ static int intel_hdcp_load_keys(struct intel_display *display) * On HSW and BDW HW loads the HDCP1.4 Key when Display comes * out of reset. So if Key is not already loaded, its an error state. */ - if (IS_HASWELL(i915) || IS_BROADWELL(i915)) + if (display->platform.haswell || display->platform.broadwell) if (!(intel_de_read(display, HDCP_KEY_STATUS) & HDCP_KEY_LOAD_DONE)) return -ENXIO; @@ -394,7 +394,7 @@ static int intel_hdcp_load_keys(struct intel_display *display) * process from other platforms. These platforms use the GT Driver * Mailbox interface. */ - if (DISPLAY_VER(display) == 9 && !IS_BROXTON(i915)) { + if (DISPLAY_VER(display) == 9 && !display->platform.broxton) { ret = snb_pcode_write(&i915->uncore, SKL_PCODE_LOAD_HDCP_KEYS, 1); if (ret) { drm_err(display->drm, @@ -2339,18 +2339,16 @@ static int initialize_hdcp_port_data(struct intel_connector *connector, static bool is_hdcp2_supported(struct intel_display *display) { - struct drm_i915_private *i915 = to_i915(display->drm); - if (intel_hdcp_gsc_cs_required(display)) return true; if (!IS_ENABLED(CONFIG_INTEL_MEI_HDCP)) return false; - return (DISPLAY_VER(display) >= 10 || - IS_KABYLAKE(i915) || - IS_COFFEELAKE(i915) || - IS_COMETLAKE(i915)); + return DISPLAY_VER(display) >= 10 || + display->platform.kabylake || + display->platform.coffeelake || + display->platform.cometlake; } void intel_hdcp_component_init(struct intel_display *display) @@ -2775,10 +2773,10 @@ void intel_hdcp_info(struct seq_file *m, struct intel_connector *connector) static int intel_hdcp_sink_capability_show(struct seq_file *m, void *data) { struct intel_connector *connector = m->private; - struct drm_i915_private *i915 = to_i915(connector->base.dev); + struct intel_display *display = to_intel_display(connector); int ret; - ret = drm_modeset_lock_single_interruptible(&i915->drm.mode_config.connection_mutex); + ret = drm_modeset_lock_single_interruptible(&display->drm->mode_config.connection_mutex); if (ret) return ret; @@ -2793,7 +2791,7 @@ static int intel_hdcp_sink_capability_show(struct seq_file *m, void *data) __intel_hdcp_info(m, connector, false); out: - drm_modeset_unlock(&i915->drm.mode_config.connection_mutex); + drm_modeset_unlock(&display->drm->mode_config.connection_mutex); return ret; } From patchwork Fri Feb 7 10:58:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13964794 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 5F94FC02194 for ; Fri, 7 Feb 2025 10:58:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E219F10EABC; Fri, 7 Feb 2025 10:58:52 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="UN6xAMOE"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5098910EABB; Fri, 7 Feb 2025 10:58:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738925928; x=1770461928; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NaKMljhdH+x+L/Xf2y9MXjLOeD6IJnFsFWG8szL0yGM=; b=UN6xAMOERPiJSOPFih7ufysgRsxICvnKJZ/9raCIkw2mn4Tbev/sXe1V tDckcDSMv+BthopSWMEKcHzMMlj+16rBilxN5E4rpaoS32/eGpSYiMjKy wt2uUN3Xcjg5YhfL0mIN/tvTaM6BwhO7Fb8JgXZ/E+umGHM5C9978dOna bINpNJV8zm0ZGduoSIcaD+cHQPDIQS8AxcW7DJD2YCciWlQv/s+PCk5It u/rrBQ89t0FH/5RU/QGUvAXeHsFHzcTEieBgh3yNX8sG7EbdpIQASDrEl 3c2L2iUBNhn9LdpNtyZJK6d1rSDHoE95Mes2A02023Z1+G9FVISnl568N A==; X-CSE-ConnectionGUID: +zuWiX72Sk2rcrYcj75aZQ== X-CSE-MsgGUID: 4cHowcNlTH+GHZsA2r1ZGg== X-IronPort-AV: E=McAfee;i="6700,10204,11336"; a="43224061" X-IronPort-AV: E=Sophos;i="6.13,266,1732608000"; d="scan'208";a="43224061" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2025 02:58:48 -0800 X-CSE-ConnectionGUID: sdlsmdliR56xJR2wPK/0hg== X-CSE-MsgGUID: 5/mW4n0FRsSzD2w0Pf0adw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="148709092" Received: from dprybysh-mobl.ger.corp.intel.com (HELO localhost) ([10.245.246.122]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2025 02:58:46 -0800 From: Jani Nikula To: Jani Nikula , intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: suraj.kandpal@intel.com Subject: [PATCH 4/3] drm/i915/hdcp: Make some functions static Date: Fri, 7 Feb 2025 12:58:38 +0200 Message-Id: <20250207105838.179805-1-jani.nikula@intel.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: References: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" With the debugfs implementation moved next to the implementation, we no longer need to expose some of the functions. Make them static. Cc: Suraj Kandpal Signed-off-by: Jani Nikula Reviewed-by: Suraj Kandpal --- drivers/gpu/drm/i915/display/intel_hdcp.c | 10 +++++----- drivers/gpu/drm/i915/display/intel_hdcp.h | 6 ------ 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c index 3d83db793baf..1aa4c0fd216f 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c @@ -209,7 +209,7 @@ int intel_hdcp_read_valid_bksv(struct intel_digital_port *dig_port, } /* Is HDCP1.4 capable on Platform and Sink */ -bool intel_hdcp_get_capability(struct intel_connector *connector) +static bool intel_hdcp_get_capability(struct intel_connector *connector) { struct intel_digital_port *dig_port; const struct intel_hdcp_shim *shim = connector->hdcp.shim; @@ -265,7 +265,7 @@ static bool intel_hdcp2_prerequisite(struct intel_connector *connector) } /* Is HDCP2.2 capable on Platform and Sink */ -bool intel_hdcp2_get_capability(struct intel_connector *connector) +static bool intel_hdcp2_get_capability(struct intel_connector *connector) { struct intel_hdcp *hdcp = &connector->hdcp; bool capable = false; @@ -279,9 +279,9 @@ bool intel_hdcp2_get_capability(struct intel_connector *connector) return capable; } -void intel_hdcp_get_remote_capability(struct intel_connector *connector, - bool *hdcp_capable, - bool *hdcp2_capable) +static void intel_hdcp_get_remote_capability(struct intel_connector *connector, + bool *hdcp_capable, + bool *hdcp2_capable) { struct intel_hdcp *hdcp = &connector->hdcp; diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.h b/drivers/gpu/drm/i915/display/intel_hdcp.h index 76bd3996f636..3a7905551051 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.h +++ b/drivers/gpu/drm/i915/display/intel_hdcp.h @@ -21,7 +21,6 @@ struct intel_encoder; struct intel_hdcp_shim; struct seq_file; enum port; -enum transcoder; void intel_hdcp_atomic_check(struct drm_connector *connector, struct drm_connector_state *old_state, @@ -39,11 +38,6 @@ void intel_hdcp_update_pipe(struct intel_atomic_state *state, const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state); bool is_hdcp_supported(struct intel_display *display, enum port port); -bool intel_hdcp_get_capability(struct intel_connector *connector); -bool intel_hdcp2_get_capability(struct intel_connector *connector); -void intel_hdcp_get_remote_capability(struct intel_connector *connector, - bool *hdcp_capable, - bool *hdcp2_capable); void intel_hdcp_component_init(struct intel_display *display); void intel_hdcp_component_fini(struct intel_display *display); void intel_hdcp_cleanup(struct intel_connector *connector);