diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2020-01-10 20:32:28 +0200 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2020-01-22 20:22:04 +0200 |
commit | 6fef8510a7a51227620de74cc495916e6ba54773 (patch) | |
tree | 8218a9e9b302905ae906c77370e5095ae615971f | |
parent | 58fa1760d08a792c9aceed6468a035250c22757b (diff) | |
download | linux-6fef8510a7a51227620de74cc495916e6ba54773.tar.gz linux-6fef8510a7a51227620de74cc495916e6ba54773.tar.bz2 linux-6fef8510a7a51227620de74cc495916e6ba54773.zip |
drm/i915: Cleanup properly if the implicit fence setup fails
We've already pinned the vma and fence by the time we try to
deal with implicit fencing. Properly unpin the vma and fence
if the fence setup fails instead of just bailing straight out
from .prepare_fb(). As can be expected
drm_atomic_helper_prepare_planes() will not call .cleanup_fb()
for the plane whose .prepare_fb() failed so we must do the
cleanup ourself.
v2: Rebase
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200110183228.8199-6-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | drivers/gpu/drm/i915/display/intel_display.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index b6b007e2ff2c..878d331b9e8c 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -15803,7 +15803,7 @@ intel_prepare_plane_fb(struct drm_plane *_plane, false, I915_FENCE_TIMEOUT, GFP_KERNEL); if (ret < 0) - return ret; + goto unpin_fb; fence = dma_resv_get_excl_rcu(obj->base.resv); if (fence) { @@ -15830,6 +15830,11 @@ intel_prepare_plane_fb(struct drm_plane *_plane, } return 0; + +unpin_fb: + intel_plane_unpin_fb(new_plane_state); + + return ret; } /** |