From patchwork Mon Jul 10 06:55:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Liu X-Patchwork-Id: 9832345 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 76FE5602BD for ; Mon, 10 Jul 2017 06:55:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D7FF26E46 for ; Mon, 10 Jul 2017 06:55:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 607A3283D8; Mon, 10 Jul 2017 06:55:22 +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 0459026E46 for ; Mon, 10 Jul 2017 06:55:22 +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=PwXhZvmkc8cpbVIH2+HVd1k6o865dqUG6MnlRFuKtl0=; b=iQa k3son5bVcXdCbj+spAmS5C2sUf/W9OnU0qbqS7amkcpMT+cqITEY4dHmecbfRF+V6hnK103DfWPtC ++O3HeG9H2raUobtYxzb/CKSQtTLT0VE4rfrsAGJxpj5QTr5wx03p1XQ86WsD3k3V3mGmRAnNiAnm 8kVHrtfYzaPT5B2RZZsLxdilP5jh+PiPQnRSjyyPmPOTqZHtSVpzr01eBOn6zKUzzv2xIzjC0aDwT yxJM8CZDpCttltzpTXS37KM4uwDFZE7lv8VywQBvdh7usHF4amupeKQnp6fmVNaxOMoV8H/w4/A4M BzlhIszxJHYFFa1rRJkPZ+WZ5qBTr3A==; 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 1dUSbI-0000HA-4J; Mon, 10 Jul 2017 06:55:20 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dUSbF-0000Gr-UI for linux-arm-kernel@bombadil.infradead.org; Mon, 10 Jul 2017 06:55:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=SWZ6qrKzc1sC+ZBXzSQX8TzRFY+DEoKKEOnm8ora0gI=; b=kNffhmKa7G7Qc8GwP5Zl+Dl31 ze0h7dh4Cgn+yv6Zuax3zwp25A7mRoqvqV8yAa2RSvvIws/eXNuEpqSAhgA8JvYcOHY3MwHS36b6Z Izh/Qxek5cfDgfo+K2vuNYqICY0XCA1a4lbRyvUl2VdwqqnzWXx+oQt/2Ibfj3/naymqR9Yiba0bo /kfKwzhWe6VRZuU2agvZ4hwh1m3f5QBq+yv0NizQx6ZalSN29PmaPPx98uyY6m8/Fj8T4JIu5ZrHO eHv+Wtuqjzg/4ru1tBg0+6AYeJ7Un4WoZHziRo7B9PgIYEKz8BWxSHIvIyUPaxCVxwDdr+czXbMLG 678Dst2MQ==; Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dUSbC-0000tf-3E for linux-arm-kernel@lists.infradead.org; Mon, 10 Jul 2017 06:55:16 +0000 Received: by mail-pg0-x241.google.com with SMTP id u36so11590139pgn.3 for ; Sun, 09 Jul 2017 23:54:50 -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=SWZ6qrKzc1sC+ZBXzSQX8TzRFY+DEoKKEOnm8ora0gI=; b=OEMrPvJLhvqyeFV1jomkwhB1NuFXLTTix4j3jmjsLJ4Uz6YlM8bPjRtmll83ur6Nsi CPaUYAUZPk2AIRIXI5KUVH/s80MXqGkzG1Pk3hcYJokLEOFnnWauGI/ng7ip+IXMWNap vOlefQauDLrtt1h/NB7hqaqJf+U7ikMVFjF5r+erDu0My2pUgT6C3uYbJJNSIPkJyToH BC6/3OQCLDvZt4mnPFPs8Q8LD4BBXife7BKfW9c+uXEfeu2qn6VR+FKVksWJUyldRFtv 4n+jQu4YRv5YHnhN/R1dowqYbynhxNOKMWWQgHW7Wghl1Gb5UMftkBmcBL/Vfrzr6su7 3tBg== 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=SWZ6qrKzc1sC+ZBXzSQX8TzRFY+DEoKKEOnm8ora0gI=; b=uLCNpP3Y2olTL1ifHQE5DGDmx7l3qVSdeIM0iOtpoNTvUen/4OqLkYtwKuJYIGIgm7 NpY3yTCGGW+Zi7e4wEPmyuCtSRV4apXXSuFevRXrg2xWvJDgDy9acxvH8zdxlrjPBKdd S0HKTh632T+/TDj8fFba0lV0XonGnLAV7rQPL0aLGKlJrxfG03V8wUMpi/51ANBG3XGX fAY3WaozKenf3cNQqjXF6Qj1JuLov21a118KlH2CJFweJ/SvU8lLnoHXy3g0w+R6JnX9 Qt4AwdNYuGxiLHJFAALgrOoMtABpYbKlkSUQfXQkY61Y9x49Ildw3fkl6DsZeWN3x6lG +xXA== X-Gm-Message-State: AIVw112hJafx1WfF0w4LC5p7klpunhr230F7N7Mqp5my++wxdfh9Q9Jo q4CT0GccryX0Yg== X-Received: by 10.98.212.91 with SMTP id u27mr44441383pfl.157.1499669688086; Sun, 09 Jul 2017 23:54:48 -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 t11sm24315810pfi.66.2017.07.09.23.54.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jul 2017 23:54:47 -0700 (PDT) From: Jonathan Liu To: Maxime Ripard , David Airlie , Chen-Yu Tsai Subject: [PATCH v3] drm/sun4i: Implement drm_driver lastclose to restore fbdev console Date: Mon, 10 Jul 2017 16:55:04 +1000 Message-Id: <20170710065504.31497-1-net147@gmail.com> X-Mailer: git-send-email 2.13.2 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: Jonathan Liu , linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux-sunxi@googlegroups.com, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.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. Fixes: 9026e0d122ac ("drm: Add Allwinner A10 Display Engine support") Cc: stable@vger.kernel.org Signed-off-by: Jonathan Liu Reviewed-by: Chen-Yu Tsai Tested-by: Olliver Schinagl --- Changes for v3: - Add 'Fixes:' tag - Add CC to stable - Add 'Reviewed-by: Chen-Yu Tsai ' Changes for v2: - Rename sun4i_drm_lastclose to sun4i_drv_lastclose 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..a45a627283a1 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_drv_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_drv_lastclose, .fops = &sun4i_drv_fops, .name = "sun4i-drm", .desc = "Allwinner sun4i Display Engine",