Skip to content

Commit

Permalink
drm/i915: Don't try to disable plane if it's already disabled
Browse files Browse the repository at this point in the history
Check plane->fb in intel_disable_plane() to determine if the plane
is already disabled.

If the plane has an fb, then it must also have a crtc, so we can drop
the plane->crtc check and just call intel_enable_primary() directly.

v2: WARN and bail if the plane doesn't have a crtc when it should

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Ville Syrjälä authored and Daniel Vetter committed Aug 8, 2013
1 parent b39d53f commit 88a94a5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/gpu/drm/i915/intel_sprite.c
Original file line number Diff line number Diff line change
Expand Up @@ -863,8 +863,13 @@ intel_disable_plane(struct drm_plane *plane)
struct intel_plane *intel_plane = to_intel_plane(plane);
int ret = 0;

if (plane->crtc)
intel_enable_primary(plane->crtc);
if (!plane->fb)
return 0;

if (WARN_ON(!plane->crtc))
return -EINVAL;

intel_enable_primary(plane->crtc);
intel_plane->disable_plane(plane, plane->crtc);

if (!intel_plane->obj)
Expand Down

0 comments on commit 88a94a5

Please sign in to comment.