From patchwork Mon Apr 18 20:52:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Souza, Jose" X-Patchwork-Id: 12817089 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 1D5EAC433EF for ; Mon, 18 Apr 2022 20:50:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 73CC789E05; Mon, 18 Apr 2022 20:50:47 +0000 (UTC) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id A665989E05 for ; Mon, 18 Apr 2022 20:50: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=1650315045; x=1681851045; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=mfHstl8lwJFGnSJwSRHsYJ3NNX763wDVFj+v4S385Lk=; b=fBXGuscI/ypApY8WFYR/iotNrgB6Jho0VuKvkWhk8mUBadZyGIQ7/14S Rih9+4sIkY7qQ1vvS6VWvq3252Gj67zwvYYE+kK2mFaO00oKdn52wYbEo WVVk9cjiHzQj1Jmta9h9XBBxiXsBI+Vlw52Pmmi9ytx/fB+U9dh2dUIVG 3/X93fhiP5xEO1xHRNOtApNPLDtxXCGOFQ954jPlbR3mj27Bz/X34gjff 3CFHex3fhLYu6yLYuK10ZMkW2xghkERIbrUblcies16HVQwmjlrQ8nZIa PqHX9tGdBJuHS5lKtTRGqiWTDvZFhBPnCB3eYpUv20Pr4cXjMF5P1zKYS A==; X-IronPort-AV: E=McAfee;i="6400,9594,10321"; a="245500921" X-IronPort-AV: E=Sophos;i="5.90,270,1643702400"; d="scan'208";a="245500921" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2022 13:50:45 -0700 X-IronPort-AV: E=Sophos;i="5.90,270,1643702400"; d="scan'208";a="726783092" Received: from josouza-mobl2.fso.intel.com ([10.230.18.139]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2022 13:50:43 -0700 From: =?utf-8?q?Jos=C3=A9_Roberto_de_Souza?= To: intel-gfx@lists.freedesktop.org Date: Mon, 18 Apr 2022 13:52:20 -0700 Message-Id: <20220418205221.291891-1-jose.souza@intel.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 1/2] drm/i915/display/drrs: Split the DRRS status per connector 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" Instead of keep the DRRS status of all connectors/pipe into a single i915_drrs_status what makes user-space parsing terrible moving each eDP connector status to its own folder. As legacy support still returning the DRRS status of the first eDP connector in the main i915_drrs_status. Cc: Ville Syrjälä Signed-off-by: José Roberto de Souza --- .../drm/i915/display/intel_display_debugfs.c | 65 +++++++++++++------ 1 file changed, 46 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c index 452d773fd4e34..0d7d2e750a4c7 100644 --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c @@ -1068,43 +1068,35 @@ static int i915_ddb_info(struct seq_file *m, void *unused) return 0; } -static int i915_drrs_status(struct seq_file *m, void *unused) +static int intel_drrs_status(struct seq_file *m, struct drm_connector *connector) { - struct drm_i915_private *dev_priv = node_to_i915(m->private); - struct drm_connector_list_iter conn_iter; - struct intel_connector *connector; + struct intel_connector *intel_connector = to_intel_connector(connector); + struct drm_i915_private *dev_priv = to_i915(connector->dev); struct intel_crtc *crtc; - drm_connector_list_iter_begin(&dev_priv->drm, &conn_iter); - for_each_intel_connector_iter(connector, &conn_iter) { - seq_printf(m, "[CONNECTOR:%d:%s] DRRS type: %s\n", - connector->base.base.id, connector->base.name, - intel_drrs_type_str(intel_panel_drrs_type(connector))); - } - drm_connector_list_iter_end(&conn_iter); - - seq_puts(m, "\n"); + seq_printf(m, "DRRS type: %s\n", + intel_drrs_type_str(intel_panel_drrs_type(intel_connector))); for_each_intel_crtc(&dev_priv->drm, crtc) { const struct intel_crtc_state *crtc_state = to_intel_crtc_state(crtc->base.state); - seq_printf(m, "[CRTC:%d:%s]:\n", - crtc->base.base.id, crtc->base.name); + if (!(crtc_state->uapi.connector_mask & drm_connector_mask(connector))) + continue; mutex_lock(&crtc->drrs.mutex); /* DRRS Supported */ - seq_printf(m, "\tDRRS Enabled: %s\n", + seq_printf(m, "DRRS Enabled: %s\n", str_yes_no(crtc_state->has_drrs)); - seq_printf(m, "\tDRRS Active: %s\n", + seq_printf(m, "DRRS Active: %s\n", str_yes_no(intel_drrs_is_active(crtc))); - seq_printf(m, "\tBusy_frontbuffer_bits: 0x%X\n", + seq_printf(m, "Busy_frontbuffer_bits: 0x%X\n", crtc->drrs.busy_frontbuffer_bits); - seq_printf(m, "\tDRRS refresh rate: %s\n", + seq_printf(m, "DRRS refresh rate: %s\n", crtc->drrs.refresh_rate == DRRS_REFRESH_RATE_LOW ? "low" : "high"); @@ -1114,6 +1106,28 @@ static int i915_drrs_status(struct seq_file *m, void *unused) return 0; } +static int i915_drrs_status(struct seq_file *m, void *data) +{ + struct drm_i915_private *dev_priv = node_to_i915(m->private); + struct drm_connector_list_iter conn_iter; + struct drm_connector *connector = NULL; + + /* Find the first eDP connector */ + drm_connector_list_iter_begin(&dev_priv->drm, &conn_iter); + drm_for_each_connector_iter(connector, &conn_iter) { + if (connector->connector_type != DRM_MODE_CONNECTOR_eDP) + continue; + + break; + } + drm_connector_list_iter_end(&conn_iter); + + if (!connector) + return -ENODEV; + + return intel_drrs_status(m, connector); +} + static bool intel_lpsp_power_well_enabled(struct drm_i915_private *i915, enum i915_power_well_id power_well_id) @@ -1990,6 +2004,14 @@ static int i915_psr_status_show(struct seq_file *m, void *data) } DEFINE_SHOW_ATTRIBUTE(i915_psr_status); +static int i915_drrs_status_show(struct seq_file *m, void *data) +{ + struct drm_connector *connector = m->private; + + return intel_drrs_status(m, connector); +} +DEFINE_SHOW_ATTRIBUTE(i915_drrs_status); + static int i915_lpsp_capability_show(struct seq_file *m, void *data) { struct drm_connector *connector = m->private; @@ -2232,6 +2254,11 @@ void intel_connector_debugfs_add(struct intel_connector *intel_connector) connector, &i915_psr_status_fops); } + if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { + debugfs_create_file("i915_drrs_status", 0444, root, + connector, &i915_drrs_status_fops); + } + if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort || connector->connector_type == DRM_MODE_CONNECTOR_HDMIA || connector->connector_type == DRM_MODE_CONNECTOR_HDMIB) { From patchwork Mon Apr 18 20:52:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Souza, Jose" X-Patchwork-Id: 12817090 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 98633C433F5 for ; Mon, 18 Apr 2022 20:50:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AD4B110E14B; Mon, 18 Apr 2022 20:50:49 +0000 (UTC) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id AA23889E05 for ; Mon, 18 Apr 2022 20:50:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650315046; x=1681851046; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=H+XVjoD/W+hg3VRVTEzVGEZLgjuTRceV9i2FUQ0WgK0=; b=CdSK7ZozyAwkjr1zbXKZDu3z0o+BynblTspIrqZdvDrD1GmNlw5xkDdM wvbnLBsIAjorjvT1T09lG1mYqAyDPcufaq3YF4Zl4tD7cf4XDr/grE2RN Mv1NNuKT1wyB/wsT/P7c1BuhFbrYUgNGc3YSxGI6nR3tzuhS+u2W4091S 3IN3goHrrlcVYNayZFTH6Kfqbrh02zhOa1BOgtOeA3pMj7pk9tYcQ75ar v09OWxxgImwmKiUxDm+HJpA1aUXkTU6gzHYRXms0crg3evz1ahek9IZ3b m8l6yZA2EWq/hZI7FabuPzomvwDS98k/L2+aJ3BrC+GUEJvNmLw/JSGiR Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10321"; a="245500924" X-IronPort-AV: E=Sophos;i="5.90,270,1643702400"; d="scan'208";a="245500924" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2022 13:50:46 -0700 X-IronPort-AV: E=Sophos;i="5.90,270,1643702400"; d="scan'208";a="726783105" Received: from josouza-mobl2.fso.intel.com ([10.230.18.139]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2022 13:50:45 -0700 From: =?utf-8?q?Jos=C3=A9_Roberto_de_Souza?= To: intel-gfx@lists.freedesktop.org Date: Mon, 18 Apr 2022 13:52:21 -0700 Message-Id: <20220418205221.291891-2-jose.souza@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418205221.291891-1-jose.souza@intel.com> References: <20220418205221.291891-1-jose.souza@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 2/2] drm/i915/display/drrs: Remove repeated DRRS in i915_drrs_status 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" User-space parsing of i915_drrs_status is already broken so lets use this oportunity to drop those repeated "DRRS". It is the DRRS status debugfs so all of this information is related to DRRS and there is no need to mention it each time. Cc: Ville Syrjälä Signed-off-by: José Roberto de Souza --- drivers/gpu/drm/i915/display/intel_display_debugfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c index 0d7d2e750a4c7..799b0d2bbba18 100644 --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c @@ -1074,7 +1074,7 @@ static int intel_drrs_status(struct seq_file *m, struct drm_connector *connector struct drm_i915_private *dev_priv = to_i915(connector->dev); struct intel_crtc *crtc; - seq_printf(m, "DRRS type: %s\n", + seq_printf(m, "Type: %s\n", intel_drrs_type_str(intel_panel_drrs_type(intel_connector))); for_each_intel_crtc(&dev_priv->drm, crtc) { @@ -1087,16 +1087,16 @@ static int intel_drrs_status(struct seq_file *m, struct drm_connector *connector mutex_lock(&crtc->drrs.mutex); /* DRRS Supported */ - seq_printf(m, "DRRS Enabled: %s\n", + seq_printf(m, "Enabled: %s\n", str_yes_no(crtc_state->has_drrs)); - seq_printf(m, "DRRS Active: %s\n", + seq_printf(m, "Active: %s\n", str_yes_no(intel_drrs_is_active(crtc))); seq_printf(m, "Busy_frontbuffer_bits: 0x%X\n", crtc->drrs.busy_frontbuffer_bits); - seq_printf(m, "DRRS refresh rate: %s\n", + seq_printf(m, "Refresh rate: %s\n", crtc->drrs.refresh_rate == DRRS_REFRESH_RATE_LOW ? "low" : "high");