From patchwork Wed Jul 17 13:07:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Egbert Eich X-Patchwork-Id: 2828594 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5E5B0C0AB2 for ; Wed, 17 Jul 2013 13:15:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3439220186 for ; Wed, 17 Jul 2013 13:15:56 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0A8CA20182 for ; Wed, 17 Jul 2013 13:15:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E6F9543648 for ; Wed, 17 Jul 2013 06:15:54 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.186]) by gabe.freedesktop.org (Postfix) with ESMTP id 50E63E6734 for ; Wed, 17 Jul 2013 06:07:55 -0700 (PDT) Received: from debian (p5DCF2FCF.dip0.t-ipconnect.de [93.207.47.207]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0MARW2-1UsKi40qQE-00BrmT; Wed, 17 Jul 2013 15:07:50 +0200 Received: from sles11.fritz.box (sles11.fritz.box [192.168.178.22]) by debian (Postfix) with ESMTP id 36CA813C7B; Wed, 17 Jul 2013 15:07:47 +0200 (CEST) From: Egbert Eich To: dri-devel@lists.freedesktop.org Subject: [PATCH 09/16] drm/mgag200: Add an crtc_disable callback to the crtc helper funcs Date: Wed, 17 Jul 2013 15:07:22 +0200 Message-Id: <1374066449-21714-10-git-send-email-eich@suse.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1374066449-21714-1-git-send-email-eich@suse.com> References: <1374066449-21714-1-git-send-email-eich@suse.com> X-Provags-ID: V02:K0:imI4WrglZ0Cn5jdO39QXs0DHSe0ienarpOLRpuQvXqf 56OOO2klFBGbHXmjelEFx0l1i9Cnt0Haz+INaamC8N9qh0l7cI MVXTEiRds9sbJFHr8dJ5Xf9z7HkSIhHCYJKjuIlON7UdiE+99/ l4ULF+V/Sqw/VyhxPI0NZSwHpGcswXDDv46V25J6Wmlsfi0iIM KeZslu6A7Q9KTCjxIeJ2QnyCmm+8OHJD/KUqFZe2AeCLMVdq4v A+ILQIgEZDeiCEA40SMnT6l5y/wQrVWVrMnIOfkC2MJO6F71A+ 0rSqIl+/nOofFhi8SKJS1ufpRcS0tLJmp90VOkXb6JktYUMNFF Q0JDEo7uec1QSpmhEpC+Igmx7CGxcOxkQnK/6zWbT Cc: Dave Airlie , Christopher Harvey , Mathieu Larouche , Egbert Eich X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Egbert Eich --- drivers/gpu/drm/mgag200/mgag200_mode.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c index 251784a..2fe1f64 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) kfree(mga_crtc); } +static void mga_crtc_disable(struct drm_crtc *crtc) +{ + int ret; + DRM_DEBUG_KMS("\n"); + mga_crtc_dpms(crtc, DRM_MODE_DPMS_OFF); + if (crtc->fb) { + struct mga_framebuffer *mga_fb = to_mga_framebuffer(crtc->fb); + struct drm_gem_object *obj = mga_fb->obj; + struct mgag200_bo *bo = gem_to_mga_bo(obj); + ret = mgag200_bo_reserve(bo, false); + if (ret) + return; + mgag200_bo_push_sysram(bo); + mgag200_bo_unreserve(bo); + } + crtc->fb = NULL; +} + /* These provide the minimum set of functions required to handle a CRTC */ static const struct drm_crtc_funcs mga_crtc_funcs = { .cursor_set = mga_crtc_cursor_set, @@ -1261,6 +1279,7 @@ static const struct drm_crtc_funcs mga_crtc_funcs = { }; static const struct drm_crtc_helper_funcs mga_helper_funcs = { + .disable = mga_crtc_disable, .dpms = mga_crtc_dpms, .mode_fixup = mga_crtc_mode_fixup, .mode_set = mga_crtc_mode_set,