aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorPatrik Jakobsson <patrik.r.jakobsson@gmail.com>2013-06-08 14:23:08 -0400
committerPatrik Jakobsson <patrik.r.jakobsson@gmail.com>2013-06-09 12:03:20 -0400
commit22e7c385a80d771aaf3a15ae7ccea3b0686bbe10 (patch)
treed3ddd5ec8813e46c35ef0228009a25085e78007b /drivers/gpu/drm
parent820de86a90089ee607d7864538c98a23b503c846 (diff)
drm/gma500/cdv: Unpin framebuffer on crtc disable
The framebuffer needs to be unpinned in the crtc->disable callback because of previous pinning in psb_intel_pipe_set_base(). This will fix a memory leak where the framebuffer was released but not unpinned properly. This patch only affects Cedarview. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=889511 Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=812113 Cc: stable@vger.kernel.org Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/gma500/cdv_intel_display.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpu/drm/gma500/cdv_intel_display.c b/drivers/gpu/drm/gma500/cdv_intel_display.c
index 3cfd0931fbfb..d6742dcc911d 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_display.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_display.c
@@ -1750,6 +1750,19 @@ static void cdv_intel_crtc_destroy(struct drm_crtc *crtc)
1750 kfree(psb_intel_crtc); 1750 kfree(psb_intel_crtc);
1751} 1751}
1752 1752
1753static void cdv_intel_crtc_disable(struct drm_crtc *crtc)
1754{
1755 struct gtt_range *gt;
1756 struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
1757
1758 crtc_funcs->dpms(crtc, DRM_MODE_DPMS_OFF);
1759
1760 if (crtc->fb) {
1761 gt = to_psb_fb(crtc->fb)->gtt;
1762 psb_gtt_unpin(gt);
1763 }
1764}
1765
1753const struct drm_crtc_helper_funcs cdv_intel_helper_funcs = { 1766const struct drm_crtc_helper_funcs cdv_intel_helper_funcs = {
1754 .dpms = cdv_intel_crtc_dpms, 1767 .dpms = cdv_intel_crtc_dpms,
1755 .mode_fixup = cdv_intel_crtc_mode_fixup, 1768 .mode_fixup = cdv_intel_crtc_mode_fixup,
@@ -1757,6 +1770,7 @@ const struct drm_crtc_helper_funcs cdv_intel_helper_funcs = {
1757 .mode_set_base = cdv_intel_pipe_set_base, 1770 .mode_set_base = cdv_intel_pipe_set_base,
1758 .prepare = cdv_intel_crtc_prepare, 1771 .prepare = cdv_intel_crtc_prepare,
1759 .commit = cdv_intel_crtc_commit, 1772 .commit = cdv_intel_crtc_commit,
1773 .disable = cdv_intel_crtc_disable,
1760}; 1774};
1761 1775
1762const struct drm_crtc_funcs cdv_intel_crtc_funcs = { 1776const struct drm_crtc_funcs cdv_intel_crtc_funcs = {