public inbox for intel-xe@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Dibin Moolakadan Subrahmanian <dibin.moolakadan.subrahmanian@intel.com>
To: "Shankar, Uma" <uma.shankar@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>
Cc: "Manna, Animesh" <animesh.manna@intel.com>,
	"Kurmi, Suresh Kumar" <suresh.kumar.kurmi@intel.com>
Subject: Re: [PATCH 15/19] drm/i915/display: PSR Add delayed work to exit DC3CO
Date: Wed, 22 Apr 2026 20:23:26 +0530	[thread overview]
Message-ID: <f7c62aec-e8e4-4a97-997f-e6b0d94784de@intel.com> (raw)
In-Reply-To: <DM4PR11MB6360B0C68F4C91CFA236A682F4242@DM4PR11MB6360.namprd11.prod.outlook.com>

On 14-04-2026 03:41, Shankar, Uma wrote:
>
>> -----Original Message-----
>> From: Dibin Moolakadan Subrahmanian
>> <dibin.moolakadan.subrahmanian@intel.com>
>> Sent: Thursday, March 26, 2026 10:46 PM
>> To: intel-gfx@lists.freedesktop.org; intel-xe@lists.freedesktop.org
>> Cc: Manna, Animesh <animesh.manna@intel.com>; Shankar, Uma
>> <uma.shankar@intel.com>; Kurmi, Suresh Kumar
>> <suresh.kumar.kurmi@intel.com>
>> Subject: [PATCH 15/19] drm/i915/display: PSR Add delayed work to exit DC3CO
>>
>> For DC3CO, idle_frames is programmed to 0, so PSR does not enter deep sleep.
>> Add delayed work to schedule DC3CO exit after an idle duration derived from
>> frame time (minimum equivalent of 6 frames).
>>
>> The work is re-armed from the PSR flush path on relevant frontbuffer activity, and
>> once the display remains idle, DC3CO is disabled and DC6 is enabled to allow
>> deeper power savings.
>>
>> Signed-off-by: Dibin Moolakadan Subrahmanian
>> <dibin.moolakadan.subrahmanian@intel.com>
>> ---
>>   .../drm/i915/display/intel_display_types.h    |  2 +
>>   drivers/gpu/drm/i915/display/intel_psr.c      | 48 +++++++++++++++++++
>>   2 files changed, 50 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h
>> b/drivers/gpu/drm/i915/display/intel_display_types.h
>> index d0d2cda3d669..0c8958338f76 100644
>> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
>> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
>> @@ -1785,6 +1785,8 @@ struct intel_psr {
>>   	bool irq_aux_error;
>>   	/* DC3CO eligibility used to control PSR configuration */
>>   	bool dc3co_eligible;
>> +	/* DC3CO disable work*/
> Add space before *
>
>> +	struct delayed_work dc3co_work;
>>   	u16 su_w_granularity;
>>   	u16 su_y_granularity;
>>   	bool source_panel_replay_support;
>> diff --git a/drivers/gpu/drm/i915/display/intel_psr.c
>> b/drivers/gpu/drm/i915/display/intel_psr.c
>> index 16a9f4111ac8..f3476118b8d0 100644
>> --- a/drivers/gpu/drm/i915/display/intel_psr.c
>> +++ b/drivers/gpu/drm/i915/display/intel_psr.c
>> @@ -1701,6 +1701,50 @@ static bool intel_psr_needs_wa_18037818876(struct
>> intel_dp *intel_dp,
>>   		!crtc_state->has_sel_update);
>>   }
>>
>> +static void psr2_dc3co_disable_locked(struct intel_dp *intel_dp) {
>> +	struct intel_display *display = to_intel_display(intel_dp);
>> +
>> +	if (intel_dp->psr.dc3co_eligible) {
>> +		intel_dp->psr.dc3co_eligible = false;
>> +		intel_display_power_set_target_dc_state(display,
>> DC_STATE_EN_UPTO_DC6);
> Before switching to DC6, would be good to call cancel_delayed_work so that
> it doesn't get scheduled later and mess up the state.

This function is called frompsr2_dc3co_disable_work() itself, I will add cancel_delayed_work
to intel_psr_disable_locked().

>
>> +	}
>> +}
>> +
>> +static void psr2_dc3co_disable_work(struct work_struct *work) {
>> +	struct intel_dp *intel_dp =
>> +		container_of(work, typeof(*intel_dp), psr.dc3co_work.work);
>> +
>> +	mutex_lock(&intel_dp->psr.lock);
>> +	psr2_dc3co_disable_locked(intel_dp);
>> +	mutex_unlock(&intel_dp->psr.lock);
>> +}
>> +
>> +static void
>> +psr2_dc3co_flush_locked(struct intel_dp *intel_dp, unsigned int frontbuffer_bits,
>> +			enum fb_op_origin origin)
>> +{
>> +	struct intel_display *display = to_intel_display(intel_dp);
>> +
>> +	if (!intel_dp->psr.dc3co_eligible)
>> +		return;
>> +
>> +	if (!intel_dp->psr.sel_update_enabled ||
>> +	    !intel_dp->psr.active)
>> +		return;
>> +	/*
>> +	 * At every frontbuffer flush flip event modified delay of delayed work,
>> +	 * when delayed work schedules that means display has been idle.
>> +	 */
>> +	if (!(frontbuffer_bits &
>> +	    INTEL_FRONTBUFFER_ALL_MASK(intel_dp->psr.pipe)))
>> +		return;
>> +
>> +	mod_delayed_work(display->wq.unordered, &intel_dp->psr.dc3co_work,
>> +			 intel_dp->psr.dc3co_exit_delay);
> Where is this exit_delay assigned, please check. If its 0, work may get executed immediately.

It is assigned in intel_psr_enable_locked() along with other psr struct members.

>
>> +}
>> +
>>   static
>>   void intel_psr_set_non_psr_pipes(struct intel_dp *intel_dp,
>>   				 struct intel_crtc_state *crtc_state) @@ -2273,6
>> +2317,7 @@ void intel_psr_disable(struct intel_dp *intel_dp,
>>
>>   	mutex_unlock(&intel_dp->psr.lock);
>>   	cancel_work_sync(&intel_dp->psr.work);
>> +	cancel_delayed_work_sync(&intel_dp->psr.dc3co_work);
>>   }
>>
>>   /**
>> @@ -2303,6 +2348,7 @@ void intel_psr_pause(struct intel_dp *intel_dp)
>>   	mutex_unlock(&psr->lock);
>>
>>   	cancel_work_sync(&psr->work);
>> +	cancel_delayed_work_sync(&psr->dc3co_work);
>>   }
>>
>>   /**
>> @@ -3527,6 +3573,7 @@ void intel_psr_flush(struct intel_display *display,
>>   		if (origin == ORIGIN_FLIP ||
>>   		    (origin == ORIGIN_CURSOR_UPDATE &&
>>   		     !intel_dp->psr.psr2_sel_fetch_enabled)) {
>> +			psr2_dc3co_flush_locked(intel_dp, frontbuffer_bits,
>> origin);
>>   			goto unlock;
>>   		}
>>
>> @@ -3585,6 +3632,7 @@ void intel_psr_init(struct intel_dp *intel_dp)
>>   		intel_dp->psr.link_standby = connector->panel.vbt.psr.full_link;
>>
>>   	INIT_WORK(&intel_dp->psr.work, intel_psr_work);
>> +	INIT_DELAYED_WORK(&intel_dp->psr.dc3co_work,
>> psr2_dc3co_disable_work);
>>   	mutex_init(&intel_dp->psr.lock);
>>   }
>>
>> --
>> 2.43.0

  reply	other threads:[~2026-04-22 14:53 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-26 17:15 [PATCH 00/19] drm/i915/display: Add DC3CO support Dibin Moolakadan Subrahmanian
2026-03-26 17:15 ` [PATCH 01/19] drm/i915/display: Remove TGL " Dibin Moolakadan Subrahmanian
2026-04-13 20:40   ` Shankar, Uma
2026-04-20 12:01     ` Dibin Moolakadan Subrahmanian
2026-03-26 17:15 ` [PATCH 02/19] drm/i915/display: Replace DC_STATE_EN_DC3CO with DC_STATE_EN_UPTO_DC3CO Dibin Moolakadan Subrahmanian
2026-04-13 20:51   ` Shankar, Uma
2026-04-20 12:04     ` Dibin Moolakadan Subrahmanian
2026-03-26 17:15 ` [PATCH 03/19] drm/i915/display: Use FIELD_PREP() for DC state enable bits Dibin Moolakadan Subrahmanian
2026-04-13 20:54   ` Shankar, Uma
2026-03-26 17:15 ` [PATCH 04/19] drm/i915/display: Add DC3CO DC_STATE enable/disable support Dibin Moolakadan Subrahmanian
2026-04-13 21:03   ` Shankar, Uma
2026-03-26 17:15 ` [PATCH 05/19] drm/i915/display: Validate target DC state against allowed_dc_mask Dibin Moolakadan Subrahmanian
2026-04-13 21:04   ` Shankar, Uma
2026-03-26 17:15 ` [PATCH 06/19] drm/i915/display: Fix HAS_DC3CO() and add DC3CO trigger enum Dibin Moolakadan Subrahmanian
2026-04-13 21:16   ` Shankar, Uma
2026-04-20 12:12     ` Dibin Moolakadan Subrahmanian
2026-04-14  7:11   ` Jani Nikula
2026-04-20 12:17     ` Dibin Moolakadan Subrahmanian
2026-03-26 17:15 ` [PATCH 07/19] drm/i915/display: Add helper to check DC3CO support Dibin Moolakadan Subrahmanian
2026-04-13 21:18   ` Shankar, Uma
2026-04-20 12:21     ` Dibin Moolakadan Subrahmanian
2026-03-26 17:15 ` [PATCH 08/19] drm/i915/display: Add DC3CO eligibility computation Dibin Moolakadan Subrahmanian
2026-04-13 21:42   ` Shankar, Uma
2026-04-22 14:35     ` Dibin Moolakadan Subrahmanian
2026-03-26 17:15 ` [PATCH 09/19] drm/i915/display: Remove unused PSR dc3co_exitline field Dibin Moolakadan Subrahmanian
2026-03-26 17:15 ` [PATCH 10/19] drm/i915/display: Remove unused dc3co_exitline from intel_crtc_state Dibin Moolakadan Subrahmanian
2026-04-13 21:44   ` Shankar, Uma
2026-04-20 12:26     ` Dibin Moolakadan Subrahmanian
2026-03-26 17:15 ` [PATCH 11/19] drm/i915/display: Store DC3CO eligibility in PSR state Dibin Moolakadan Subrahmanian
2026-04-13 21:54   ` Shankar, Uma
2026-03-26 17:15 ` [PATCH 12/19] drm/i915/display: PSR2: Set idle_frames to 0 for DC3CO Dibin Moolakadan Subrahmanian
2026-04-13 21:56   ` Shankar, Uma
2026-04-22 14:37     ` Dibin Moolakadan Subrahmanian
2026-03-26 17:15 ` [PATCH 13/19] drm/i915/display: Define DC3CO idle protocol bit in PR_ALPM_CTL Dibin Moolakadan Subrahmanian
2026-03-26 17:15 ` [PATCH 14/19] drm/i915/display: Enable DC3CO idle protocol in ALPM Dibin Moolakadan Subrahmanian
2026-04-13 21:58   ` Shankar, Uma
2026-04-22 14:43     ` Dibin Moolakadan Subrahmanian
2026-03-26 17:15 ` [PATCH 15/19] drm/i915/display: PSR Add delayed work to exit DC3CO Dibin Moolakadan Subrahmanian
2026-04-13 22:11   ` Shankar, Uma
2026-04-22 14:53     ` Dibin Moolakadan Subrahmanian [this message]
2026-03-26 17:15 ` [PATCH 16/19] drm/i915/display: Add helper to enable DC counter Dibin Moolakadan Subrahmanian
2026-04-13 22:14   ` Shankar, Uma
2026-03-26 17:15 ` [PATCH 17/19] drm/i915/display: Remove DC3CO DMC debugfs Dibin Moolakadan Subrahmanian
2026-04-13 22:17   ` Shankar, Uma
2026-03-26 17:15 ` [PATCH 18/19] drm/i915/display: Add DC3CO count and residency in dmc debugfs Dibin Moolakadan Subrahmanian
2026-04-13 22:19   ` Shankar, Uma
2026-03-26 17:15 ` [PATCH 19/19] drm/i915/display: PSR set idle frames while exit from DC3CO Dibin Moolakadan Subrahmanian
2026-04-13 22:21   ` Shankar, Uma
2026-04-22 14:56     ` Dibin Moolakadan Subrahmanian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7c62aec-e8e4-4a97-997f-e6b0d94784de@intel.com \
    --to=dibin.moolakadan.subrahmanian@intel.com \
    --cc=animesh.manna@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=suresh.kumar.kurmi@intel.com \
    --cc=uma.shankar@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox