mirror of
https://github.com/raspberrypi/linux.git
synced 2026-01-03 08:14:12 +00:00
drm/i915/display: convert intel_has_pending_fb_unpin() to struct intel_display
Going forward, struct intel_display is the main display device data pointer. The intel_display.[ch] files are too big to convert in one go. Convert intel_has_pending_fb_unpin() to struct intel_display. Reviewed-by: Nemesa Garg <nemesa.garg@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/d70ad8f9cbba5ee32d985b76047b56996ad4b31e.1741084010.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
@@ -4660,6 +4660,7 @@ static int intel_ddi_init_dp_connector(struct intel_digital_port *dig_port)
|
||||
static int intel_hdmi_reset_link(struct intel_encoder *encoder,
|
||||
struct drm_modeset_acquire_ctx *ctx)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
struct intel_hdmi *hdmi = enc_to_intel_hdmi(encoder);
|
||||
struct intel_connector *connector = hdmi->attached_connector;
|
||||
@@ -4726,7 +4727,7 @@ static int intel_hdmi_reset_link(struct intel_encoder *encoder,
|
||||
* would be perfectly happy if were to just reconfigure
|
||||
* the SCDC settings on the fly.
|
||||
*/
|
||||
return intel_modeset_commit_pipes(dev_priv, BIT(crtc->pipe), ctx);
|
||||
return intel_modeset_commit_pipes(display, BIT(crtc->pipe), ctx);
|
||||
}
|
||||
|
||||
static void intel_ddi_link_check(struct intel_encoder *encoder)
|
||||
|
||||
@@ -764,12 +764,12 @@ static void icl_set_pipe_chicken(const struct intel_crtc_state *crtc_state)
|
||||
intel_de_write(dev_priv, PIPE_CHICKEN(pipe), tmp);
|
||||
}
|
||||
|
||||
bool intel_has_pending_fb_unpin(struct drm_i915_private *dev_priv)
|
||||
bool intel_has_pending_fb_unpin(struct intel_display *display)
|
||||
{
|
||||
struct drm_crtc *crtc;
|
||||
bool cleanup_done;
|
||||
|
||||
drm_for_each_crtc(crtc, &dev_priv->drm) {
|
||||
drm_for_each_crtc(crtc, display->drm) {
|
||||
struct drm_crtc_commit *commit;
|
||||
spin_lock(&crtc->commit_lock);
|
||||
commit = list_first_entry_or_null(&crtc->commit_list,
|
||||
@@ -5574,7 +5574,7 @@ int intel_modeset_all_pipes_late(struct intel_atomic_state *state,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int intel_modeset_commit_pipes(struct drm_i915_private *i915,
|
||||
int intel_modeset_commit_pipes(struct intel_display *display,
|
||||
u8 pipe_mask,
|
||||
struct drm_modeset_acquire_ctx *ctx)
|
||||
{
|
||||
@@ -5582,14 +5582,14 @@ int intel_modeset_commit_pipes(struct drm_i915_private *i915,
|
||||
struct intel_crtc *crtc;
|
||||
int ret;
|
||||
|
||||
state = drm_atomic_state_alloc(&i915->drm);
|
||||
state = drm_atomic_state_alloc(display->drm);
|
||||
if (!state)
|
||||
return -ENOMEM;
|
||||
|
||||
state->acquire_ctx = ctx;
|
||||
to_intel_atomic_state(state)->internal = true;
|
||||
|
||||
for_each_intel_crtc_in_pipe_mask(&i915->drm, crtc, pipe_mask) {
|
||||
for_each_intel_crtc_in_pipe_mask(display->drm, crtc, pipe_mask) {
|
||||
struct intel_crtc_state *crtc_state =
|
||||
intel_atomic_get_crtc_state(state, crtc);
|
||||
|
||||
|
||||
@@ -457,7 +457,7 @@ int vlv_get_cck_clock(struct drm_i915_private *dev_priv,
|
||||
const char *name, u32 reg, int ref_freq);
|
||||
int vlv_get_cck_clock_hpll(struct drm_i915_private *dev_priv,
|
||||
const char *name, u32 reg);
|
||||
bool intel_has_pending_fb_unpin(struct drm_i915_private *dev_priv);
|
||||
bool intel_has_pending_fb_unpin(struct intel_display *display);
|
||||
void intel_encoder_destroy(struct drm_encoder *encoder);
|
||||
struct drm_display_mode *
|
||||
intel_encoder_current_mode(struct intel_encoder *encoder);
|
||||
@@ -531,7 +531,7 @@ int intel_modeset_pipes_in_mask_early(struct intel_atomic_state *state,
|
||||
const char *reason, u8 pipe_mask);
|
||||
int intel_modeset_all_pipes_late(struct intel_atomic_state *state,
|
||||
const char *reason);
|
||||
int intel_modeset_commit_pipes(struct drm_i915_private *i915,
|
||||
int intel_modeset_commit_pipes(struct intel_display *display,
|
||||
u8 pipe_mask,
|
||||
struct drm_modeset_acquire_ctx *ctx);
|
||||
void intel_modeset_get_crtc_power_domains(struct intel_crtc_state *crtc_state,
|
||||
|
||||
@@ -5193,7 +5193,6 @@ static int intel_dp_retrain_link(struct intel_encoder *encoder,
|
||||
struct drm_modeset_acquire_ctx *ctx)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
|
||||
u8 pipe_mask;
|
||||
int ret;
|
||||
@@ -5224,7 +5223,7 @@ static int intel_dp_retrain_link(struct intel_encoder *encoder,
|
||||
encoder->base.base.id, encoder->base.name,
|
||||
str_yes_no(intel_dp->link.force_retrain));
|
||||
|
||||
ret = intel_modeset_commit_pipes(dev_priv, pipe_mask, ctx);
|
||||
ret = intel_modeset_commit_pipes(display, pipe_mask, ctx);
|
||||
if (ret == -EDEADLK)
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -328,6 +328,7 @@ static bool fence_is_active(const struct i915_fence_reg *fence)
|
||||
|
||||
static struct i915_fence_reg *fence_find(struct i915_ggtt *ggtt)
|
||||
{
|
||||
struct intel_display *display = &ggtt->vm.i915->display;
|
||||
struct i915_fence_reg *active = NULL;
|
||||
struct i915_fence_reg *fence, *fn;
|
||||
|
||||
@@ -353,7 +354,7 @@ static struct i915_fence_reg *fence_find(struct i915_ggtt *ggtt)
|
||||
}
|
||||
|
||||
/* Wait for completion of pending flips which consume fences */
|
||||
if (intel_has_pending_fb_unpin(ggtt->vm.i915))
|
||||
if (intel_has_pending_fb_unpin(display))
|
||||
return ERR_PTR(-EAGAIN);
|
||||
|
||||
return ERR_PTR(-ENOBUFS);
|
||||
|
||||
Reference in New Issue
Block a user