[Intel-gfx] [PATCH 6/9] drm/i915: Schedule DRRS work from intel_drrs_enable()
Souza, Jose
jose.souza at intel.com
Tue Mar 15 18:39:59 UTC 2022
On Tue, 2022-03-15 at 15:27 +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>
> Schedule the DRRS downclock work already from intel_drrs_enable()
> instead of waiting around for a frontbuffer flush that may or
> may not ever come.
Reviewed-by: José Roberto de Souza <jose.souza at intel.com>
>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_drrs.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_drrs.c b/drivers/gpu/drm/i915/display/intel_drrs.c
> index f36394fd85be..8f9e0fde0c5a 100644
> --- a/drivers/gpu/drm/i915/display/intel_drrs.c
> +++ b/drivers/gpu/drm/i915/display/intel_drrs.c
> @@ -168,6 +168,11 @@ static void intel_drrs_set_state(struct intel_crtc *crtc,
> crtc->drrs.refresh_rate = refresh_rate;
> }
>
> +static void intel_drrs_schedule_work(struct intel_crtc *crtc)
> +{
> + mod_delayed_work(system_wq, &crtc->drrs.work, msecs_to_jiffies(1000));
> +}
> +
> static unsigned int intel_drrs_frontbuffer_bits(const struct intel_crtc_state *crtc_state)
> {
> struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
> @@ -200,6 +205,8 @@ void intel_drrs_enable(const struct intel_crtc_state *crtc_state)
> crtc->drrs.frontbuffer_bits = intel_drrs_frontbuffer_bits(crtc_state);
> crtc->drrs.busy_frontbuffer_bits = 0;
>
> + intel_drrs_schedule_work(crtc);
> +
> mutex_unlock(&crtc->drrs.mutex);
> }
>
> @@ -299,8 +306,7 @@ static void intel_drrs_frontbuffer_update(struct drm_i915_private *dev_priv,
> * other fbs are quiescent too
> */
> if (!crtc->drrs.busy_frontbuffer_bits)
> - mod_delayed_work(system_wq, &crtc->drrs.work,
> - msecs_to_jiffies(1000));
> + intel_drrs_schedule_work(crtc);
> else
> cancel_delayed_work(&crtc->drrs.work);
>
More information about the Intel-gfx
mailing list