From patchwork Sat Sep 1 14:08:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 10584789 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1258F16B1 for ; Sat, 1 Sep 2018 14:11:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1575C2A218 for ; Sat, 1 Sep 2018 14:11:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 084D52A223; Sat, 1 Sep 2018 14:11:12 +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=-2.1 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 611682A218 for ; Sat, 1 Sep 2018 14:11:11 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:MIME-Version:Subject:From:References :In-Reply-To:Message-Id:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2On7cObmTVyWeFGoAAUrNQ5CMJ51vd11qCE+HnPIkes=; b=Z1Gj9xG+pVZ0gv U8wa3Sn60VQefMKoEE/8u6GXAlCegUVKhjrckiig0BJNoqwaOgSpUt40WXscotjnUNjXj3CaBHNNU CQVweS04x/mhWLjVBWUrSRAMIy7eS54fZIKXONr0UaieaYL8xB5VRC67XGwu0J08RDUgXy1KHAaz+ r9dP/TEcWwvncs7oWQK3lk2SV4v0LtpFSJQHjn8PVeKLbH9Za77ieV51Of2sklWuKrFtZshMNQYdT MdNqyVTJp7tEH8/NBXtsiuPIvv6hBRP/KXiRkjPUXExy9ZL/DhDuzcQuoAcIJKGFJF8GC9VORzODm iUbtzbNW1ooRiE47hL/w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fw6cC-0002xw-A5; Sat, 01 Sep 2018 14:11:04 +0000 Received: from rere.qmqm.pl ([91.227.64.183]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fw6a7-0000eq-Ta for linux-arm-kernel@lists.infradead.org; Sat, 01 Sep 2018 14:08:59 +0000 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 422dNk314tzKm; Sat, 1 Sep 2018 16:08:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1535810886; bh=hRk3jex+VsnaxjKatFyqrxazpRc2Tv1gzSGnx/JsTug=; h=Date:In-Reply-To:References:From:Subject:To:Cc:Cc:From; b=j8UrE83unDg33kNkKVJ0XVBafM4VdMcf4a0683ixPUAthoufp8sWpjJNGry94FZpu jxo3lkhSG1sRmneezsVwDjTXGLm+eJ3YQIgwmYlNOIdiC2G7yJfpp3M0feEINBZjv4 i5nRCNtwYxwUk9KU+OR+TVSwlzFMRXzro3lddIW6ienernKSvptTL4TlVj2taOfBTK rXV+nzVNbMIDr4zLMXaCUgTenAfTca7JZx7+xX+kcLWrg9tn8QqdDHMVdk4iXkOidq Oy3zGRIIxelVTCf3OapQJThT/zlqJlu4h/LJjWcpnEKAld+Dq4XgzaKYDxjyRlF4Cu UpWnDHoOe2uZg== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail Date: Sat, 01 Sep 2018 16:08:44 +0200 Message-Id: In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v3 01/13] fbdev: show fbdev number for debugging MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180901_070856_147376_214B49A4 X-CRM114-Status: UNSURE ( 9.70 ) 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-fbdev@vger.kernel.org, linux-tegra@vger.kernel.org, Bartlomiej Zolnierkiewicz , David Airlie , amd-gfx@lists.freedesktop.org, Jonathan Hunter , Eric Anholt , Thierry Reding , Gerd Hoffmann , Alex Deucher , Dave Airlie , Maxime Ripard , virtualization@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org 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 Signed-off-by: Michał Mirosław Acked-by: Bartlomiej Zolnierkiewicz Acked-by: Daniel Vetter --- drivers/video/fbdev/core/fbmem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index f741ba8df01b..30a18d4c9de4 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1618,8 +1618,8 @@ static int do_remove_conflicting_framebuffers(struct apertures_struct *a, (primary && gen_aper && gen_aper->count && gen_aper->ranges[0].base == VGA_FB_PHYS)) { - printk(KERN_INFO "fb: switching to %s from %s\n", - name, registered_fb[i]->fix.id); + printk(KERN_INFO "fb%d: switching to %s from %s\n", + i, name, registered_fb[i]->fix.id); ret = do_unregister_framebuffer(registered_fb[i]); if (ret) return ret; From patchwork Sat Sep 1 14:08:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 10584785 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 980E316B1 for ; Sat, 1 Sep 2018 14:09:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 986072A20B for ; Sat, 1 Sep 2018 14:09:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8B1952A218; Sat, 1 Sep 2018 14:09:42 +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=-2.1 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 444A22A20B for ; Sat, 1 Sep 2018 14:09:42 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:MIME-Version:Subject:From:References :In-Reply-To:Message-Id:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7Ud/9v+zflJuY+OpdbFSgZXOCRchfCZ271flyoS5F8s=; b=XtRNpxtg6VQ5vL XGXrlwIb3S8Mremv14chyjSByrNRqCAJOpWbeTcE2pc9aIUahauaT1S9+NVijDnTsiZaY76f045wd j7fmThSq29rY6fljtR38ROwbm73gLI9fkD2WMahI/wqVBeZr34HlS3JHWff7UxTOMNqP70oHfNJnt hVKkqWFkpmMt86oYbhPMuZI252cMtTUz83AcRz0eieveRDVbZkKKOt0QFlO5Ie1z/XFA6LE9UD67V U/HV+0P0syG+IwLCVKkqoK31cHbmWiuAxcjnSkHc0YHQV3DXEexRYe0SElMcdtm8QVZRBkBPG8OcW 3kRKQHPPcxGn3XH+jM9w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fw6aj-000175-GX; Sat, 01 Sep 2018 14:09:33 +0000 Received: from rere.qmqm.pl ([91.227.64.183]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fw6a7-0000er-TZ for linux-arm-kernel@lists.infradead.org; Sat, 01 Sep 2018 14:08:57 +0000 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 422dNk5rGtzbZ; Sat, 1 Sep 2018 16:08:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1535810886; bh=Eh3NwSBhd/6qo4Gal61knpd5lppRQQ+HPCEaYA1Bwwk=; h=Date:In-Reply-To:References:From:Subject:To:Cc:Cc:From; b=GwrGh/YtptzEKnqzQqlj6eNtUbcHx+yBKOqzGhNsXXgky4lLMy2VLDGWdTUi3gXi1 /+9En/gUXDjiQggYxobxLqvB7qLASHq+ExpBbWb7kxcRoSKy7da3hm37sJsPn04iJ1 wyqTTqkQGglNvP4wWX+84y04g7zYZIPXK9WU+D3qwq23SLuklp4tETLGf019Ypc1dx nk0O1SwXDt6xGG7fL+NVf+23nCY96EuUUG07gCbREPyibeW7Jb9SnQsLtKvmLmCjqd v/zeBPZkNhJxAg8s2hvvUJW+pB80bX9W1FiJTNj2dorzH5ZgsoSzPo2iwPKYxs5eBM IiGOiMOAVAWdQ== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail Date: Sat, 01 Sep 2018 16:08:44 +0200 Message-Id: In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v3 02/13] fbdev: allow apertures == NULL in remove_conflicting_framebuffers() MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180901_070856_136132_9FFA04D7 X-CRM114-Status: UNSURE ( 8.76 ) 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-fbdev@vger.kernel.org, linux-tegra@vger.kernel.org, Bartlomiej Zolnierkiewicz , David Airlie , amd-gfx@lists.freedesktop.org, Jonathan Hunter , Eric Anholt , Thierry Reding , Gerd Hoffmann , Alex Deucher , Dave Airlie , Maxime Ripard , virtualization@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org 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 Interpret (otherwise-invalid) NULL apertures argument to mean all-memory range. This will allow to remove several duplicates of this code from drivers in following patches. Signed-off-by: Michał Mirosław Acked-by: Bartlomiej Zolnierkiewicz --- v2: added kerneldoc to corresponding DRM helper v3: split kerneldoc to another patch --- drivers/video/fbdev/core/fbmem.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 30a18d4c9de4..0df148eb4699 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1779,11 +1779,25 @@ int remove_conflicting_framebuffers(struct apertures_struct *a, const char *name, bool primary) { int ret; + bool do_free = false; + + if (!a) { + a = alloc_apertures(1); + if (!a) + return -ENOMEM; + + a->ranges[0].base = 0; + a->ranges[0].size = ~0; + do_free = true; + } mutex_lock(®istration_lock); ret = do_remove_conflicting_framebuffers(a, name, primary); mutex_unlock(®istration_lock); + if (do_free) + kfree(a); + return ret; } EXPORT_SYMBOL(remove_conflicting_framebuffers); From patchwork Sat Sep 1 14:08:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 10584783 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 28FF413AC for ; Sat, 1 Sep 2018 14:09:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28C4F2A20B for ; Sat, 1 Sep 2018 14:09:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B0B22A218; Sat, 1 Sep 2018 14:09:07 +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=-2.1 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 C8FEB2A20B for ; Sat, 1 Sep 2018 14:09:06 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:MIME-Version:Subject:From:References :In-Reply-To:Message-Id:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XkiL9ClDUfsZwbmRSyh5CZR2i5XdwJol5KzV2NS5vT8=; b=b8h63/j8CXiKnR 3suy+QP54IFvGte/NL5FGr4xMp2mIvcQUKiROIVUxH6eDplFre1kHN+FijFG4+rtIw0SYmgSz8vs0 LG5SLC0s4xB/ds9c89Q8npyyzSeISGxbxIxpJxxI5lGVb6rNMiE4JEq4lVDPP5QiLGjxv1qn3RI3W /aEbsbs7G6G7csY89Qu4yT+CEPlsvXzB7MZ7q40Argoraz8218PGpASwJG8NcLD73bS/3JNS+7X2J W7W6D0qFkv8kz5Cg9knCFrLIjQpZiHhmfZ0bDO0mwsG2Y9FTGst+rcr+WXRgId06DA9G02z8VJ/NA ZKf/PmQh08DLziwKDYvA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fw6aD-0000gz-Ev; Sat, 01 Sep 2018 14:09:01 +0000 Received: from rere.qmqm.pl ([91.227.64.183]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fw6a7-0000es-Tc for linux-arm-kernel@lists.infradead.org; Sat, 01 Sep 2018 14:08:57 +0000 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 422dNl22dHzbk; Sat, 1 Sep 2018 16:08:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1535810887; bh=Z5WHrdyLJFPdU/lgtm0NLTvJjpJ2i8D9onnzHsme35k=; h=Date:In-Reply-To:References:From:Subject:To:Cc:Cc:From; b=qhDKAEumYbZR2k2tGzVrl2P1EMKNtPLoxbuADZ96DHyk6DI/LLyHfTsE5GaOS4T0D nzBLImXC7P9zz4V8/0NZ0Wmot/qzwfEOQC5pjbbJ0Md9/ohwwEINZGfGwwQO0BOpr4 ySG0CBL3MgXQjdtpiy4BvdF5mkYYdoqSfuZ7NNYIyfisVWI4mas1lG895zEl85qbLr h6UjW4g3Xf/I3FZSaYrEqz1ilD6GDm3ZA/qDKKwJhvjWpiBIHHdyszV3BGTiAQtsfS WkiQ1SAFSMEQe73RDoY1xXAtnhQBySiMulgi54HEtevqQkdHUeQROmrrBVqvw4JCv1 hACuFQyNN2kdA== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail Date: Sat, 01 Sep 2018 16:08:45 +0200 Message-Id: <283fef19815b991700b56119d8d5874a2a8da44e.1535810304.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v3 03/13] fbdev: add kerneldoc do remove_conflicting_framebuffers() MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180901_070856_143616_38027273 X-CRM114-Status: UNSURE ( 9.44 ) 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-fbdev@vger.kernel.org, linux-tegra@vger.kernel.org, Bartlomiej Zolnierkiewicz , David Airlie , amd-gfx@lists.freedesktop.org, Jonathan Hunter , Eric Anholt , Thierry Reding , Gerd Hoffmann , Alex Deucher , Dave Airlie , Maxime Ripard , virtualization@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org 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 Document remove_conflicting_framebuffers() behaviour. Signed-off-by: Michał Mirosław Acked-by: Paul Menzel --- drivers/video/fbdev/core/fbmem.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 0df148eb4699..2de93b5014e3 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1775,6 +1775,16 @@ int unlink_framebuffer(struct fb_info *fb_info) } EXPORT_SYMBOL(unlink_framebuffer); +/** + * remove_conflicting_framebuffers - remove firmware-configured framebuffers + * @a: memory range, users of which are to be removed + * @name: requesting driver name + * @primary: also kick vga16fb if present + * + * This function removes framebuffer devices (initialized by firmware/bootloader) + * which use memory range described by @a. If @a is NULL all such devices are + * removed. + */ int remove_conflicting_framebuffers(struct apertures_struct *a, const char *name, bool primary) { From patchwork Sat Sep 1 14:08:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 10584787 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E07E016B1 for ; Sat, 1 Sep 2018 14:10:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3C4A2A218 for ; Sat, 1 Sep 2018 14:10:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D7C892A223; Sat, 1 Sep 2018 14:10:37 +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=-2.1 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 6197C2A218 for ; Sat, 1 Sep 2018 14:10:37 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:MIME-Version:Subject:From:References :In-Reply-To:Message-Id:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IS2ZpjRteHSUanf/V0fq71rsqi/wlF/IJFxzNKYKXA8=; b=Evg3uTnWFEWFpC U2k6oIZseTIYwA2HKIisa482gXk4TkDeE2l6JkFWENxq7VNzYqr7Y6G/V6kzjFpKlpjC5gsbXjdLM ddeWmL2W+gWR5qSWRYlcskGu2MiPxx3yPsG6+lZFY/iHkCz7Y3n6rQJmBtGi4ZEEpBdAD2b+mQvVB Je+tgldh4WwhQmjWA4MlqkgYZjlB2q229Wd7GN4P3o4LcETGVlZZB3vPaIPAbMwmN7zC7XA2aJhi4 kI6oXF3zt8ZBjipAztPCWIy9WxIoW4r0aUniRBxglVD8aVcnPA3O7RYiMux7L2L6KbKUpKk0/zv40 GUI1RVaoyf4SGSaBZYsw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fw6bW-0001uW-7j; Sat, 01 Sep 2018 14:10:22 +0000 Received: from rere.qmqm.pl ([91.227.64.183]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fw6a7-0000et-TY for linux-arm-kernel@lists.infradead.org; Sat, 01 Sep 2018 14:08:59 +0000 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 422dNl58hQzdC; Sat, 1 Sep 2018 16:08:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1535810887; bh=chMZQiuJkZVb/oGMhUJ0Y2jWN0e8uTlU+J2Rh2hB2+U=; h=Date:In-Reply-To:References:From:Subject:To:Cc:Cc:From; b=WkxRhtYMtLQZu8QvljKL584ecjIb7Ghy7eTxPbfA6ZyoqkWZnCP+0sJ+3nnuGBY6I HSA9D//XUC/VzAMa9aK43YARMQvnD/quQOEZpIHNNUABXg0hwHop86nfv0+Bjs7pSR rKjWvuzceipaJ8mQbDhn3BVSnlKFYV5hSQ/RLui3osD+9G6Hg6vBNmu80z2Aoxn4Ou LC7xD5Cs3Jx2i/8HTefQvPkaS7kPfxk8PxWOGNaFzC3waCDTSDu0/eC8gKSG/HXtvc er0LxAkDHamlr+YP9YHwETROXIi42xRqoTlqObcjViV1WaigK3kMIri3aqH+pVZBVY 9za6md3gvcCDg== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail Date: Sat, 01 Sep 2018 16:08:45 +0200 Message-Id: <7db1c278276de420eb45a1b71d06b5eb6bbd49ef.1535810304.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v3 04/13] fbdev: add remove_conflicting_pci_framebuffers() MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180901_070856_308871_1B30FF48 X-CRM114-Status: GOOD ( 10.15 ) 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-fbdev@vger.kernel.org, linux-tegra@vger.kernel.org, Bartlomiej Zolnierkiewicz , David Airlie , amd-gfx@lists.freedesktop.org, Jonathan Hunter , Eric Anholt , Thierry Reding , Gerd Hoffmann , Alex Deucher , Dave Airlie , Maxime Ripard , virtualization@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org 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 Almost all PCI drivers using remove_conflicting_framebuffers() wrap it with the same code. --- v2: add kerneldoc for DRM helper v3: propagate remove_conflicting_framebuffers() return value + move kerneldoc to where function is implemented Signed-off-by: Michał Mirosław --- drivers/video/fbdev/core/fbmem.c | 35 ++++++++++++++++++++++++++++++++ include/drm/drm_fb_helper.h | 12 +++++++++++ include/linux/fb.h | 2 ++ 3 files changed, 49 insertions(+) diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 2de93b5014e3..cd96b1c62bbe 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -34,6 +34,7 @@ #include #include #include +#include #include @@ -1812,6 +1813,40 @@ int remove_conflicting_framebuffers(struct apertures_struct *a, } EXPORT_SYMBOL(remove_conflicting_framebuffers); +/** + * remove_conflicting_pci_framebuffers - remove firmware-configured framebuffers for PCI devices + * @pdev: PCI device + * @resource_id: index of PCI BAR configuring framebuffer memory + * @name: requesting driver name + * + * This function removes framebuffer devices (eg. initialized by firmware) + * using memory range configured for @pdev's BAR @resource_id. + * + * The function assumes that PCI device with shadowed ROM drives a primary + * display and so kicks out vga16fb. + */ +int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, const char *name) +{ + struct apertures_struct *ap; + bool primary = false; + int err; + + ap = alloc_apertures(1); + if (!ap) + return -ENOMEM; + + ap->ranges[0].base = pci_resource_start(pdev, res_id); + ap->ranges[0].size = pci_resource_len(pdev, res_id); +#ifdef CONFIG_X86 + primary = pdev->resource[PCI_ROM_RESOURCE].flags & + IORESOURCE_ROM_SHADOW; +#endif + err = remove_conflicting_framebuffers(ap, name, primary); + kfree(ap); + return err; +} +EXPORT_SYMBOL(remove_conflicting_pci_framebuffers); + /** * register_framebuffer - registers a frame buffer device * @fb_info: frame buffer info structure diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h index b069433e7fc1..20ea856db900 100644 --- a/include/drm/drm_fb_helper.h +++ b/include/drm/drm_fb_helper.h @@ -577,4 +577,16 @@ drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a, #endif } +static inline int +drm_fb_helper_remove_conflicting_pci_framebuffers(struct pci_dev *pdev, + int resource_id, + const char *name) +{ +#if IS_REACHABLE(CONFIG_FB) + return remove_conflicting_pci_framebuffers(pdev, resource_id, name); +#else + return 0; +#endif +} + #endif diff --git a/include/linux/fb.h b/include/linux/fb.h index aa74a228bb92..abeffd55b66a 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -632,6 +632,8 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf, extern int register_framebuffer(struct fb_info *fb_info); extern int unregister_framebuffer(struct fb_info *fb_info); extern int unlink_framebuffer(struct fb_info *fb_info); +extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, + const char *name); extern int remove_conflicting_framebuffers(struct apertures_struct *a, const char *name, bool primary); extern int fb_prepare_logo(struct fb_info *fb_info, int rotate); From patchwork Sat Sep 1 14:08:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 10584795 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3AA4D16B1 for ; Sat, 1 Sep 2018 14:14:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F0122A3BD for ; Sat, 1 Sep 2018 14:14:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 309962A3D1; Sat, 1 Sep 2018 14:14:11 +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=-2.1 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 7E6C52A3BD for ; Sat, 1 Sep 2018 14:14:10 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:MIME-Version:Subject:From:References :In-Reply-To:Message-Id:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GEjotZXtiC/5mt1PfOecTlCD9401ltPUzms/rYW8Fug=; b=bKGDLpbgqJaZOh eVXSLvFuTblL7KHMRlilLNESKPl6BoWFmdR5+O1JlyxXra9sP5nP+sZVMB5SolOSsLQ4KrJAWWD+V RuQUKgG/rnEbHoicURS6zB7XeVRs02w/MdfNGudQjApxRd8aQD+mDTyjvfuiZlcMNcR/GGK65rJAl En72OC/wVwgjCgSKLouqsKTGcYnQuu6Fjg+9Kl48jbwub57q1Fm+3to9J6n8FNONi8mdKD8NW/Cx3 2Iq7xTUHoO+2CceMnRvjuworFmOiEmbpfBny0iAQxqEWP5qsmOmNVgxmTwpsbVMEzztb74BI/xZVS httOX8Zf6x0LEE19Mejw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fw6f5-0004BJ-A5; Sat, 01 Sep 2018 14:14:03 +0000 Received: from rere.qmqm.pl ([91.227.64.183]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fw6aL-0000gs-A4 for linux-arm-kernel@lists.infradead.org; Sat, 01 Sep 2018 14:09:14 +0000 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 422dNm10GRzlw; Sat, 1 Sep 2018 16:08:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1535810888; bh=jJnq4zIPxTkKkKHsjr6LnVL6qL/QGLJvzMtvktLt+y0=; h=Date:In-Reply-To:References:From:Subject:To:Cc:Cc:From; b=UHEOjVvLbT+6tdGl9B/sDuv+OuhP4MWh1MHt6MUR8gzqlitqN2Bk0XLoXE68e9pt4 i2vu3TPkY8gnHKoAjhuBIG8MK6K5tqW95mNlEqNDzFzD4X838PmgR2cmfllYSrrcda OGbscfbIqzDOO+R6KkhChiy//fqtzYi96H84dLQ8coPdIiirtpUF5jEV+KjnUpsbR2 HzTdchJwm5Fmf8pJ43IgKdpKdboyIjrz04M2IklF5pFE3b7viiZndOREuhOACBfDzA Owwc2Jl3VbE3ZqQEY/Bf55g0cifziWDqoVND2/bZ7jRX91W46jLxFeDawUWR12UC0E O06pqeajvS4dA== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail Date: Sat, 01 Sep 2018 16:08:46 +0200 Message-Id: In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v3 05/13] drm/amdgpu: use simpler remove_conflicting_pci_framebuffers() MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180901_070909_769450_4809CE46 X-CRM114-Status: GOOD ( 10.11 ) 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-fbdev@vger.kernel.org, linux-tegra@vger.kernel.org, Bartlomiej Zolnierkiewicz , David Airlie , amd-gfx@lists.freedesktop.org, Jonathan Hunter , Eric Anholt , Thierry Reding , Gerd Hoffmann , Alex Deucher , Dave Airlie , Maxime Ripard , virtualization@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org 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 Signed-off-by: Michał Mirosław Acked-by: Alex Deucher Acked-by: Daniel Vetter --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 0b19482b36b8..9b6e037719db 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -560,28 +560,6 @@ MODULE_DEVICE_TABLE(pci, pciidlist); static struct drm_driver kms_driver; -static int amdgpu_kick_out_firmware_fb(struct pci_dev *pdev) -{ - struct apertures_struct *ap; - bool primary = false; - - ap = alloc_apertures(1); - if (!ap) - return -ENOMEM; - - ap->ranges[0].base = pci_resource_start(pdev, 0); - ap->ranges[0].size = pci_resource_len(pdev, 0); - -#ifdef CONFIG_X86 - primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW; -#endif - drm_fb_helper_remove_conflicting_framebuffers(ap, "amdgpudrmfb", primary); - kfree(ap); - - return 0; -} - - static int amdgpu_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { @@ -609,7 +587,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev, return ret; /* Get rid of things like offb */ - ret = amdgpu_kick_out_firmware_fb(pdev); + ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "amdgpudrmfb"); if (ret) return ret; From patchwork Sat Sep 1 14:08:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 10584805 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0BF3116B1 for ; Sat, 1 Sep 2018 14:17:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0FAD329400 for ; Sat, 1 Sep 2018 14:17:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2FAC2919A; Sat, 1 Sep 2018 14:17:54 +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=-2.1 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 7A608288A7 for ; Sat, 1 Sep 2018 14:17:54 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:MIME-Version:Subject:From:References :In-Reply-To:Message-Id:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3RmcIvIWpBRj1MZFHYNnMhQDh11DRNoTnbFeIy0GUSk=; b=qIeTVJzBVbO9T8 BPUbLiIF5MCdykpUzbyhJuPC+qi5wPmHHu9J9icZ9iyQCXS3jI6dSvNtIVz8Ff15fHIg3VXhkPPTt WX6ekdfNxg7sg4I5NnW6Kz+qZFq3vw6eFTvs+aeosJeZu5w0acfCelHXrAmLoft0dAlL3XNHg42Oi 9iJhtF9pF1xieQqIvTxqwwAmPmg+lzjvcZ5BTgtVUpVeCtJEa00MUB2uw2tOSxFeb27u5ZYaWgEwt E+D3w9UOguQwtPLdiVvjb/IxLPKYTZ10jf/dCl5W6A/RhNBlaCc5TrIpPeiXq+GiMjLU8q9sI4TQm fCLBh12/KYY5b5SyDnnw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fw6id-0007EJ-57; Sat, 01 Sep 2018 14:17:43 +0000 Received: from rere.qmqm.pl ([91.227.64.183]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fw6aL-0000gt-9d for linux-arm-kernel@lists.infradead.org; Sat, 01 Sep 2018 14:09:14 +0000 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 422dNm5KVpzpM; Sat, 1 Sep 2018 16:08:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1535810888; bh=V6edOcizDa5A67hnilRwp0bSN35/WP1foanZNTCSgqQ=; h=Date:In-Reply-To:References:From:Subject:To:Cc:Cc:From; b=KQMYdd8KZuIXQLMHz1VtPFZTYHgR6Cb5ZU8f5wyk5g9P4ST0fziaWmBETdW3DLTgA VInbwuaUV0LUuLP2NoAYZcAh89ft3sqDym0YlnOHqfvGJDyhkDjLSrpqPFMu7dgdbn 750V98jaWH+yukkIxh6PbOQyoCMuDzMfHe3EE1tq33cCnJuPBFO00J1z1hKZGuK2uN p4Nu/pR670ATNcILT9dIuIh/+nQH+lVqWvkt/gYnJbm5EWTYs5YdT/sVVnjlvr7fum uXjp8k5oYWzk+9ABzvcZL+ZTDcfmfkL/j3pRyGU6KMPo087tKP+ovAmfFaTGvm3h9N oTP29jWhF/lng== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail Date: Sat, 01 Sep 2018 16:08:46 +0200 Message-Id: In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v3 06/13] drm/bochs: use simpler remove_conflicting_pci_framebuffers() MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180901_070909_793457_00C9366D X-CRM114-Status: GOOD ( 10.34 ) 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-fbdev@vger.kernel.org, linux-tegra@vger.kernel.org, Bartlomiej Zolnierkiewicz , David Airlie , amd-gfx@lists.freedesktop.org, virtualization@lists.linux-foundation.org, Eric Anholt , Thierry Reding , Gerd Hoffmann , Alex Deucher , Dave Airlie , Maxime Ripard , Jonathan Hunter , linux-arm-kernel@lists.infradead.org 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 Signed-off-by: Michał Mirosław Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_drv.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_drv.c index 7b20318483e4..c61b40c72b62 100644 --- a/drivers/gpu/drm/bochs/bochs_drv.c +++ b/drivers/gpu/drm/bochs/bochs_drv.c @@ -143,22 +143,6 @@ static const struct dev_pm_ops bochs_pm_ops = { /* ---------------------------------------------------------------------- */ /* pci interface */ -static int bochs_kick_out_firmware_fb(struct pci_dev *pdev) -{ - struct apertures_struct *ap; - - ap = alloc_apertures(1); - if (!ap) - return -ENOMEM; - - ap->ranges[0].base = pci_resource_start(pdev, 0); - ap->ranges[0].size = pci_resource_len(pdev, 0); - drm_fb_helper_remove_conflicting_framebuffers(ap, "bochsdrmfb", false); - kfree(ap); - - return 0; -} - static int bochs_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { @@ -171,7 +155,7 @@ static int bochs_pci_probe(struct pci_dev *pdev, return -ENOMEM; } - ret = bochs_kick_out_firmware_fb(pdev); + ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "bochsdrmfb"); if (ret) return ret; From patchwork Sat Sep 1 14:08:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 10584801 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E721C174A for ; Sat, 1 Sep 2018 14:16:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFBDE2A3D8 for ; Sat, 1 Sep 2018 14:16:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E36032A3E5; Sat, 1 Sep 2018 14:16:26 +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=-2.1 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 693182A3D8 for ; Sat, 1 Sep 2018 14:16:26 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:MIME-Version:Subject:From:References :In-Reply-To:Message-Id:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lTUcI/tR671YEb/0oQsnAIMea8zac9AcZSY9hvXNW68=; b=GN1cWD912tXm2e KjNRMnu/E7aOmBZ7kxeVUDSwOmQxpkD4C9dW6911+EdyvViSGpFD7H+69RUCBVXfdizKuIYQvNwy7 4jdHJg3jAv0sO7OmwF/Ye+Q+LbfbkgRB5YlamXxwgUjZnL06tx/6h4N9G5teNzhu2nUqyeBS27Lml ahZliakZuI+61dXjJj7v9R5itvKX0g1lR3HeZtiI5QnmcFEP9v/9wrE1WVZK2RyZnTkn0phWslrwW FD4jA2f2nlUOCKpULh2v+mBkdPl3XafcOc5oYY7uVI2DL2sLAo/97RM4SXWtmUiOicuhNB/9mzkUg pc50xABs+WBL4Qak24Fg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fw6hE-0006IU-TD; Sat, 01 Sep 2018 14:16:17 +0000 Received: from rere.qmqm.pl ([91.227.64.183]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fw6aL-0000gx-A5 for linux-arm-kernel@lists.infradead.org; Sat, 01 Sep 2018 14:09:15 +0000 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 422dNn2rYzzpd; Sat, 1 Sep 2018 16:08:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1535810889; bh=E/+OXL9niT/BrhS47b3a25GCXCnfcejVEExRlRSVV1E=; h=Date:In-Reply-To:References:From:Subject:To:Cc:Cc:From; b=f6mHtUdPgD6PmaYY5vXg7mVejdsHwtzmuL8Qyit0fBMFp5BgdcaxxeSR3ywTUTucz QaW9M5YxYIUeir8zydR1ouR1HJyhZ6XDbBdmflOHdQG50fVSnL68JGwpQT7+M1sOOf f7IgEHD6aQEZIashavd2SDqsuf6glPZYyTJoBGB1e3cezd+EPALD5ipv5WyLZntP6x 0YEIS3fM0IOXLHOOvadS88N7zwoOA2GLRIjfxzyUsFbhPPprfPeq7ZOkKzMv+WOsGv o7PhdgT+44jYy3YU+t6+nwK1fGr+qgP6zQjYqDSSk+EfpIyIjwXJoEp+Yxqd+gelCF 1j4hxcNjVwlaw== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail Date: Sat, 01 Sep 2018 16:08:47 +0200 Message-Id: In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v3 07/13] drm/cirrus: use simpler remove_conflicting_pci_framebuffers() MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180901_070909_783897_31F91E4B X-CRM114-Status: UNSURE ( 9.72 ) 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-fbdev@vger.kernel.org, linux-tegra@vger.kernel.org, Bartlomiej Zolnierkiewicz , David Airlie , amd-gfx@lists.freedesktop.org, virtualization@lists.linux-foundation.org, Eric Anholt , Thierry Reding , Gerd Hoffmann , Alex Deucher , Dave Airlie , Maxime Ripard , Jonathan Hunter , linux-arm-kernel@lists.infradead.org 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 Signed-off-by: Michał Mirosław Acked-by: Daniel Vetter --- drivers/gpu/drm/cirrus/cirrus_drv.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.c b/drivers/gpu/drm/cirrus/cirrus_drv.c index 69c4e352dd78..85ed8657c862 100644 --- a/drivers/gpu/drm/cirrus/cirrus_drv.c +++ b/drivers/gpu/drm/cirrus/cirrus_drv.c @@ -42,33 +42,12 @@ static const struct pci_device_id pciidlist[] = { }; -static int cirrus_kick_out_firmware_fb(struct pci_dev *pdev) -{ - struct apertures_struct *ap; - bool primary = false; - - ap = alloc_apertures(1); - if (!ap) - return -ENOMEM; - - ap->ranges[0].base = pci_resource_start(pdev, 0); - ap->ranges[0].size = pci_resource_len(pdev, 0); - -#ifdef CONFIG_X86 - primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW; -#endif - drm_fb_helper_remove_conflicting_framebuffers(ap, "cirrusdrmfb", primary); - kfree(ap); - - return 0; -} - static int cirrus_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { int ret; - ret = cirrus_kick_out_firmware_fb(pdev); + ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "cirrusdrmfb"); if (ret) return ret; From patchwork Sat Sep 1 14:08:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 10584797 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8F3DF16B1 for ; Sat, 1 Sep 2018 14:14:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 96E952A3D1 for ; Sat, 1 Sep 2018 14:14:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A9AA2A3E0; Sat, 1 Sep 2018 14:14:55 +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=-2.1 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 145392A3D1 for ; Sat, 1 Sep 2018 14:14:55 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:MIME-Version:Subject:From:References :In-Reply-To:Message-Id:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bk3Ukq3QKF2qCyHwgQpnQOtbR5qI7nlLfLa6jK6BcEA=; b=JO3e6CIzsc2LDS S1NUBzjzqJhLAvPPVLXKPUDtVFhWE5YkxgNRAs0g6/SzNyoSF1at9H/5enlEVSP5un+zmNx5Sjn1D vK8+PplqPtvW5Rb+nk4Dxobntz+1xpTyLJPjHiqTIamd7V5dxZwblsgTYwzcMAxWnswqZXupYVIFr 0Ww3jGV2VpqpAbsxvK1Yx6I6XIARvtSQhky4/8Z1o8Rd+t5x0BKKqTHkS+rrV8pJgc3dm1BTl6h9v 5TMYg2JtZEi9ERnVp+DdZKqOr/n7gTzncsUHG5+UEp9j9P92uClQIYBiHZojC6vag7C1fXwkSLIV4 opZNxnaOGq09jakroLMQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fw6fk-0004TV-U5; Sat, 01 Sep 2018 14:14:45 +0000 Received: from rere.qmqm.pl ([91.227.64.183]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fw6aL-0000gy-98 for linux-arm-kernel@lists.infradead.org; Sat, 01 Sep 2018 14:09:14 +0000 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 422dNp1JKzzr5; Sat, 1 Sep 2018 16:08:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1535810890; bh=wFbJ95eVVgVvYyOX+YbeKv5yvs/+fwgQV95g8B0g6AI=; h=Date:In-Reply-To:References:From:Subject:To:Cc:Cc:From; b=qQczLYVljVjo/q0g4LwWkSAMAEBhqeIs5BcYgyUPmGjwXfOcbgaye26CY6NtyxbfA DwAR9QGUQ0hy3YFdQVQtM3uZWKSuzX386QOLApK1uS91dCeDBzxBCJvgCTmFM9ZUXo GEkenKlzBNSx9hKmLtl98u8kEJ4iNuTtsePTI/iGmLL7UshKobsJptU0Yh2m3f+3xK z+m585mCyRxwEdoafOqGHKzRbyoxbpGteEUDMwjVrB8iAH5jhWzQXCr8jn0nJkn8Dd jKWz/NgyN3zk1eXRem641uesTCkEonfBLVCYxu5gATeoaLza/oVlFmNM+kwAn1PaaG 8O5G+Rn7OSufQ== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail Date: Sat, 01 Sep 2018 16:08:48 +0200 Message-Id: <90fc954f90de44157d6cc1c782147db6252c71e4.1535810304.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v3 08/13] drm/mgag200: use simpler remove_conflicting_pci_framebuffers() MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180901_070909_796118_0E3CC781 X-CRM114-Status: UNSURE ( 9.43 ) 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-fbdev@vger.kernel.org, linux-tegra@vger.kernel.org, Bartlomiej Zolnierkiewicz , David Airlie , amd-gfx@lists.freedesktop.org, Jonathan Hunter , Eric Anholt , Thierry Reding , Gerd Hoffmann , Alex Deucher , Dave Airlie , Maxime Ripard , virtualization@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org 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 Remove duplicated call, while at it. Signed-off-by: Michał Mirosław Acked-by: Daniel Vetter --- drivers/gpu/drm/mgag200/mgag200_drv.c | 21 +-------------------- drivers/gpu/drm/mgag200/mgag200_main.c | 9 --------- 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.c b/drivers/gpu/drm/mgag200/mgag200_drv.c index 74cdde2ee474..ac6af4bd9df6 100644 --- a/drivers/gpu/drm/mgag200/mgag200_drv.c +++ b/drivers/gpu/drm/mgag200/mgag200_drv.c @@ -42,29 +42,10 @@ static const struct pci_device_id pciidlist[] = { MODULE_DEVICE_TABLE(pci, pciidlist); -static void mgag200_kick_out_firmware_fb(struct pci_dev *pdev) -{ - struct apertures_struct *ap; - bool primary = false; - - ap = alloc_apertures(1); - if (!ap) - return; - - ap->ranges[0].base = pci_resource_start(pdev, 0); - ap->ranges[0].size = pci_resource_len(pdev, 0); - -#ifdef CONFIG_X86 - primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW; -#endif - drm_fb_helper_remove_conflicting_framebuffers(ap, "mgag200drmfb", primary); - kfree(ap); -} - static int mga_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { - mgag200_kick_out_firmware_fb(pdev); + drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "mgag200drmfb"); return drm_get_pci_dev(pdev, ent, &driver); } diff --git a/drivers/gpu/drm/mgag200/mgag200_main.c b/drivers/gpu/drm/mgag200/mgag200_main.c index 780f983b0294..79d54103d470 100644 --- a/drivers/gpu/drm/mgag200/mgag200_main.c +++ b/drivers/gpu/drm/mgag200/mgag200_main.c @@ -124,20 +124,11 @@ static int mga_probe_vram(struct mga_device *mdev, void __iomem *mem) static int mga_vram_init(struct mga_device *mdev) { void __iomem *mem; - struct apertures_struct *aper = alloc_apertures(1); - if (!aper) - return -ENOMEM; /* BAR 0 is VRAM */ mdev->mc.vram_base = pci_resource_start(mdev->dev->pdev, 0); mdev->mc.vram_window = pci_resource_len(mdev->dev->pdev, 0); - aper->ranges[0].base = mdev->mc.vram_base; - aper->ranges[0].size = mdev->mc.vram_window; - - drm_fb_helper_remove_conflicting_framebuffers(aper, "mgafb", true); - kfree(aper); - if (!devm_request_mem_region(mdev->dev->dev, mdev->mc.vram_base, mdev->mc.vram_window, "mgadrmfb_vram")) { DRM_ERROR("can't reserve VRAM\n"); From patchwork Sat Sep 1 14:08:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 10584791 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EE6AF16B1 for ; Sat, 1 Sep 2018 14:12:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0131E2A24F for ; Sat, 1 Sep 2018 14:12:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8D4C2A270; Sat, 1 Sep 2018 14:12:47 +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=-2.1 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 5D70E2A24F for ; Sat, 1 Sep 2018 14:12:47 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:MIME-Version:Subject:From:References :In-Reply-To:Message-Id:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ip2EWZfTDu854APjhxd3AATDsqfIEit4A1e5ay8Bmzk=; b=PQyTIR2nRjyIUv rubYKf+9lu4pGFPYgjnH5lVa3PnpqKMBjhzA61+UMNUcucoEq2tO0YU6VQmzrr1cQQBCPP7MYmwKt j/YfMQ80D7624nEECkKIuhtiWgJCUngPcUC9Zbxt+kbmiEZ2LddXGdk7sFtCmBxO2Ofcw4NCGdA+Q XYJxvMD6P9PV9I+chMbl+L6id1xqSc522Bu127/9ObBFuxqJq5qgfBFaKnd+f6lYQNbuZhgVgC3Q0 MrFOu5+DY4hfJUO+qk191b8YP5oT6lVL+A9cteIk9q7tpFVZUC+xVP1cMqkXasFd26x9w7TpsMJfJ 9nShZeoyBtuuaG/AYfVg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fw6dh-0003cK-PS; Sat, 01 Sep 2018 14:12:37 +0000 Received: from rere.qmqm.pl ([91.227.64.183]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fw6aL-0000h7-96 for linux-arm-kernel@lists.infradead.org; Sat, 01 Sep 2018 14:09:11 +0000 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 422dNp5GThzrF; Sat, 1 Sep 2018 16:08:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1535810890; bh=QC4nPiVVu1nX7KIKaPqDLZDEqgZQhHs8ZZ5p04+3mq0=; h=Date:In-Reply-To:References:From:Subject:To:Cc:Cc:From; b=i3kMtFxtVuu4+QgBNMMV89qE24a99m7J+n/IubiTzQisvvg3CH9nPaLsIHqAaQXqh Pw03Q+xKo8ZnVIPXSMgC1my5cGuwUKFxXoasTCWa5ptrhxNdspzNAuHwI3mPATJ5qq gOqIcWxWY+joyNdtin0lQ8IkjhwQ43YwpeZBs7XHVCvUzIc3PS58zd17yLZoDWr6n4 v/ZSD0u5FZUBo6dF/zEPgItOscZ99ogCQ69AglaadzrYG1e5zikxI2t2pbCbvxJvz1 P9iOpKcUsFgevsf1xU6WR/iOVQVAb5fcX//GVS2aRhvt+TCPNYfFTt4vaLpA6aepUk igo6ptmTEeS1A== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail Date: Sat, 01 Sep 2018 16:08:48 +0200 Message-Id: In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v3 09/13] drm/radeon: use simpler remove_conflicting_pci_framebuffers() MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180901_070909_589994_16D72B5B X-CRM114-Status: UNSURE ( 9.81 ) 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-fbdev@vger.kernel.org, linux-tegra@vger.kernel.org, Bartlomiej Zolnierkiewicz , David Airlie , amd-gfx@lists.freedesktop.org, Jonathan Hunter , Eric Anholt , Thierry Reding , Gerd Hoffmann , Alex Deucher , Dave Airlie , Maxime Ripard , virtualization@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org 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 Signed-off-by: Michał Mirosław Acked-by: Alex Deucher Acked-by: Daniel Vetter --- drivers/gpu/drm/radeon/radeon_drv.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index b28288a781ef..36c98a0ec991 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -311,27 +311,6 @@ static struct drm_driver kms_driver; bool radeon_device_is_virtual(void); -static int radeon_kick_out_firmware_fb(struct pci_dev *pdev) -{ - struct apertures_struct *ap; - bool primary = false; - - ap = alloc_apertures(1); - if (!ap) - return -ENOMEM; - - ap->ranges[0].base = pci_resource_start(pdev, 0); - ap->ranges[0].size = pci_resource_len(pdev, 0); - -#ifdef CONFIG_X86 - primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW; -#endif - drm_fb_helper_remove_conflicting_framebuffers(ap, "radeondrmfb", primary); - kfree(ap); - - return 0; -} - static int radeon_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { @@ -341,7 +320,7 @@ static int radeon_pci_probe(struct pci_dev *pdev, return -EPROBE_DEFER; /* Get rid of things like offb */ - ret = radeon_kick_out_firmware_fb(pdev); + ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "radeondrmfb"); if (ret) return ret; From patchwork Sat Sep 1 14:08:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 10584793 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7D48013AC for ; Sat, 1 Sep 2018 14:13:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 848E72A3BD for ; Sat, 1 Sep 2018 14:13:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 771CE2A3D1; Sat, 1 Sep 2018 14:13:28 +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=-2.1 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 0087B2A3BD for ; Sat, 1 Sep 2018 14:13:27 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:MIME-Version:Subject:From:References :In-Reply-To:Message-Id:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FIaczziHRr/LYoOzDjwWHQssxp1pszcDOsHkiMjoUFs=; b=Gm5ltrHyoQ83rr 9JPGls75ti8PLiAQb6GoxjUnF5SI1ezIR9r2ZNVAZP8SKs4D9duEsnZ42QxmI9u2DrtrZcmR73iTz ElL5gbm6VyR50BQrHwBvdon8pN6A7GMAW/IrOjCneuuA0XETQNdwjm0Tnf22id3KjYVnWYs7mH6XU OIYdXxUX/5RIseD97CIHyTm4/7raCaajiUPw/0Vz3JruWGNFJPSD+MjQQZroFaPUNaUCcsGC7Fvwf X6R3rr2TgdxiSpxRytWQcc4NBFSc9/aZQimmXqlGsNLjdwFqnTR1qCQSqtYYnVPCjXlpBDWAYDBCL 54QCM1yz8IggOvkhloIA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fw6eN-0003uU-SD; Sat, 01 Sep 2018 14:13:19 +0000 Received: from rere.qmqm.pl ([91.227.64.183]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fw6aL-0000h6-95 for linux-arm-kernel@lists.infradead.org; Sat, 01 Sep 2018 14:09:11 +0000 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 422dNq2fVvzrb; Sat, 1 Sep 2018 16:08:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1535810891; bh=gmzq5OR1+6P/pJOhCSwW9f0H/rCztuuw8Vr9j0ETzP4=; h=Date:In-Reply-To:References:From:Subject:To:Cc:Cc:From; b=ByksFRBMkDZTeBwRu3qdAzzuZt8JQRaGQ3bKTFH8q7y8IfdD2zU5p1/lUBOUmtpuB ppQGxYBJhgpTttquxWGyu6IUHJLFY5iaI7km5CUHAIiZ+Q3Nb+lXs4TEMtpCfv+iuO QGYnWToq1S80W/UWcn08FdN7VQX0qOxXOSmjGMOOwztx7VagwjvxCLb3fUvCAdIDsj FHQkqGC15DfbP4f3b+wn1c6Io4GP81T7XJQiRxY1PVnOwtsDGHWxkXNn5UrcOD7U11 u5b2uQwGZhldM4m3HkXsOH10rGSupNn3fPp994omu7eFheLr7R2yVESCimIrD9loSg iuzoiyHwzTj5Q== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail Date: Sat, 01 Sep 2018 16:08:49 +0200 Message-Id: <25f89daf6217da98a52d41c4ad62a78272bb0cf6.1535810304.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v3 10/13] drm/virtio: use simpler remove_conflicting_pci_framebuffers() MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180901_070909_601967_2FA757D9 X-CRM114-Status: UNSURE ( 9.22 ) 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-fbdev@vger.kernel.org, linux-tegra@vger.kernel.org, Bartlomiej Zolnierkiewicz , David Airlie , amd-gfx@lists.freedesktop.org, virtualization@lists.linux-foundation.org, Eric Anholt , Thierry Reding , Gerd Hoffmann , Alex Deucher , Dave Airlie , Maxime Ripard , Jonathan Hunter , linux-arm-kernel@lists.infradead.org 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 Signed-off-by: Michał Mirosław Acked-by: Daniel Vetter --- drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c index 7df8d0c9026a..115ed546ca4e 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c +++ b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c @@ -28,26 +28,6 @@ #include "virtgpu_drv.h" -static void virtio_pci_kick_out_firmware_fb(struct pci_dev *pci_dev) -{ - struct apertures_struct *ap; - bool primary; - - ap = alloc_apertures(1); - if (!ap) - return; - - ap->ranges[0].base = pci_resource_start(pci_dev, 0); - ap->ranges[0].size = pci_resource_len(pci_dev, 0); - - primary = pci_dev->resource[PCI_ROM_RESOURCE].flags - & IORESOURCE_ROM_SHADOW; - - drm_fb_helper_remove_conflicting_framebuffers(ap, "virtiodrmfb", primary); - - kfree(ap); -} - int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev) { struct drm_device *dev; @@ -69,7 +49,9 @@ int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev) pname); dev->pdev = pdev; if (vga) - virtio_pci_kick_out_firmware_fb(pdev); + drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, + 0, + "virtiodrmfb"); snprintf(unique, sizeof(unique), "pci:%s", pname); ret = drm_dev_set_unique(dev, unique); From patchwork Sat Sep 1 14:08:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 10584799 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 63E3D16B1 for ; Sat, 1 Sep 2018 14:15:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C3982A3D8 for ; Sat, 1 Sep 2018 14:15:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F7DA2A3E5; Sat, 1 Sep 2018 14:15:47 +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=-2.1 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 C4D7D2A3E0 for ; Sat, 1 Sep 2018 14:15:46 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:MIME-Version:Subject:From:References :In-Reply-To:Message-Id:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OuRN4Q6bhfGaDN1i5GYkLfiiRynsRlKO1PWN7WTdzYo=; b=tUYxGG5yJVexFJ uBjHB8DECb2kP3GlEewKtzmjlFCT3HabeIA4rAFIaEYFGKzK+vxNB/5cxjGzkFBf3Ugjbc7StJJX7 DJP23H+yP59AIc58C1Mqwm/AMhcyKh7vuiyn1OXx6hJgG8ni+w7mTD3etJz58Aw+Ps9SWb38KAp50 9z8nb8zo4P3qtLrW/h+PjJ1aSUXf7DWZAHThoXD7XfTFZ8wFgElqqVwh6XWiFp7fmF2TEjLHRChhd eFkrgpHUApMJv04YqRjzPdcWPF3N31G5IDoCzqS5dP3vBoqX/en7fr6NxgMgCrl5SmMlYXMm5HcQn PiGQ1uhGLYP9VARAWvGg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fw6gZ-0005wl-Ra; Sat, 01 Sep 2018 14:15:35 +0000 Received: from rere.qmqm.pl ([91.227.64.183]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fw6aL-0000hC-A2 for linux-arm-kernel@lists.infradead.org; Sat, 01 Sep 2018 14:09:13 +0000 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 422dNr2hCQzry; Sat, 1 Sep 2018 16:08:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1535810892; bh=eePa/t7j5CstRGk6pBFuC4znb/qaSIMvWgJG9klZ6aY=; h=Date:In-Reply-To:References:From:Subject:To:Cc:Cc:From; b=psDalyqtVTT3AsxTz+qtKl7btXj7ur1ZziQVPzjtjnWQA3aJKPc+ROT8yqKGLif6o 17vNW+6rmk9oeIBkN+fk+hnKqSNcYina8yMBZvZb7amNJWa3Z+nuZmXmim9n96a9VC 73YIlQ7Ua+EU9nwbjbuycFdWlGDUFuGfl52U8p3Qb5Wxpt636vtmnhLmEr8DlwTB7b uWLRobi/xH6rSqmTfKPrNMn37ibQupJLTRz9KIUx+bNrafazn+kUwa5SAPYlU5a2c8 MZuKvxhC4hIHKAjrIrVHD4JMgWKqNfMgKiTKxY8ktyYNJfwxaRd4cVkMawHZud9zrK r66ZXjmAtTTCQ== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail Date: Sat, 01 Sep 2018 16:08:50 +0200 Message-Id: In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v3 11/13] drm/vc4: use simpler remove_conflicting_framebuffers(NULL) MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180901_070909_761747_FB371F0C X-CRM114-Status: GOOD ( 11.54 ) 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-fbdev@vger.kernel.org, linux-tegra@vger.kernel.org, Bartlomiej Zolnierkiewicz , David Airlie , amd-gfx@lists.freedesktop.org, Jonathan Hunter , Eric Anholt , Thierry Reding , Gerd Hoffmann , Alex Deucher , Dave Airlie , Maxime Ripard , virtualization@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org 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 Use remove_conflicting_framebuffers(NULL) instead of open-coding it. Signed-off-by: Michał Mirosław Acked-by: Eric Anholt Acked-by: Daniel Vetter --- drivers/gpu/drm/vc4/vc4_drv.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index 94b99c90425a..96bb90325995 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -246,24 +246,6 @@ static void vc4_match_add_drivers(struct device *dev, } } -static void vc4_kick_out_firmware_fb(void) -{ - struct apertures_struct *ap; - - ap = alloc_apertures(1); - if (!ap) - return; - - /* Since VC4 is a UMA device, the simplefb node may have been - * located anywhere in memory. - */ - ap->ranges[0].base = 0; - ap->ranges[0].size = ~0; - - drm_fb_helper_remove_conflicting_framebuffers(ap, "vc4drmfb", false); - kfree(ap); -} - static int vc4_drm_bind(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); @@ -296,7 +278,7 @@ static int vc4_drm_bind(struct device *dev) if (ret) goto gem_destroy; - vc4_kick_out_firmware_fb(); + drm_fb_helper_remove_conflicting_framebuffers(NULL, "vc4drmfb", false); ret = drm_dev_register(drm, 0); if (ret < 0) From patchwork Sat Sep 1 14:08:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 10584807 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6386714E1 for ; Sat, 1 Sep 2018 14:18:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 69A7B2A6B4 for ; Sat, 1 Sep 2018 14:18:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A78C2A6C6; Sat, 1 Sep 2018 14:18:39 +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=-2.1 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 BFAC02A6B4 for ; Sat, 1 Sep 2018 14:18:38 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:MIME-Version:Subject:From:References :In-Reply-To:Message-Id:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CrmpvF0wOWompCIiCi8FPlSZljnOIwb9uJ3nU942Rmw=; b=b57jeRlrIObHk9 xoRGFP1q8oTFylD4crXRqYe7Z7TkwgyaGzWdiN1LiiAEvxNE9OFsR60e6O1fHqpeR08kH0XKbkLNf 0A7RCDNf2A3DSpQdcydWoSC4svxj+LDWXj4dVyM5Wws7fG/jLBUC7P4CQPciK0o/iWEuhi3RKtXnH +fMf1pi5YE1+EHHuvSnxgkJRVX30DnYKCuEbPt/HRrt/MuT8yInvedUaY7hG21CA34bvL4ug+fCUr MfWrS+dti1vlZJEDeMlzKjQFf2k+RzzviyEKzc4SLAEhmDhPm9Uo9LWWh6FtTdtd2pc38Dna06WWM byufKmcCE5EqKgzRd01w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fw6jJ-0007at-CJ; Sat, 01 Sep 2018 14:18:25 +0000 Received: from rere.qmqm.pl ([91.227.64.183]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fw6aL-0000hD-99 for linux-arm-kernel@lists.infradead.org; Sat, 01 Sep 2018 14:09:16 +0000 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 422dNs1B7Wzs8; Sat, 1 Sep 2018 16:08:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1535810893; bh=WGaZ3CjyVt7Sh/UtYrEXH/3jMbfSxhu26rb+dqQOntQ=; h=Date:In-Reply-To:References:From:Subject:To:Cc:Cc:From; b=PBRYsQx/jXwDzqOfTsym+dmaEPSfzTl6lS2an5REbIWIhZUxq4YPOIelYjR42TO/n poD5njayfRMCSCw+7fjsnN8MlIZFXLgSlSkOt0Ldnen/hFhiMut7ICM4m6MTe3Of1M Qh35MxpYUwBk1r/IDEgSDXA3rj1ttIlCiLkraXj8mdM8Y45KCnj6ir5PSCJbX+g5eE z+VDHSFcIJe5DTHTF4ghUYVE5j/o1D9PaC5OPQaX5oIk+H7RK38chLfLnlnZNSs3z4 RkKQkLBqNH8mSFMrcx8XJjd7NWznEYGtkqe/BVlKMJajYRKeGtqJoFnbVXuX+GaLZ2 jpTuKKGbFtSfA== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail Date: Sat, 01 Sep 2018 16:08:51 +0200 Message-Id: <7d6d5bc4deac322b1351533c989cb3583e91be49.1535810304.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v3 12/13] drm/sun4i: use simpler remove_conflicting_framebuffers(NULL) MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180901_070909_799880_4C070C8C X-CRM114-Status: GOOD ( 13.16 ) 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-fbdev@vger.kernel.org, linux-tegra@vger.kernel.org, Bartlomiej Zolnierkiewicz , Maxime Ripard , Eric Anholt , amd-gfx@lists.freedesktop.org, Jonathan Hunter , David Airlie , Thierry Reding , Gerd Hoffmann , Alex Deucher , Dave Airlie , virtualization@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org 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 Use remove_conflicting_framebuffers(NULL) instead of duplicating it. Signed-off-by: Michał Mirosław Acked-by: Maxime Ripard Acked-by: Daniel Vetter --- drivers/gpu/drm/sun4i/sun4i_drv.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index 50d19605c38f..555b5db8036f 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -60,22 +60,6 @@ static struct drm_driver sun4i_drv_driver = { /* Frame Buffer Operations */ }; -static void sun4i_remove_framebuffers(void) -{ - struct apertures_struct *ap; - - ap = alloc_apertures(1); - if (!ap) - return; - - /* The framebuffer can be located anywhere in RAM */ - ap->ranges[0].base = 0; - ap->ranges[0].size = ~0; - - drm_fb_helper_remove_conflicting_framebuffers(ap, "sun4i-drm-fb", false); - kfree(ap); -} - static int sun4i_drv_bind(struct device *dev) { struct drm_device *drm; @@ -118,7 +102,7 @@ static int sun4i_drv_bind(struct device *dev) drm->irq_enabled = true; /* Remove early framebuffers (ie. simplefb) */ - sun4i_remove_framebuffers(); + drm_fb_helper_remove_conflicting_framebuffers(NULL, "sun4i-drm-fb", false); /* Create our framebuffer */ ret = sun4i_framebuffer_init(drm); From patchwork Sat Sep 1 14:08:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 10584803 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5B9CC5A4 for ; Sat, 1 Sep 2018 14:17:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 641012A3E5 for ; Sat, 1 Sep 2018 14:17:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 56ADB2A3FC; Sat, 1 Sep 2018 14:17:11 +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=-2.1 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 D40432A3E5 for ; Sat, 1 Sep 2018 14:17:10 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:MIME-Version:Subject:From:References :In-Reply-To:Message-Id:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ji8KsSO0ELzMI9cOe0gpc9re4BmluaAvt93uIaWecd0=; b=MycvC64NgBCg3V wF8lmiaGKysBgMdBkfl2OFpLS6wkDkpL/Mlf2BM8K9+jzIkRLlis0EioziHTurTkVzN8xWavTMAJx evkW3a/HvqsyPTdVKozzlHAm1t2exu0at0IkyH2w5XUd79iPW3aj91GULPlR9fCyd1sbseeQK3mni U3nQJ18a4mhXm3vtRg1RDDbs0bRBI042oqrRslpkpUI9zNSvOhC7+dXLAqNE4tp2kt7j7VRfTRiye 0KbaZ0HvnSJXGVE/GK7C6P6D6cVqNvf3R/olNuFYuTWMzLHZ78uf9/AxN9lYmz3NXsxBi5h/SGtkY dQG+l4xRu4sa4BiBKyHQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fw6hu-0006aP-No; Sat, 01 Sep 2018 14:16:58 +0000 Received: from rere.qmqm.pl ([91.227.64.183]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fw6aL-0000hK-A3 for linux-arm-kernel@lists.infradead.org; Sat, 01 Sep 2018 14:09:14 +0000 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 422dNt0Zc2zsB; Sat, 1 Sep 2018 16:08:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1535810894; bh=MxtO5Mhr0GkPH8MUP06AqtRLFfui2zInQhDye32pDvw=; h=Date:In-Reply-To:References:From:Subject:To:Cc:Cc:From; b=Yhp3Tp6EQXbfc0dSesPwSojrVm80yMMtxs0yG9v81ZFXoECCQhjbYEutwfk37OEE9 Zet9Ziqg0TJeO5X2+ajB80EWwLXhxD1nu2NYsN6z/OILiw2qhTC6AGOEuav28rVXU8 q0oNRyS/p9MbVgi9idGghRffSk82id74eV60wuXkFeAZBeSflB0+8kBJjKaSMPgEoK rEIAU9d6BEJaSHVd5XxemeqtTWfbMJwsxT/0ER4fFeByqOByBi8zIP/8IoU6d6xenE /DVF+znYsb5WTNwak+vA8CkyVdrPFl/OiTw9T38mp/b2NQ/YnrUXCe5bG5OGDiV7f+ oJb79Vy2E0crA== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail Date: Sat, 01 Sep 2018 16:08:51 +0200 Message-Id: In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v3 13/13] drm/tegra: kick out simplefb MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180901_070909_785546_D1041378 X-CRM114-Status: UNSURE ( 8.24 ) 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-fbdev@vger.kernel.org, Bartlomiej Zolnierkiewicz , David Airlie , Eric Anholt , amd-gfx@lists.freedesktop.org, Jonathan Hunter , Alex Deucher , Thierry Reding , Gerd Hoffmann , linux-tegra@vger.kernel.org, Dave Airlie , Maxime Ripard , virtualization@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org 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 Kick out firmware fb when loading Tegra driver. Signed-off-by: Michał Mirosław Acked-by: Daniel Vetter --- drivers/gpu/drm/tegra/drm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index 7afe2f635f74..b51ec138fed2 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -1203,6 +1203,10 @@ static int host1x_drm_probe(struct host1x_device *dev) dev_set_drvdata(&dev->dev, drm); + err = drm_fb_helper_remove_conflicting_framebuffers(NULL, "tegradrmfb", false); + if (err < 0) + goto unref; + err = drm_dev_register(drm, 0); if (err < 0) goto unref;