Patch "drm/i915: Fix the overlay frontbuffer tracking" has been added to the 4.9-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
drm/i915: Fix the overlay frontbuffer tracking
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
drm-i915-fix-the-overlay-frontbuffer-tracking.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From foo@baz Thu Oct 5 10:28:31 CEST 2017
From: Ville Syrj�l� <[email protected]>
Date: Wed, 7 Dec 2016 19:28:06 +0200
Subject: drm/i915: Fix the overlay frontbuffer tracking
From: Ville Syrj�l� <[email protected]>
[ Upstream commit 58d09ebdb4edf5d3ab3a2aee851ab0168bc83ec6 ]
Do the overlay frontbuffer tracking properly so that it matches the state of the overlay on/off/continue requests.
One slight problem is that intel_frontbuffer_flip_complete() may get delayed by an arbitrarily liong time due to the fact that the overlay code likes to bail out when a signal occurs. So the flip may not get completed until the ioctl is restarted. But fixing that would require bigger surgery, so I decided to ignore it for now.
--- drivers/gpu/drm/i915/intel_overlay.c | 64 ++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 23 deletions(-)
drivers/gpu/drm/i915/intel_overlay.c +41 -23
@@ -272,8 +272,30 @@ static int intel_overlay_on(struct intelreturn intel_overlay_do_wait_request (overlay, req,NULL ); } +static void intel_overlay_flip_prepare (struct intel_overlay *overlay, +struct i915_vma *vma) +{ +enum pipe pipe = overlay->crtc->pipe; + +WARN_ON (overlay->old_vma); + +i915_gem_track_fb (overlay->vma ? overlay->vma->obj :NULL , + vma ? vma->obj :NULL , +INTEL_FRONTBUFFER_OVERLAY (pipe)); + +intel_frontbuffer_flip_prepare (overlay->i915, +INTEL_FRONTBUFFER_OVERLAY (pipe)); + + overlay->old_vma = overlay->vma; +if (vma) + overlay->vma =i915_vma_get (vma); +else + overlay->vma =NULL ; +} +/* overlay needs to be enabled in OCMD reg */ static int intel_overlay_continue (struct intel_overlay *overlay, +struct i915_vma *vma,bool load_polyphase_filter) {struct drm_i915_private *dev_priv = overlay->i915;
@@ -308,43 +330,44 @@ static int intel_overlay_continue(structintel_ring_emit (ring, flip_addr);intel_ring_advance (ring); +intel_overlay_flip_prepare (overlay, vma); +intel_overlay_submit_request (overlay, req,NULL );return 0 ; } -static void intel_overlay_release_old_vid_tail (struct i915_gem_active *active, -struct drm_i915_gem_request *req) +static void intel_overlay_release_old_vma (struct intel_overlay *overlay) { -struct intel_overlay *overlay = -container_of (active,typeof (*overlay), last_flip);struct i915_vma *vma; vma =fetch_and_zero (&overlay->old_vma);if (WARN_ON (!vma))return ; -i915_gem_track_fb (vma->obj,NULL , -INTEL_FRONTBUFFER_OVERLAY (overlay->crtc->pipe)); +intel_frontbuffer_flip_complete (overlay->i915, +INTEL_FRONTBUFFER_OVERLAY (overlay->crtc->pipe));i915_gem_object_unpin_from_display_plane (vma);i915_vma_put (vma); } +static void intel_overlay_release_old_vid_tail (struct i915_gem_active *active, +struct drm_i915_gem_request *req) +{ +struct intel_overlay *overlay = +container_of (active,typeof (*overlay), last_flip); + +intel_overlay_release_old_vma (overlay); +} +static void intel_overlay_off_tail (struct i915_gem_active *active,struct drm_i915_gem_request *req) {struct intel_overlay *overlay =container_of (active,typeof (*overlay), last_flip); -struct i915_vma *vma; - -/* never have the overlay hw on without showing a frame */ - vma =fetch_and_zero (&overlay->vma); -if (WARN_ON (!vma)) -return ; -i915_gem_object_unpin_from_display_plane (vma); -i915_vma_put (vma); +intel_overlay_release_old_vma (overlay); overlay->crtc->overlay =NULL ; overlay->crtc =NULL ;
@@ -398,6 +421,8 @@ static int intel_overlay_off(struct inte }intel_ring_advance (ring); +intel_overlay_flip_prepare (overlay,NULL ); +return intel_overlay_do_wait_request (overlay, req, intel_overlay_off_tail); }
@@ -836,18 +861,10 @@ static int intel_overlay_do_put_image(stintel_overlay_unmap_regs (overlay, regs); - ret =intel_overlay_continue (overlay, scale_changed); + ret =intel_overlay_continue (overlay, vma, scale_changed);if (ret) goto out_unpin; -i915_gem_track_fb (overlay->vma ? overlay->vma->obj :NULL , - vma->obj,INTEL_FRONTBUFFER_OVERLAY (pipe)); - - overlay->old_vma = overlay->vma; - overlay->vma = vma; - -intel_frontbuffer_flip (dev_priv,INTEL_FRONTBUFFER_OVERLAY (pipe)); -return 0 ; out_unpin:
@@ -1215,6 +1232,7 @@ int intel_overlay_put_image_ioctl(structmutex_unlock (&dev->struct_mutex);drm_modeset_unlock_all (dev); +i915_gem_object_put (new_bo);kfree (params);
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/drm-i915-fix-the-overlay-frontbuffer-tracking.patch