From patchwork Sun Apr 17 05:25:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 8862451 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2EB579F36E for ; Sun, 17 Apr 2016 05:25:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 649CA20204 for ; Sun, 17 Apr 2016 05:25:14 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 78190201C0 for ; Sun, 17 Apr 2016 05:25:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0A8DA6E2E2; Sun, 17 Apr 2016 05:25:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kmu-office.ch (mail.kmu-office.ch [178.209.48.109]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9BDB56E274 for ; Sun, 17 Apr 2016 05:25:06 +0000 (UTC) Received: from localhost.localdomain (unknown [IPv6:2601:602:8f02:dcfc:3e97:eff:fe92:db3b]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 2C1605C00E5; Sun, 17 Apr 2016 07:23:33 +0200 (CEST) From: Stefan Agner To: dri-devel@lists.freedesktop.org, stefan@agner.ch Subject: [PATCH 6/6] drm/fsl-dcu: implement lastclose callback Date: Sat, 16 Apr 2016 22:25:55 -0700 Message-Id: <1460870755-22964-7-git-send-email-stefan@agner.ch> X-Mailer: git-send-email 2.8.0 In-Reply-To: <1460870755-22964-1-git-send-email-stefan@agner.ch> References: <1460870755-22964-1-git-send-email-stefan@agner.ch> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1460870614; bh=5nivvGd7lkr3LW8uFM+MC/39285cEP5Al2mfiguJsNI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=c4eddwTFeHust97N/+gH4E51pmclBRYGPE4cMkhBqCOEc5ugrQVnGWknWqHDNfgnHkrxWTvDTvg89k1L20+qu8wAzvcZ42dqrRZZ2XOuaylNob/x1/Fpzicse9Dq+8dmbAi4CaWp6B8DpW8Jm3QCKBlnetGhpp0+YORjUXPtRms= Cc: jianwei.wang.chn@gmail.com, meng.yi@nxp.com, alison.wang@freescale.com, linux-kernel@vger.kernel.org, alexander.stein@systec-electronic.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 Use CMA helper drm_fbdev_cma_restore_mode to restore fbdev mode in process which uses drm/kms dies. Signed-off-by: Stefan Agner --- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c index f9227b7..ef41bde 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c @@ -168,6 +168,13 @@ static void fsl_dcu_drm_disable_vblank(struct drm_device *dev, regmap_write(fsl_dev->regmap, DCU_INT_MASK, value); } +static void fsl_dcu_drm_lastclose(struct drm_device *dev) +{ + struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; + + drm_fbdev_cma_restore_mode(fsl_dev->fbdev); +} + static const struct file_operations fsl_dcu_drm_fops = { .owner = THIS_MODULE, .open = drm_open, @@ -185,6 +192,7 @@ static const struct file_operations fsl_dcu_drm_fops = { static struct drm_driver fsl_dcu_drm_driver = { .driver_features = DRIVER_HAVE_IRQ | DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | DRIVER_ATOMIC, + .lastclose = fsl_dcu_drm_lastclose, .load = fsl_dcu_load, .unload = fsl_dcu_unload, .irq_handler = fsl_dcu_drm_irq,