drm/i915: Balance prepare_fb/cleanup_fb
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 10 Jan 2020 18:32:27 +0000 (20:32 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 22 Jan 2020 18:22:04 +0000 (20:22 +0200)
commit58fa1760d08a792c9aceed6468a035250c22757b
tree6d831856abb561b3372417fc375221412ce0e396
parentfa528334f69bc4fbb20810001d1f0221c1d6033a
drm/i915: Balance prepare_fb/cleanup_fb

intel_prepare_plane_fb() bails early if there is no fb (or rather
no obj, which is the same thing). intel_cleanup_plane_fb() does not.
This means the steps performed by intel_cleanup_plane_fb() aren't
balanced with with what was done intel_prepare_plane_fb() if there
is no fb for the plane. These hooks get called for every plane in
the state regardless of whether they have an fb or not.

Add a matching null obj check to intel_cleanup_plane_fb() to restore
the balance.

Note that intel_cleanup_plane_fb() has sufficient protections
already in place that the imbalance doesn't cause any real problems.
But having things be in balance seems nicer anyway, and might help
avoid some surprises in the future.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200110183228.8199-5-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/display/intel_display.c