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

Commit 64f962e3 authored by Chris Wilson's avatar Chris Wilson Committed by Daniel Vetter
Browse files

drm/i915: Recompute WM when the cursor size changes



If the cursor width is changed, we may need to recompute our WM to
prevent untold flickering. We hope that the registers are flushed on the
same vblank to prevent underruns...

Cc: Damien Lespiau <damien.lespiau@intel.com>
Cc: Sagar Kamble <sagar.a.kamble@intel.com>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarDamien Lespiau <damien.lespiau@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 7bb836dd
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -7745,6 +7745,7 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
	struct drm_i915_private *dev_priv = dev->dev_private;
	struct drm_i915_private *dev_priv = dev->dev_private;
	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
	struct drm_i915_gem_object *obj;
	struct drm_i915_gem_object *obj;
	unsigned old_width;
	uint32_t addr;
	uint32_t addr;
	int ret;
	int ret;


@@ -7835,13 +7836,18 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,


	mutex_unlock(&dev->struct_mutex);
	mutex_unlock(&dev->struct_mutex);


	old_width = intel_crtc->cursor_width;

	intel_crtc->cursor_addr = addr;
	intel_crtc->cursor_addr = addr;
	intel_crtc->cursor_bo = obj;
	intel_crtc->cursor_bo = obj;
	intel_crtc->cursor_width = width;
	intel_crtc->cursor_width = width;
	intel_crtc->cursor_height = height;
	intel_crtc->cursor_height = height;


	if (intel_crtc->active)
	if (intel_crtc->active) {
		if (old_width != width)
			intel_update_watermarks(crtc);
		intel_crtc_update_cursor(crtc, intel_crtc->cursor_bo != NULL);
		intel_crtc_update_cursor(crtc, intel_crtc->cursor_bo != NULL);
	}


	return 0;
	return 0;
fail_unpin:
fail_unpin: