diff mbox series

[5/6] drm/i915: Add sanity check before accessing fb buffer object

Message ID 20240205101053.3698717-6-chaitanya.kumar.borah@intel.com (mailing list archive)
State New, archived
Headers show
Series Cursor Fault Fixes | expand

Commit Message

Chaitanya Kumar Borah Feb. 5, 2024, 10:10 a.m. UTC
Now that cursor plane fb unpinning can be deferred to vblank work
access the fb object only when vblank unpin worker is not scheduled.

Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
---
 drivers/gpu/drm/i915/display/intel_atomic_plane.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
index a585e4aca309..1c3ecfc91f00 100644
--- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
@@ -1176,7 +1176,10 @@  intel_cleanup_plane_fb(struct drm_plane *plane,
 	struct intel_atomic_state *state =
 		to_intel_atomic_state(old_plane_state->uapi.state);
 	struct drm_i915_private *dev_priv = to_i915(plane->dev);
-	struct drm_i915_gem_object *obj = intel_fb_obj(old_plane_state->hw.fb);
+	struct drm_i915_gem_object *obj = NULL;
+
+	if (!old_plane_state->unpin_work.vblank)
+		obj = intel_fb_obj(old_plane_state->hw.fb);
 
 	if (!obj)
 		return;