From patchwork Sun Jul 9 07:43:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Liu X-Patchwork-Id: 9831629 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 65DF060317 for ; Sun, 9 Jul 2017 07:44:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A71027F60 for ; Sun, 9 Jul 2017 07:44:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4CA6B28138; Sun, 9 Jul 2017 07:44:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D6FB627F60 for ; Sun, 9 Jul 2017 07:44:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=QrXbWpkS9D8TPr7D4rBVdPHiD9zqquDkSejmns0Ll7c=; b=BI7 WMj9ssIpGB0OqWla4UVs3v/H6j8yZ+t2bNSf5Dsxi3a+uSym2XwFpMxGz82hdbPQJjD9iFNViGSzv 5djPSYUiZ8tlhQlTVrzYjTIt05bma29q16AATObIis8DYUg7YXJFchRqkx3yLT/KSo75GKanyVrpV FkBBfm6bvngomRDZUFx4RcO8sATfcHTDzCaHz0yTyFkWmoOhBJNiChlBuLRMRikizCgNX99xE4/Nx 2+KxeRaVDsfmvOXfq8Ksk+K1y8o4V4kfGbmvAPht8EBUptNcBuiy93z1cs99TaoUkIWx7Ijruo4LW WW87hcWiyI4wGgBDi8ayVPhrGhiT1ww==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dU6tA-0007Fe-BF; Sun, 09 Jul 2017 07:44:20 +0000 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dU6t6-0007Ee-M7 for linux-arm-kernel@lists.infradead.org; Sun, 09 Jul 2017 07:44:18 +0000 Received: by mail-pf0-x243.google.com with SMTP id c24so10303856pfe.1 for ; Sun, 09 Jul 2017 00:43:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=vxVQ2se3MsOy7tXhMAotMsQ0u8H2ZZRAr0rxYOsvo7M=; b=QJd6NalSFz13gqaLHZLVAKVsOHr0mrdlEYbLTPKLZciVeR//l3NjMA2V7LEB2/rc5b W9fqzV2i7/Oce6GL51s2wi4NVJhkucXEIj2yyGOMSx+tqpKDVX+NQE+hw/r2zXbe6N1w nKf1hSoRKps0tfkYDEBq02SxVpvLGSAn2cjWTffGB5AYtoEjBSrOw/CJHAiAG1Bp4rOn 2kphG6EUVI/DFrmvDGe/xrXkPHMm9OvqCbSjch+Hk3CQ/QMn21uZWsU1xQUClObDwA/r x/y21ziqiw3R1F5ynNu7jAzPFvwUSF1tH9Hs+0QtH5hKbnzThGNAkPMU3xWErbb1Zpui LuWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=vxVQ2se3MsOy7tXhMAotMsQ0u8H2ZZRAr0rxYOsvo7M=; b=jufiSNjvWLmzeNMLasF3sxhxVUIkFt3gmdXtQVE/oRuYx9l017HHDaPY86d0nLy2Tc cNzxQY7DsemMl530I+VNEm4EgT0pJQrdLiLsln0yOg2PFYgq6REOsKvBGatwzqT4LMWq KgfHjOvVh6YaX78DTNvCpBjpZJVn3JGovQuDOGcqri+mZh7yAPfjBuSX14rW5fLDsGAa 8z74f61osHc3nT16IMD/vEemlUaYyR2KeZNPIyqvewRnVeTyGJzPESOZzpTI65Cmor4U aNNiudcvF3u9zziGIT/Gx14VPMgoy877qVM4npFDEZo22s6YJ871s/UF9R8fWxoIxysI i3GA== X-Gm-Message-State: AIVw111RpONXTSYQ7SXEzhVAxS1crys8nJ33E9OwKcoOQ9ZolfrKGf2/ UOOsHeUi+nIkzQ== X-Received: by 10.101.73.72 with SMTP id q8mr9017687pgs.219.1499586235160; Sun, 09 Jul 2017 00:43:55 -0700 (PDT) Received: from 60-242-179-244.static.tpgi.com.au (60-242-179-244.static.tpgi.com.au. [60.242.179.244]) by smtp.gmail.com with ESMTPSA id o6sm12726706pgs.43.2017.07.09.00.43.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jul 2017 00:43:54 -0700 (PDT) From: Jonathan Liu To: Maxime Ripard , David Airlie , Chen-Yu Tsai Subject: [PATCH] drm/sun4i: Implement drm_driver lastclose to restore fbdev console Date: Sun, 9 Jul 2017 17:43:27 +1000 Message-Id: <20170709074327.4953-1-net147@gmail.com> X-Mailer: git-send-email 2.13.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170709_004416_755780_51DF6817 X-CRM114-Status: UNSURE ( 9.29 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-sunxi@googlegroups.com, Jonathan Liu , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The drm_driver lastclose callback is called when the last userspace DRM client has closed. Call drm_fbdev_cma_restore_mode to restore the fbdev console otherwise the fbdev console will stop working. Signed-off-by: Jonathan Liu --- drivers/gpu/drm/sun4i/sun4i_drv.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index abc7d8fe06b4..c434540d409c 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -25,12 +25,20 @@ #include "sun4i_framebuffer.h" #include "sun4i_tcon.h" +static void sun4i_drm_lastclose(struct drm_device *dev) +{ + struct sun4i_drv *drv = dev->dev_private; + + drm_fbdev_cma_restore_mode(drv->fbdev); +} + DEFINE_DRM_GEM_CMA_FOPS(sun4i_drv_fops); static struct drm_driver sun4i_drv_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | DRIVER_ATOMIC, /* Generic Operations */ + .lastclose = sun4i_drm_lastclose, .fops = &sun4i_drv_fops, .name = "sun4i-drm", .desc = "Allwinner sun4i Display Engine",