Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab209c32 authored by Egbert Eich's avatar Egbert Eich Committed by Dave Airlie
Browse files

drm/ast: Add an crtc_disable callback to the crtc helper funcs



Implement the proper CRTC disablement, just like done in mgag200
driver.

Signed-off-by: default avatarEgbert Eich <eich@suse.de>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent b2d44e23
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -613,7 +613,23 @@ static int ast_crtc_mode_set(struct drm_crtc *crtc,

static void ast_crtc_disable(struct drm_crtc *crtc)
{
	int ret;

	DRM_DEBUG_KMS("\n");
	ast_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
	if (crtc->primary->fb) {
		struct ast_framebuffer *ast_fb = to_ast_framebuffer(crtc->primary->fb);
		struct drm_gem_object *obj = ast_fb->obj;
		struct ast_bo *bo = gem_to_ast_bo(obj);

		ret = ast_bo_reserve(bo, false);
		if (ret)
			return;

		ast_bo_push_sysram(bo);
		ast_bo_unreserve(bo);
	}
	crtc->primary->fb = NULL;
}

static void ast_crtc_prepare(struct drm_crtc *crtc)