dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: dri-devel@lists.freedesktop.org
Cc: Egbert Eich <eich@suse.de>, Dave Airlie <airlied@redhat.com>,
	Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: [PATCH 4/5] drm/ast: Add an crtc_disable callback to the crtc helper funcs
Date: Tue, 18 Jul 2017 16:47:39 +0200	[thread overview]
Message-ID: <20170718144740.9048-5-tiwai@suse.de> (raw)
In-Reply-To: <20170718144740.9048-1-tiwai@suse.de>

From: Egbert Eich <eich@suse.de>

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

Signed-off-by: Egbert Eich <eich@suse.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 drivers/gpu/drm/ast/ast_mode.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index aaef0a652f10..3549a3356afe 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -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)
-- 
2.13.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2017-07-18 14:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-18 14:47 [PATCH 0/5] ast fix patches Takashi Iwai
2017-07-18 14:47 ` [PATCH 1/5] drm/ast: Simplify function ast_bo_unpin() Takashi Iwai
2017-07-18 14:47 ` [PATCH 2/5] drm/ast: Free container instead of member in ast_user_framebuffer_destroy() Takashi Iwai
2017-07-18 14:47 ` [PATCH 3/5] drm/ast: Fix memleak in error path in ast_bo_create() Takashi Iwai
2017-07-18 14:47 ` Takashi Iwai [this message]
2017-07-18 14:47 ` [PATCH 5/5] drm/ast: Actually load DP501 firmware when required Takashi Iwai
2017-08-02  2:21 ` [PATCH 0/5] ast fix patches Dave Airlie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170718144740.9048-5-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=airlied@redhat.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eich@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).