summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-09-08 16:30:16 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-09-21 11:59:21 +0100
commitcdd59983118c02d9c5ba0c116ded1faef47ec452 (patch)
treeac6d2d5518c2b711c30cf787212c4a2381a41178
parent6eecba33f2fc24544073631dc1b23b7a312e644b (diff)
downloadop-kernel-dev-cdd59983118c02d9c5ba0c116ded1faef47ec452.zip
op-kernel-dev-cdd59983118c02d9c5ba0c116ded1faef47ec452.tar.gz
drm/i915: Drop crtc->fb pin on disable.
In order to handle disable_functions() where the framebuffer is decoupled from the crtc we need to unpin the fb in order to prevent a leak. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=29857 Reported-by: Sitsofe Wheeler <sitsofe@yahoo.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--drivers/gpu/drm/i915/intel_display.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 461bf48..e6f7ebf 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2487,6 +2487,20 @@ static void intel_crtc_dpms(struct drm_crtc *crtc, int mode)
}
}
+static void intel_crtc_disable(struct drm_crtc *crtc)
+{
+ struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
+ struct drm_device *dev = crtc->dev;
+
+ crtc_funcs->dpms(crtc, DRM_MODE_DPMS_OFF);
+
+ if (crtc->fb) {
+ mutex_lock(&dev->struct_mutex);
+ i915_gem_object_unpin(to_intel_framebuffer(crtc->fb)->obj);
+ mutex_unlock(&dev->struct_mutex);
+ }
+}
+
/* Prepare for a mode set.
*
* Note we could be a lot smarter here. We need to figure out which outputs
@@ -5163,6 +5177,7 @@ static struct drm_crtc_helper_funcs intel_helper_funcs = {
.mode_set_base = intel_pipe_set_base,
.mode_set_base_atomic = intel_pipe_set_base_atomic,
.load_lut = intel_crtc_load_lut,
+ .disable = intel_crtc_disable,
};
static const struct drm_crtc_funcs intel_crtc_funcs = {
OpenPOWER on IntegriCloud