Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7733b49b authored by Paulo Zanoni's avatar Paulo Zanoni Committed by Daniel Vetter
Browse files

drm/i915: use dev_priv for the FBC functions



Because the cool kids use dev_priv and FBC wants to be cool too.

We've been historically using struct drm_device on the FBC function
arguments, but we only really need it for intel_vgpu_active(): we can
use dev_priv everywhere else. So let's fully switch to dev_priv since
I'm getting tired of adding "struct drm_device *dev = dev_priv->dev"
everywhere.

If I get a NACK here I'll propose the opposite: convert all the
functions that currently take dev_priv to take dev.

Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent ff2a3117
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1635,7 +1635,7 @@ static int i915_fbc_status(struct seq_file *m, void *unused)
	intel_runtime_pm_get(dev_priv);
	mutex_lock(&dev_priv->fbc.lock);

	if (intel_fbc_enabled(dev))
	if (intel_fbc_enabled(dev_priv))
		seq_puts(m, "FBC enabled\n");
	else
		seq_printf(m, "FBC disabled: %s\n",
+1 −1
Original line number Diff line number Diff line
@@ -1123,7 +1123,7 @@ int i915_driver_unload(struct drm_device *dev)
	i915_gem_cleanup_ringbuffer(dev);
	i915_gem_context_fini(dev);
	mutex_unlock(&dev->struct_mutex);
	intel_fbc_cleanup_cfb(dev);
	intel_fbc_cleanup_cfb(dev_priv);
	i915_gem_cleanup_stolen(dev);

	intel_csr_ucode_fini(dev);
+2 −2
Original line number Diff line number Diff line
@@ -937,9 +937,9 @@ struct i915_fbc {
		FBC_ROTATION, /* rotation is not supported */
	} no_fbc_reason;

	bool (*fbc_enabled)(struct drm_device *dev);
	bool (*fbc_enabled)(struct drm_i915_private *dev_priv);
	void (*enable_fbc)(struct drm_crtc *crtc);
	void (*disable_fbc)(struct drm_device *dev);
	void (*disable_fbc)(struct drm_i915_private *dev_priv);
};

/**
+1 −1
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ static void i915_restore_display(struct drm_device *dev)
	}

	/* only restore FBC info on the platform that supports FBC*/
	intel_fbc_disable(dev);
	intel_fbc_disable(dev_priv);

	/* restore FBC interval */
	if (HAS_FBC(dev) && INTEL_INFO(dev)->gen <= 4 && !IS_G4X(dev))
+8 −6
Original line number Diff line number Diff line
@@ -3135,7 +3135,7 @@ intel_pipe_set_base_atomic(struct drm_crtc *crtc, struct drm_framebuffer *fb,
	struct drm_i915_private *dev_priv = dev->dev_private;

	if (dev_priv->fbc.disable_fbc)
		dev_priv->fbc.disable_fbc(dev);
		dev_priv->fbc.disable_fbc(dev_priv);

	dev_priv->display.update_primary_plane(crtc, fb, x, y);

@@ -4734,6 +4734,7 @@ static void intel_post_plane_update(struct intel_crtc *crtc)
{
	struct intel_crtc_atomic_commit *atomic = &crtc->atomic;
	struct drm_device *dev = crtc->base.dev;
	struct drm_i915_private *dev_priv = dev->dev_private;
	struct drm_plane *plane;

	if (atomic->wait_vblank)
@@ -4748,7 +4749,7 @@ static void intel_post_plane_update(struct intel_crtc *crtc)
		intel_update_watermarks(&crtc->base);

	if (atomic->update_fbc)
		intel_fbc_update(dev);
		intel_fbc_update(dev_priv);

	if (atomic->post_enable_primary)
		intel_post_enable_primary(&crtc->base);
@@ -10688,13 +10689,14 @@ static void intel_unpin_work_fn(struct work_struct *__work)
		container_of(__work, struct intel_unpin_work, work);
	struct intel_crtc *crtc = to_intel_crtc(work->crtc);
	struct drm_device *dev = crtc->base.dev;
	struct drm_i915_private *dev_priv = dev->dev_private;
	struct drm_plane *primary = crtc->base.primary;

	mutex_lock(&dev->struct_mutex);
	intel_unpin_fb_obj(work->old_fb, primary->state);
	drm_gem_object_unreference(&work->pending_flip_obj->base);

	intel_fbc_update(dev);
	intel_fbc_update(dev_priv);

	if (work->flip_queued_req)
		i915_gem_request_assign(&work->flip_queued_req, NULL);
@@ -11469,7 +11471,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
			  to_intel_plane(primary)->frontbuffer_bit);
	mutex_unlock(&dev->struct_mutex);

	intel_fbc_disable(dev);
	intel_fbc_disable(dev_priv);
	intel_frontbuffer_flip_prepare(dev,
				       to_intel_plane(primary)->frontbuffer_bit);

@@ -15045,7 +15047,7 @@ void intel_modeset_init(struct drm_device *dev)
	intel_setup_outputs(dev);

	/* Just in case the BIOS is doing something questionable. */
	intel_fbc_disable(dev);
	intel_fbc_disable(dev_priv);

	drm_modeset_lock_all(dev);
	intel_modeset_setup_hw_state(dev, false);
@@ -15599,7 +15601,7 @@ void intel_modeset_cleanup(struct drm_device *dev)

	intel_unregister_dsm_handler();

	intel_fbc_disable(dev);
	intel_fbc_disable(dev_priv);

	/* flush any delayed tasks or pending work */
	flush_scheduled_work();
Loading