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: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220315132752.11849-7-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
This commit is contained in:
parent
fb4ae6e650
commit
1c00404769
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user