diff options
| author | Imre Deak <imre.deak@intel.com> | 2024-06-18 15:52:53 +0300 |
|---|---|---|
| committer | Imre Deak <imre.deak@intel.com> | 2024-06-20 19:47:50 +0300 |
| commit | cc2ee76a9003e1b5a7cd4f67ecf9b4b91d83299b (patch) | |
| tree | e03f0aa047a0f3170e8f668bd0c843e7411e177a /drivers/gpu/drm/i915/display/intel_encoder.c | |
| parent | 67577e2eada5b6501e30d80adea9d045081ba7a1 (diff) | |
| download | linux-cc2ee76a9003e1b5a7cd4f67ecf9b4b91d83299b.tar.xz | |
drm/i915: Move encoder suspend/shutdown helpers to intel_encoder.c
Move the encoder suspend/shutdown helpers to intel_encoder.c, this being
the logical place for encoder functions.
This also allows sharing the above helpers with the xe driver, done in a
follow-up patch.
While at it rename the functions using the usual intel_encoder prefix
and in the functions rename the dev_priv parameter to i915.
v2: Remove extra w/s in the include section. (Jani)
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> # v1
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240618125255.4080303-1-imre.deak@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_encoder.c')
| -rw-r--r-- | drivers/gpu/drm/i915/display/intel_encoder.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_encoder.c b/drivers/gpu/drm/i915/display/intel_encoder.c index dee55f56960f..8a1dccb893a3 100644 --- a/drivers/gpu/drm/i915/display/intel_encoder.c +++ b/drivers/gpu/drm/i915/display/intel_encoder.c @@ -37,3 +37,47 @@ void intel_encoder_link_check_queue_work(struct intel_encoder *encoder, int dela mod_delayed_work(i915->unordered_wq, &encoder->link_check_work, msecs_to_jiffies(delay_ms)); } + +void intel_encoder_suspend_all(struct drm_i915_private *i915) +{ + struct intel_encoder *encoder; + + if (!HAS_DISPLAY(i915)) + return; + + /* + * TODO: check and remove holding the modeset locks if none of + * the encoders depends on this. + */ + drm_modeset_lock_all(&i915->drm); + for_each_intel_encoder(&i915->drm, encoder) + if (encoder->suspend) + encoder->suspend(encoder); + drm_modeset_unlock_all(&i915->drm); + + for_each_intel_encoder(&i915->drm, encoder) + if (encoder->suspend_complete) + encoder->suspend_complete(encoder); +} + +void intel_encoder_shutdown_all(struct drm_i915_private *i915) +{ + struct intel_encoder *encoder; + + if (!HAS_DISPLAY(i915)) + return; + + /* + * TODO: check and remove holding the modeset locks if none of + * the encoders depends on this. + */ + drm_modeset_lock_all(&i915->drm); + for_each_intel_encoder(&i915->drm, encoder) + if (encoder->shutdown) + encoder->shutdown(encoder); + drm_modeset_unlock_all(&i915->drm); + + for_each_intel_encoder(&i915->drm, encoder) + if (encoder->shutdown_complete) + encoder->shutdown_complete(encoder); +} |
