Make sure the object exists (it may not if the plane was previously disabled)
and make sure we zero it out in the disable path to avoid trouble later.

Signed-off-by: Jesse Barnes <jbar...@virtuousgeek.org>
---
 drivers/gpu/drm/i915/intel_overlay2.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_overlay2.c 
b/drivers/gpu/drm/i915/intel_overlay2.c
index e583bd0..861e09e 100644
--- a/drivers/gpu/drm/i915/intel_overlay2.c
+++ b/drivers/gpu/drm/i915/intel_overlay2.c
@@ -149,12 +149,18 @@ intel_disable_plane(struct drm_plane *plane)
 
        mutex_lock(&dev->struct_mutex);
 
+       if (!intel_plane->obj)
+               goto out_unlock;
+
        ret = i915_gem_object_finish_gpu(intel_plane->obj);
        if (ret)
                goto out_unlock;
+
        i915_gem_object_unpin(intel_plane->obj);
 
 out_unlock:
+       intel_plane->obj = NULL;
+
        I915_WRITE(DVSCNTR(pipe), I915_READ(DVSCNTR(pipe)) & ~DVS_ENABLE);
        I915_WRITE(DVSSURF(pipe), 0);
        POSTING_READ(DVSSURF(pipe));
-- 
1.7.4.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to