Commit 1c004047 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Schedule DRRS work from intel_drrs_enable()

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.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220315132752.11849-7-ville.syrjala@linux.intel.comReviewed-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
parent fb4ae6e6
...@@ -168,6 +168,11 @@ static void intel_drrs_set_state(struct intel_crtc *crtc, ...@@ -168,6 +168,11 @@ static void intel_drrs_set_state(struct intel_crtc *crtc,
crtc->drrs.refresh_rate = refresh_rate; 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) 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); 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) ...@@ -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.frontbuffer_bits = intel_drrs_frontbuffer_bits(crtc_state);
crtc->drrs.busy_frontbuffer_bits = 0; crtc->drrs.busy_frontbuffer_bits = 0;
intel_drrs_schedule_work(crtc);
mutex_unlock(&crtc->drrs.mutex); mutex_unlock(&crtc->drrs.mutex);
} }
...@@ -299,8 +306,7 @@ static void intel_drrs_frontbuffer_update(struct drm_i915_private *dev_priv, ...@@ -299,8 +306,7 @@ static void intel_drrs_frontbuffer_update(struct drm_i915_private *dev_priv,
* other fbs are quiescent too * other fbs are quiescent too
*/ */
if (!crtc->drrs.busy_frontbuffer_bits) if (!crtc->drrs.busy_frontbuffer_bits)
mod_delayed_work(system_wq, &crtc->drrs.work, intel_drrs_schedule_work(crtc);
msecs_to_jiffies(1000));
else else
cancel_delayed_work(&crtc->drrs.work); cancel_delayed_work(&crtc->drrs.work);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment