From patchwork Tue Feb 27 12:38:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Modem, Bhanuprakash" X-Patchwork-Id: 13573757 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 CCBB6C5478C for ; Tue, 27 Feb 2024 12:44:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 40A8410E48D; Tue, 27 Feb 2024 12:44:41 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="LwqDCuN6"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0270110E48D for ; Tue, 27 Feb 2024 12:44: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=1709037881; x=1740573881; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=pyZ/PDXHY8O+ecYtBRG97twGvBMVHi6Bb93VvlFEpw8=; b=LwqDCuN65XRYqLrg6FeJGtSVC1BiupxolUoz41ErHoLTF6nFG3cwqCMy pXty5rGt5zx/phPAMTfvNvvafj289ynuHDzTbM81sdcBnnrct813zVXZk KdA8/Q9gi0Ey2ey4pr6hdInsQ76fTtSrenyDf9Sq58gi0peS1Hb0bfss/ eNa/0OZ584LKoRF3EQH8UKP1UEaqR3LyqOZ726yrg2jbGISvglkfC0W9V AhARt3FugkZXe0yMTJ9gyi0pN8rsSsT03Er5I9uNBUM5IsN3o9jjr9udt VPiZQwAL7oBIQ8toBRD2TzGoZovVT4mKc+ezPUCcf3258jUo/dG2XdMA8 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10996"; a="3294932" X-IronPort-AV: E=Sophos;i="6.06,187,1705392000"; d="scan'208";a="3294932" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2024 04:44:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,187,1705392000"; d="scan'208";a="6995610" Received: from bhanu-nuclab.iind.intel.com ([10.145.169.172]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2024 04:44:38 -0800 From: Bhanuprakash Modem To: intel-gfx@lists.freedesktop.org Cc: Bhanuprakash Modem , Jani Nikula , Ankit Nautiyal , Mitul Golani Subject: [PATCH 1/2] drm/i915/display/drrs: Refactor CPU transcoder DRRS check Date: Tue, 27 Feb 2024 18:08:32 +0530 Message-ID: <20240227123833.2799647-1-bhanuprakash.modem@intel.com> X-Mailer: git-send-email 2.43.0 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" Rename cpu_transcoder_has_drrs() to intel_cpu_transcoder_has_drrs() and make it as non-static, therefore it can be re-used. Cc: Jani Nikula Cc: Ankit Nautiyal Cc: Mitul Golani Signed-off-by: Bhanuprakash Modem --- drivers/gpu/drm/i915/display/intel_display.c | 9 +++++++++ drivers/gpu/drm/i915/display/intel_display.h | 2 ++ drivers/gpu/drm/i915/display/intel_dp.c | 11 +---------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 00ac65a14029..2210d3bb2e0a 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -2582,6 +2582,15 @@ void intel_cpu_transcoder_set_m2_n2(struct intel_crtc *crtc, PIPE_LINK_M2(transcoder), PIPE_LINK_N2(transcoder)); } +bool intel_cpu_transcoder_has_drrs(struct drm_i915_private *i915, + enum transcoder cpu_transcoder) +{ + if (HAS_DOUBLE_BUFFERED_M_N(i915)) + return true; + + return intel_cpu_transcoder_has_m2_n2(i915, cpu_transcoder); +} + static void intel_set_transcoder_timings(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); diff --git a/drivers/gpu/drm/i915/display/intel_display.h b/drivers/gpu/drm/i915/display/intel_display.h index f4a0773f0fca..0dc39a8a517e 100644 --- a/drivers/gpu/drm/i915/display/intel_display.h +++ b/drivers/gpu/drm/i915/display/intel_display.h @@ -484,6 +484,8 @@ void intel_cpu_transcoder_get_m1_n1(struct intel_crtc *crtc, void intel_cpu_transcoder_get_m2_n2(struct intel_crtc *crtc, enum transcoder cpu_transcoder, struct intel_link_m_n *m_n); +bool intel_cpu_transcoder_has_drrs(struct drm_i915_private *i915, + enum transcoder cpu_transcoder); int intel_dotclock_calculate(int link_freq, const struct intel_link_m_n *m_n); int intel_crtc_dotclock(const struct intel_crtc_state *pipe_config); enum intel_display_power_domain intel_port_to_power_domain(struct intel_digital_port *dig_port); diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index e13121dc3a03..5c3c0449e866 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -2689,15 +2689,6 @@ intel_dp_compute_hdr_metadata_infoframe_sdp(struct intel_dp *intel_dp, intel_hdmi_infoframe_enable(HDMI_PACKET_TYPE_GAMUT_METADATA); } -static bool cpu_transcoder_has_drrs(struct drm_i915_private *i915, - enum transcoder cpu_transcoder) -{ - if (HAS_DOUBLE_BUFFERED_M_N(i915)) - return true; - - return intel_cpu_transcoder_has_m2_n2(i915, cpu_transcoder); -} - static bool can_enable_drrs(struct intel_connector *connector, const struct intel_crtc_state *pipe_config, const struct drm_display_mode *downclock_mode) @@ -2720,7 +2711,7 @@ static bool can_enable_drrs(struct intel_connector *connector, if (pipe_config->has_pch_encoder) return false; - if (!cpu_transcoder_has_drrs(i915, pipe_config->cpu_transcoder)) + if (!intel_cpu_transcoder_has_drrs(i915, pipe_config->cpu_transcoder)) return false; return downclock_mode && From patchwork Tue Feb 27 12:38:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Modem, Bhanuprakash" X-Patchwork-Id: 13573758 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 0B971C54798 for ; Tue, 27 Feb 2024 12:44:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4ECAD10E4DE; Tue, 27 Feb 2024 12:44:45 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Ya25hyXk"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) by gabe.freedesktop.org (Postfix) with ESMTPS id 01C9B10E4DE for ; Tue, 27 Feb 2024 12:44:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709037883; x=1740573883; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bMrzh8632OLbvHBgW7d0HthGidwFf3H0dKEAUlfXjgw=; b=Ya25hyXkIyUI3BvyL5dIkM+bSMg89EzLVTpwsadAGxUGYFFtsDPKfhI9 6NQ/71sahGofixAeM/zZoOJHgzz4gl1yMiLZrltXvaGMVFroHEmyRPCYE 8C+/zcyCXhm4VX/TAkl9xzsY0arP6n9oZDLfFAvMwc8h+bLnsU1sc3IPc pEhERytTG83P0eIHWLHMBkOgBtjHidaiGABA2moAfxqqCt1agviQ2hbAa vR35cHJCo+ZPZ27eKf50MUft9fgVHg431NirB9MK2EkjhvSyvXmDg6Ubc m3PetmNiPFQvixrvNGCTH1UwqMRAIM9l/3IEWyTQ04IayNwODEtytfEGd w==; X-IronPort-AV: E=McAfee;i="6600,9927,10996"; a="3294934" X-IronPort-AV: E=Sophos;i="6.06,187,1705392000"; d="scan'208";a="3294934" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2024 04:44:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,187,1705392000"; d="scan'208";a="6995616" Received: from bhanu-nuclab.iind.intel.com ([10.145.169.172]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2024 04:44:40 -0800 From: Bhanuprakash Modem To: intel-gfx@lists.freedesktop.org Cc: Bhanuprakash Modem , Jani Nikula , Ankit Nautiyal , Mitul Golani Subject: [PATCH 2/2] drm/i915/display/debugfs: Fix duplicate checks in i915_drrs_status Date: Tue, 27 Feb 2024 18:08:33 +0530 Message-ID: <20240227123833.2799647-2-bhanuprakash.modem@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240227123833.2799647-1-bhanuprakash.modem@intel.com> References: <20240227123833.2799647-1-bhanuprakash.modem@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" Remove duplicate checks for debugfs entry "DRRS capable:". Fixes: (20af10845864) drm/i915/display/debugfs: New entry "DRRS capable" to i915_drrs_status Cc: Jani Nikula Cc: Ankit Nautiyal Cc: Mitul Golani Signed-off-by: Bhanuprakash Modem --- drivers/gpu/drm/i915/display/intel_drrs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_drrs.c b/drivers/gpu/drm/i915/display/intel_drrs.c index 169ef38ff188..e1b2a0e20e05 100644 --- a/drivers/gpu/drm/i915/display/intel_drrs.c +++ b/drivers/gpu/drm/i915/display/intel_drrs.c @@ -312,9 +312,8 @@ static int intel_drrs_debugfs_status_show(struct seq_file *m, void *unused) mutex_lock(&crtc->drrs.mutex); seq_printf(m, "DRRS capable: %s\n", - str_yes_no(crtc_state->has_drrs || - HAS_DOUBLE_BUFFERED_M_N(i915) || - intel_cpu_transcoder_has_m2_n2(i915, crtc_state->cpu_transcoder))); + str_yes_no(intel_cpu_transcoder_has_drrs(i915, + crtc_state->cpu_transcoder))); seq_printf(m, "DRRS enabled: %s\n", str_yes_no(crtc_state->has_drrs));