drm/i915: s/enable/active/ for DRRS
Rename the DRRS functiosn to say "(de)activate" rather than "enable/disable". This let's us differentiate between the logically enabled vs. actually currently active cases. v2: Fix kernel doc for intel_drrs_deactivate() Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220315132752.11849-10-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
This commit is contained in:
parent
ea08396918
commit
54903c7a6b
|
@ -1249,7 +1249,7 @@ static void intel_post_plane_update(struct intel_atomic_state *state,
|
|||
!needs_cursorclk_wa(new_crtc_state))
|
||||
icl_wa_cursorclkgating(dev_priv, pipe, false);
|
||||
|
||||
intel_drrs_enable(new_crtc_state);
|
||||
intel_drrs_activate(new_crtc_state);
|
||||
}
|
||||
|
||||
static void intel_crtc_enable_flip_done(struct intel_atomic_state *state,
|
||||
|
@ -1327,7 +1327,7 @@ static void intel_pre_plane_update(struct intel_atomic_state *state,
|
|||
intel_atomic_get_new_crtc_state(state, crtc);
|
||||
enum pipe pipe = crtc->pipe;
|
||||
|
||||
intel_drrs_disable(old_crtc_state);
|
||||
intel_drrs_deactivate(old_crtc_state);
|
||||
|
||||
intel_psr_pre_plane_update(state, crtc);
|
||||
|
||||
|
|
|
@ -1159,6 +1159,9 @@ static int i915_drrs_status(struct seq_file *m, void *unused)
|
|||
seq_puts(m, "\n");
|
||||
|
||||
for_each_intel_crtc(&dev_priv->drm, crtc) {
|
||||
const struct intel_crtc_state *crtc_state =
|
||||
to_intel_crtc_state(crtc->base.state);
|
||||
|
||||
seq_printf(m, "[CRTC:%d:%s]:\n",
|
||||
crtc->base.base.id, crtc->base.name);
|
||||
|
||||
|
@ -1166,7 +1169,10 @@ static int i915_drrs_status(struct seq_file *m, void *unused)
|
|||
|
||||
/* DRRS Supported */
|
||||
seq_printf(m, "\tDRRS Enabled: %s\n",
|
||||
str_yes_no(intel_drrs_is_enabled(crtc)));
|
||||
str_yes_no(crtc_state->has_drrs));
|
||||
|
||||
seq_printf(m, "\tDRRS Active: %s\n",
|
||||
str_yes_no(intel_drrs_is_active(crtc)));
|
||||
|
||||
seq_printf(m, "\tBusy_frontbuffer_bits: 0x%X\n",
|
||||
crtc->drrs.busy_frontbuffer_bits);
|
||||
|
@ -1864,13 +1870,12 @@ static int i915_drrs_ctl_set(void *data, u64 val)
|
|||
}
|
||||
|
||||
drm_dbg(&dev_priv->drm,
|
||||
"Manually %sabling DRRS. %llu\n",
|
||||
val ? "en" : "dis", val);
|
||||
"Manually %sactivating DRRS\n", val ? "" : "de");
|
||||
|
||||
if (val)
|
||||
intel_drrs_enable(crtc_state);
|
||||
intel_drrs_activate(crtc_state);
|
||||
else
|
||||
intel_drrs_disable(crtc_state);
|
||||
intel_drrs_deactivate(crtc_state);
|
||||
|
||||
out:
|
||||
drm_modeset_unlock(&crtc->base.mutex);
|
||||
|
|
|
@ -147,7 +147,7 @@ intel_drrs_set_refresh_rate_m_n(struct intel_crtc *crtc,
|
|||
&crtc->drrs.m2_n2 : &crtc->drrs.m_n);
|
||||
}
|
||||
|
||||
bool intel_drrs_is_enabled(struct intel_crtc *crtc)
|
||||
bool intel_drrs_is_active(struct intel_crtc *crtc)
|
||||
{
|
||||
return crtc->drrs.cpu_transcoder != INVALID_TRANSCODER;
|
||||
}
|
||||
|
@ -189,12 +189,12 @@ static unsigned int intel_drrs_frontbuffer_bits(const struct intel_crtc_state *c
|
|||
}
|
||||
|
||||
/**
|
||||
* intel_drrs_enable - init drrs struct if supported
|
||||
* @crtc_state: A pointer to the active crtc state.
|
||||
* intel_drrs_activate - activate DRRS
|
||||
* @crtc_state: the crtc state
|
||||
*
|
||||
* Initializes frontbuffer_bits and drrs.dp
|
||||
* Activates DRRS on the crtc.
|
||||
*/
|
||||
void intel_drrs_enable(const struct intel_crtc_state *crtc_state)
|
||||
void intel_drrs_activate(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
|
||||
|
@ -221,10 +221,12 @@ void intel_drrs_enable(const struct intel_crtc_state *crtc_state)
|
|||
}
|
||||
|
||||
/**
|
||||
* intel_drrs_disable - Disable DRRS
|
||||
* @old_crtc_state: Pointer to old crtc_state.
|
||||
* intel_drrs_deactivate - deactivate DRRS
|
||||
* @old_crtc_state: the old crtc state
|
||||
*
|
||||
* Deactivates DRRS on the crtc.
|
||||
*/
|
||||
void intel_drrs_disable(const struct intel_crtc_state *old_crtc_state)
|
||||
void intel_drrs_deactivate(const struct intel_crtc_state *old_crtc_state)
|
||||
{
|
||||
struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc);
|
||||
|
||||
|
@ -239,7 +241,7 @@ void intel_drrs_disable(const struct intel_crtc_state *old_crtc_state)
|
|||
|
||||
mutex_lock(&crtc->drrs.mutex);
|
||||
|
||||
if (intel_drrs_is_enabled(crtc))
|
||||
if (intel_drrs_is_active(crtc))
|
||||
intel_drrs_set_state(crtc, DRRS_REFRESH_RATE_HIGH);
|
||||
|
||||
crtc->drrs.cpu_transcoder = INVALID_TRANSCODER;
|
||||
|
@ -257,7 +259,7 @@ static void intel_drrs_downclock_work(struct work_struct *work)
|
|||
|
||||
mutex_lock(&crtc->drrs.mutex);
|
||||
|
||||
if (intel_drrs_is_enabled(crtc) && !crtc->drrs.busy_frontbuffer_bits)
|
||||
if (intel_drrs_is_active(crtc) && !crtc->drrs.busy_frontbuffer_bits)
|
||||
intel_drrs_set_state(crtc, DRRS_REFRESH_RATE_LOW);
|
||||
|
||||
mutex_unlock(&crtc->drrs.mutex);
|
||||
|
|
|
@ -16,9 +16,9 @@ struct intel_crtc_state;
|
|||
struct intel_connector;
|
||||
|
||||
const char *intel_drrs_type_str(enum drrs_type drrs_type);
|
||||
bool intel_drrs_is_enabled(struct intel_crtc *crtc);
|
||||
void intel_drrs_enable(const struct intel_crtc_state *crtc_state);
|
||||
void intel_drrs_disable(const struct intel_crtc_state *crtc_state);
|
||||
bool intel_drrs_is_active(struct intel_crtc *crtc);
|
||||
void intel_drrs_activate(const struct intel_crtc_state *crtc_state);
|
||||
void intel_drrs_deactivate(const struct intel_crtc_state *crtc_state);
|
||||
void intel_drrs_invalidate(struct drm_i915_private *dev_priv,
|
||||
unsigned int frontbuffer_bits);
|
||||
void intel_drrs_flush(struct drm_i915_private *dev_priv,
|
||||
|
|
Loading…
Reference in New Issue