aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlija Hadzic <ilijahadzic@gmail.com>2013-11-02 23:00:20 -0400
committerAlex Deucher <alexander.deucher@amd.com>2013-11-08 12:33:37 -0500
commit520a8718fe1bb03a8fb58bfe1b0c0ca083a381cc (patch)
tree84bfce5756499dea4f3f5cb852a6b96d09550595
parent75b871e2d831700d8fd63079eebbbc36b6731bdf (diff)
drm/radeon/kms: add crtc_disable function for legacy crtc
To plug the VRAM memory leak (see previous patch for details) we must unpin the frame buffer when disabling the CRTC. This warrants the addition of disable function for legacy CRTC, which puts the CRTC in DPMS-OFF state and unpins the frame buffer if there is one associated with the CRTC. Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/radeon/radeon_legacy_crtc.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
index 7cb178a34a0f..0c7b8c66301b 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
@@ -1056,6 +1056,26 @@ static void radeon_crtc_commit(struct drm_crtc *crtc)
1056 } 1056 }
1057} 1057}
1058 1058
1059static void radeon_crtc_disable(struct drm_crtc *crtc)
1060{
1061 radeon_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
1062 if (crtc->fb) {
1063 int r;
1064 struct radeon_framebuffer *radeon_fb;
1065 struct radeon_bo *rbo;
1066
1067 radeon_fb = to_radeon_framebuffer(crtc->fb);
1068 rbo = gem_to_radeon_bo(radeon_fb->obj);
1069 r = radeon_bo_reserve(rbo, false);
1070 if (unlikely(r))
1071 DRM_ERROR("failed to reserve rbo before unpin\n");
1072 else {
1073 radeon_bo_unpin(rbo);
1074 radeon_bo_unreserve(rbo);
1075 }
1076 }
1077}
1078
1059static const struct drm_crtc_helper_funcs legacy_helper_funcs = { 1079static const struct drm_crtc_helper_funcs legacy_helper_funcs = {
1060 .dpms = radeon_crtc_dpms, 1080 .dpms = radeon_crtc_dpms,
1061 .mode_fixup = radeon_crtc_mode_fixup, 1081 .mode_fixup = radeon_crtc_mode_fixup,
@@ -1065,6 +1085,7 @@ static const struct drm_crtc_helper_funcs legacy_helper_funcs = {
1065 .prepare = radeon_crtc_prepare, 1085 .prepare = radeon_crtc_prepare,
1066 .commit = radeon_crtc_commit, 1086 .commit = radeon_crtc_commit,
1067 .load_lut = radeon_crtc_load_lut, 1087 .load_lut = radeon_crtc_load_lut,
1088 .disable = radeon_crtc_disable
1068}; 1089};
1069 1090
1070 1091