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 993D7CA0EFF for ; Fri, 22 Aug 2025 23:21:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A0A9B10EBD0; Fri, 22 Aug 2025 23:21:58 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="MXOtmP+2"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3CCF210E012; Fri, 22 Aug 2025 23:21:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1755904917; x=1787440917; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RiRs9vA5x5XJ4z81lWKfDkZfEUjMItcF6E9t32y0f4U=; b=MXOtmP+2bel5qdW9pCSM+oJ01oB08OvoGpzrf9Tk8wCGpKt0oVeH0WdR eP0SHveel6cCydiF2jhwdsECOtXuV+MfIIm8sdCWep+XVCuonXmd495TI BBP5+1CgciYC5+yANLEe2eCe6raRJC7YqsExDQXHdNwpH+SsfQrNZzS4s hutmQy9A+ronZtp691ygu1GswiqACNX3cultDlESKMuYYhV1rL2F7zj2W U4TzSgyRpOG8vxIvKeLe6Xqa0J0A/oGlKWiQh5NY6ejXiYLNmeRlm57KN tWP+gx8ZHVBpyVArrEcLadMd2D7OskH5hCodLDfCZF3B22K/yDHJAfJ8u A==; X-CSE-ConnectionGUID: qGqko0adS/uTqX8cbuKbeQ== X-CSE-MsgGUID: 10663CGxQhOQCoztOj3hVw== X-IronPort-AV: E=McAfee;i="6800,10657,11529"; a="58143525" X-IronPort-AV: E=Sophos;i="6.17,312,1747724400"; d="scan'208";a="58143525" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2025 16:21:57 -0700 X-CSE-ConnectionGUID: wgleP4+MQxqUYUqTmGx2ZQ== X-CSE-MsgGUID: wxsJECXKRpOJn9gOn9fpUw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.17,312,1747724400"; d="scan'208";a="168049353" Received: from administrator-system-product-name.igk.intel.com ([10.91.214.181]) by orviesa010.jf.intel.com with ESMTP; 22 Aug 2025 16:21:56 -0700 From: =?UTF-8?q?Micha=C5=82=20Grzelak?= To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jouni.hogander@intel.com, =?UTF-8?q?Micha=C5=82=20Grzelak?= Subject: [PATCH v6 1/1] drm/i915/display: Add no_psr_reason to PSR debugfs Date: Sat, 23 Aug 2025 01:23:21 +0200 Message-ID: <20250822232321.657000-2-michal.grzelak@intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250822232321.657000-1-michal.grzelak@intel.com> References: <20250822232321.657000-1-michal.grzelak@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Organization: Intel Technology Poland sp. z o.o. - ul. Slowackiego 173, 80-298 Gdansk - KRS 101882 - NIP 957-07-52-316 Content-Transfer-Encoding: 8bit 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" There is no reason in debugfs why PSR has been disabled. Add no_psr_reason field into struct intel_psr. Write the reason, e.g. PSR setup timing not met, into proper PSR debugfs file. Clean it when PSR is activated. Refactor intel_psr_post_plane_update by using no_psr_reason instead of boolean keep_disabled. Signed-off-by: MichaƂ Grzelak --- .../drm/i915/display/intel_display_types.h | 2 ++ drivers/gpu/drm/i915/display/intel_psr.c | 31 ++++++++++--------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index ce45261c4a8f..bcff1a21f2be 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -1685,6 +1685,8 @@ struct intel_psr { bool link_ok; u8 active_non_psr_pipes; + + const char *no_psr_reason; }; struct intel_dp { diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index ae9053919211..e12f387f1aba 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -1590,6 +1590,7 @@ static bool _psr_compute_config(struct intel_dp *intel_dp, if (entry_setup_frames >= 0) { intel_dp->psr.entry_setup_frames = entry_setup_frames; } else { + intel_dp->psr.no_psr_reason = "PSR setup timing not met"; drm_dbg_kms(display->drm, "PSR condition failed: PSR setup timing not met\n"); return false; @@ -1819,6 +1820,7 @@ static void intel_psr_activate(struct intel_dp *intel_dp) hsw_activate_psr1(intel_dp); intel_dp->psr.active = true; + intel_dp->psr.no_psr_reason = NULL; } /* @@ -2969,28 +2971,29 @@ void intel_psr_post_plane_update(struct intel_atomic_state *state, crtc_state->uapi.encoder_mask) { struct intel_dp *intel_dp = enc_to_intel_dp(encoder); struct intel_psr *psr = &intel_dp->psr; - bool keep_disabled = false; mutex_lock(&psr->lock); drm_WARN_ON(display->drm, psr->enabled && !crtc_state->active_planes); - keep_disabled |= psr->sink_not_reliable; - keep_disabled |= !crtc_state->active_planes; + if (psr->sink_not_reliable) + psr->no_psr_reason = "Sink not reliable"; + if (!crtc_state->active_planes) + psr->no_psr_reason = "All planes inactive"; /* Display WA #1136: skl, bxt */ - keep_disabled |= DISPLAY_VER(display) < 11 && - crtc_state->wm_level_disabled; + if (DISPLAY_VER(display) < 11 && crtc_state->wm_level_disabled) + psr->no_psr_reason = "Workaround for skl, bxt"; - if (!psr->enabled && !keep_disabled) + if (!psr->enabled && !psr->no_psr_reason) intel_psr_enable_locked(intel_dp, crtc_state); else if (psr->enabled && !crtc_state->wm_level_disabled) /* Wa_14015648006 */ wm_optimization_wa(intel_dp, crtc_state); /* Force a PSR exit when enabling CRC to avoid CRC timeouts */ - if (crtc_state->crc_enabled && psr->enabled) + if (psr->enabled && crtc_state->crc_enabled) intel_psr_force_update(intel_dp); /* @@ -3949,12 +3952,7 @@ static void intel_psr_print_mode(struct intel_dp *intel_dp, struct seq_file *m) { struct intel_psr *psr = &intel_dp->psr; - const char *status, *mode, *region_et; - - if (psr->enabled) - status = " enabled"; - else - status = "disabled"; + const char *mode, *region_et; if (psr->panel_replay_enabled && psr->sel_update_enabled) mode = "Panel Replay Selective Update"; @@ -3972,7 +3970,12 @@ static void intel_psr_print_mode(struct intel_dp *intel_dp, else region_et = ""; - seq_printf(m, "PSR mode: %s%s%s\n", mode, status, region_et); + if (psr->enabled) { + seq_puts(m, "PSR enabled\n"); + seq_printf(m, "PSR mode: %s%s\n", mode, region_et); + } else { + seq_printf(m, "PSR disabled: %s\n", psr->no_psr_reason); + } } static int intel_psr_status(struct seq_file *m, struct intel_dp *intel_dp) -- 2.45.2