aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMika Kuoppala <mika.kuoppala@linux.intel.com>2013-04-23 10:27:08 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-05-31 14:54:07 -0400
commit40ccc72b84a848e6fcbdb38fe716f0ac6939609e (patch)
tree281e75ac1bd9642eb98576ac17b33b8798673b46
parent2e7c8ee7a6bf3440478120f14cbf597d416f88b2 (diff)
drm/i915: release cursor when crtc is destroyed
crtc is holding a reference to a cursor bo and it needs to be released when crtc is destroyed so that we don't leak the cursor bo. v2: Enhance set and move cursor so that disabled cursor is handled correctly (Ville Syrjälä) Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/intel_display.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index a45309130a34..161b064592af 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -6509,7 +6509,7 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
6509 intel_crtc->cursor_width = width; 6509 intel_crtc->cursor_width = width;
6510 intel_crtc->cursor_height = height; 6510 intel_crtc->cursor_height = height;
6511 6511
6512 intel_crtc_update_cursor(crtc, true); 6512 intel_crtc_update_cursor(crtc, intel_crtc->cursor_bo != NULL);
6513 6513
6514 return 0; 6514 return 0;
6515fail_unpin: 6515fail_unpin:
@@ -6528,7 +6528,7 @@ static int intel_crtc_cursor_move(struct drm_crtc *crtc, int x, int y)
6528 intel_crtc->cursor_x = x; 6528 intel_crtc->cursor_x = x;
6529 intel_crtc->cursor_y = y; 6529 intel_crtc->cursor_y = y;
6530 6530
6531 intel_crtc_update_cursor(crtc, true); 6531 intel_crtc_update_cursor(crtc, intel_crtc->cursor_bo != NULL);
6532 6532
6533 return 0; 6533 return 0;
6534} 6534}
@@ -7042,6 +7042,8 @@ static void intel_crtc_destroy(struct drm_crtc *crtc)
7042 kfree(work); 7042 kfree(work);
7043 } 7043 }
7044 7044
7045 intel_crtc_cursor_set(crtc, NULL, 0, 0, 0);
7046
7045 drm_crtc_cleanup(crtc); 7047 drm_crtc_cleanup(crtc);
7046 7048
7047 kfree(intel_crtc); 7049 kfree(intel_crtc);