aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEgbert Eich <eich@suse.com>2013-07-17 09:07:22 -0400
committerDave Airlie <airlied@redhat.com>2013-07-29 19:44:20 -0400
commit64c29076646aa0fc094c4b3ea118ea5cb912bfc0 (patch)
tree3f2cca71c4e15e11cdb20650f0db4877a62be9f8
parent030f19f0e24c020e3577d9a0da878e417efc2b39 (diff)
drm/mgag200: Add an crtc_disable callback to the crtc helper funcs
Signed-off-by: Egbert Eich <eich@suse.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/mgag200/mgag200_mode.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
index 251784aa2225..2fe1f6469eb3 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -1251,6 +1251,24 @@ static void mga_crtc_destroy(struct drm_crtc *crtc)
1251 kfree(mga_crtc); 1251 kfree(mga_crtc);
1252} 1252}
1253 1253
1254static void mga_crtc_disable(struct drm_crtc *crtc)
1255{
1256 int ret;
1257 DRM_DEBUG_KMS("\n");
1258 mga_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
1259 if (crtc->fb) {
1260 struct mga_framebuffer *mga_fb = to_mga_framebuffer(crtc->fb);
1261 struct drm_gem_object *obj = mga_fb->obj;
1262 struct mgag200_bo *bo = gem_to_mga_bo(obj);
1263 ret = mgag200_bo_reserve(bo, false);
1264 if (ret)
1265 return;
1266 mgag200_bo_push_sysram(bo);
1267 mgag200_bo_unreserve(bo);
1268 }
1269 crtc->fb = NULL;
1270}
1271
1254/* These provide the minimum set of functions required to handle a CRTC */ 1272/* These provide the minimum set of functions required to handle a CRTC */
1255static const struct drm_crtc_funcs mga_crtc_funcs = { 1273static const struct drm_crtc_funcs mga_crtc_funcs = {
1256 .cursor_set = mga_crtc_cursor_set, 1274 .cursor_set = mga_crtc_cursor_set,
@@ -1261,6 +1279,7 @@ static const struct drm_crtc_funcs mga_crtc_funcs = {
1261}; 1279};
1262 1280
1263static const struct drm_crtc_helper_funcs mga_helper_funcs = { 1281static const struct drm_crtc_helper_funcs mga_helper_funcs = {
1282 .disable = mga_crtc_disable,
1264 .dpms = mga_crtc_dpms, 1283 .dpms = mga_crtc_dpms,
1265 .mode_fixup = mga_crtc_mode_fixup, 1284 .mode_fixup = mga_crtc_mode_fixup,
1266 .mode_set = mga_crtc_mode_set, 1285 .mode_set = mga_crtc_mode_set,