From patchwork Thu Aug 30 21:00:05 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: 10582825 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 40CD0175A for ; Thu, 30 Aug 2018 21:06:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 318FC2C31C for ; Thu, 30 Aug 2018 21:06:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 22A192C290; Thu, 30 Aug 2018 21:06:05 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BEB142C290 for ; Thu, 30 Aug 2018 21:06:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727512AbeHaBKH (ORCPT ); Thu, 30 Aug 2018 21:10:07 -0400 Received: from 183.pool-64.klikom.net ([91.227.64.183]:17189 "EHLO rere.qmqm.pl" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1727505AbeHaBKH (ORCPT ); Thu, 30 Aug 2018 21:10:07 -0400 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 421ZcH5ZdMzKt; Thu, 30 Aug 2018 22:59:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1535662767; bh=hRk3jex+VsnaxjKatFyqrxazpRc2Tv1gzSGnx/JsTug=; h=Date:In-Reply-To:References:From:Subject:To:Cc:Cc:Cc:Cc:Cc:Cc:Cc: Cc:Cc:Cc:Cc:From; b=RLTHe2baff/MJOecvw6RGqneKNry/b/20gJKEFNhJnaYuu20ySqhcQ9LJtoJL2try KohpFikHWtHzUMcHpVxIPcSht88Dzl3EABf2qaYtc/a6a1tIF4E43fpbncuNzdxKl1 efaH/z2szpW682Kv2etWIMT/Pg6iw/Ui/zspRyqXkmpYGvbOaOe899prvBxM9NQWs8 in7jpzxR0vJImCxYxoxrrYvdIXrlZUb10pRLWj09SIgXNLH/Je5ksVijDwXKSRmYxt 7C61znvOxWl+mIs/b+gMIVckiMvEU7/Ob8qIxKPJ8GYuZ6wSJSKHJvTu53jQFfbFf7 WOTBFO0W4uiKQ== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail Date: Thu, 30 Aug 2018 23:00:05 +0200 Message-Id: In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v2 01/12] fbdev: show fbdev number for debugging MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org Cc: Bartlomiej Zolnierkiewicz , linux-fbdev@vger.kernel.org Cc: Alex Deucher Cc: Cc: David Airlie Cc: Eric Anholt Cc: Gerd Hoffmann Cc: Cc: Cc: Maxime Ripard Cc: Thierry Reding Cc: Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.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 Thu Aug 30 21:00:05 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: 10582831 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 5D1BC174C for ; Thu, 30 Aug 2018 21:06:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C6C42C290 for ; Thu, 30 Aug 2018 21:06:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 412E82C32F; Thu, 30 Aug 2018 21:06:06 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4BBB2C31D for ; Thu, 30 Aug 2018 21:06:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727565AbeHaBKH (ORCPT ); Thu, 30 Aug 2018 21:10:07 -0400 Received: from rere.qmqm.pl ([91.227.64.183]:33173 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727529AbeHaBKH (ORCPT ); Thu, 30 Aug 2018 21:10:07 -0400 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 421ZcJ25lTzLG; Thu, 30 Aug 2018 22:59:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1535662768; bh=23C/qzqkj8RjChvPXX8rs991ajnnysY2BBYNx0j+xsM=; h=Date:In-Reply-To:References:From:Subject:To:Cc:Cc:Cc:Cc:Cc:Cc:Cc: Cc:Cc:Cc:Cc:From; b=goMD5kfurOvo14jT2lxTRTSploLIJiT6vsifeig1YtT1dZ6T/WqzEiUTrCZ13bHNn hRtGDHJP2giMDkGurHmGNiNppvc02evXCHXSDvo0NjrK2jkxwVsr8QZEsbb5bk+sLc 7eLwk1wFEpgH4nA4KHSb8DFs4cic6P6+oB87tRZtTVH97IPz0YY9AfJTCbPD6/U0vD 1KP66ChmgcykcVkh239ZlnCjjp5z1kX7CZcVqBlVDisXBtvfh8MDplmazGcFWhxx/p 2A2lHtQFGRfPycCPuM1OlDY6qIPXrzVbvCR/5yGD3b+ollO3HgVoKvom1mD1KzD+q9 d8vs27od/YAQQ== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail Date: Thu, 30 Aug 2018 23:00:05 +0200 Message-Id: <7e3a48e397298b38d7ddc7f45d48226d1f5db3e4.1535656077.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v2 02/12] fbdev: allow apertures == NULL in remove_conflicting_framebuffers() MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org Cc: Bartlomiej Zolnierkiewicz , linux-fbdev@vger.kernel.org Cc: Alex Deucher Cc: Cc: David Airlie Cc: Eric Anholt Cc: Gerd Hoffmann Cc: Cc: Cc: Maxime Ripard Cc: Thierry Reding Cc: Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.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 [for v1] Acked-by: Bartlomiej Zolnierkiewicz --- v2: added kerneldoc to corresponding DRM helper --- drivers/video/fbdev/core/fbmem.c | 14 ++++++++++++++ include/drm/drm_fb_helper.h | 10 ++++++++++ 2 files changed, 24 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); diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h index b069433e7fc1..1c1e53abb25d 100644 --- a/include/drm/drm_fb_helper.h +++ b/include/drm/drm_fb_helper.h @@ -566,6 +566,16 @@ static inline void drm_fb_helper_output_poll_changed(struct drm_device *dev) #endif +/** + * drm_fb_helper_remove_conflicting_framebuffers - remove firmware 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 (eg. initialized by firmware) + * which use memory range described by @a. If @a is NULL all such devices are + * removed. + */ static inline int drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a, const char *name, bool primary) From patchwork Thu Aug 30 21:00:06 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: 10582837 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 0B0B5174C for ; Thu, 30 Aug 2018 21:06:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF83A2C290 for ; Thu, 30 Aug 2018 21:06:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E3DA02C31D; Thu, 30 Aug 2018 21:06:06 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A7A62C290 for ; Thu, 30 Aug 2018 21:06:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727572AbeHaBKI (ORCPT ); Thu, 30 Aug 2018 21:10:08 -0400 Received: from 183.pool-64.klikom.net ([91.227.64.183]:29822 "EHLO rere.qmqm.pl" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1727539AbeHaBKH (ORCPT ); Thu, 30 Aug 2018 21:10:07 -0400 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 421ZcJ5k6PzPw; Thu, 30 Aug 2018 22:59:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1535662768; bh=ESBT08hsjhHT/pxVjWanODu2HOO/rl+fiXFpoHNJd1Q=; h=Date:In-Reply-To:References:From:Subject:To:Cc:Cc:Cc:Cc:Cc:Cc:Cc: Cc:Cc:Cc:Cc:From; b=ZgWEm4s7KE6w0BvBgdKIm3fKf87nRu3P0eJrI+nfW9lImAXcS3rXSCXRzMy8jOPE7 31u85re5ImVHnaD4FcHeXKTCPl45wZJyO9kxZyeapXIOsvpkEtWZ0DHg3sckEd7z8O gW/U3d9plbgL0DAmSHpadj57RmCyip6wOFuy0ZPuWaSxOIOomjI2qj5PZhsVfbuXPh CaY/37oCPYX7hSHYI/gQmZdTSspWJiNZYQSF2b+Fk3CX+WQUx9+4jkT405Ihk6v6x0 IL+KTSdg5GWGam1ocDOKHxv0dbsbh305Xs9f06Gz3HuYbN+vhobyutu/i+U++zU3Pa 2F1n3/BMsNvlQ== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail Date: Thu, 30 Aug 2018 23:00:06 +0200 Message-Id: In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v2 03/12] fbdev: add remove_conflicting_pci_framebuffers() MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org Cc: Bartlomiej Zolnierkiewicz , linux-fbdev@vger.kernel.org Cc: Alex Deucher Cc: Cc: David Airlie Cc: Eric Anholt Cc: Gerd Hoffmann Cc: Cc: Cc: Maxime Ripard Cc: Thierry Reding Cc: Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Almost all PCI drivers using remove_conflicting_framebuffers() wrap it with the same code. Signed-off-by: Michał Mirosław [for v1] Acked-by: Bartlomiej Zolnierkiewicz --- v2: add kerneldoc for DRM helper --- drivers/video/fbdev/core/fbmem.c | 22 ++++++++++++++++++++++ include/drm/drm_fb_helper.h | 24 ++++++++++++++++++++++++ include/linux/fb.h | 2 ++ 3 files changed, 48 insertions(+) diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 0df148eb4699..927e016487e9 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -34,6 +34,7 @@ #include #include #include +#include #include @@ -1802,6 +1803,27 @@ int remove_conflicting_framebuffers(struct apertures_struct *a, } EXPORT_SYMBOL(remove_conflicting_framebuffers); +int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, const char *name) +{ + struct apertures_struct *ap; + bool primary = false; + + 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 + remove_conflicting_framebuffers(ap, name, primary); + kfree(ap); + return 0; +} +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 1c1e53abb25d..6e1fc52d1b1b 100644 --- a/include/drm/drm_fb_helper.h +++ b/include/drm/drm_fb_helper.h @@ -587,4 +587,28 @@ drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a, #endif } +/** + * drm_fb_helper_remove_conflicting_framebuffers - remove firmware framebuffers for PCI devices + * @pdev: PCI device being driven + * @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 is drives a primary + * display and so kicks out vga16fb. + */ +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 Thu Aug 30 21:00:06 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: 10582835 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 DB5DF175A for ; Thu, 30 Aug 2018 21:06:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC7D02C31C for ; Thu, 30 Aug 2018 21:06:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C15FA2C31D; Thu, 30 Aug 2018 21:06:06 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 393EC2C321 for ; Thu, 30 Aug 2018 21:06:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727560AbeHaBKH (ORCPT ); Thu, 30 Aug 2018 21:10:07 -0400 Received: from rere.qmqm.pl ([91.227.64.183]:27753 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727504AbeHaBKH (ORCPT ); Thu, 30 Aug 2018 21:10:07 -0400 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 421ZcK1zz2zQb; Thu, 30 Aug 2018 22:59:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1535662769; bh=jJnq4zIPxTkKkKHsjr6LnVL6qL/QGLJvzMtvktLt+y0=; h=Date:In-Reply-To:References:From:Subject:To:Cc:Cc:Cc:Cc:Cc:Cc:Cc: Cc:Cc:Cc:Cc:From; b=leDLXrheb+Pz89XqugcRZGt7uvkMQT+MCKwIkwZIuguaweBPuk18MYnKrIXSCDGJh cLg73VYVh9gnJ5JBL6AHphmeGEyIMwVLyFmxEuFlJn1C3btUpMSYivpzyu3dPZ83Fp Um0rxf3dssrqTXUy38XYSd/jawRvqK64kwLCIYBvJxdeIvrdLK9eT8xADAqxsObzTE +l5AtMFAOWiLqu+50cJmYgKHaJb8MflyB9GhKJFJnhg3Xy23ogg8H4TC6F4jDKu9FS N54iznRHyj41bkewYV0sYZVhsb0/MpjSXOVezkCJScO0y1dy3bknRNDA6XJbuROJBJ lAimRZGmqThBw== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail Date: Thu, 30 Aug 2018 23:00:06 +0200 Message-Id: In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v2 04/12] drm/amdgpu: use simpler remove_conflicting_pci_framebuffers() MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org Cc: Alex Deucher , amd-gfx@lists.freedesktop.org Cc: Bartlomiej Zolnierkiewicz Cc: David Airlie Cc: Eric Anholt Cc: Gerd Hoffmann Cc: Cc: Cc: Cc: Maxime Ripard Cc: Thierry Reding Cc: Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.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 Thu Aug 30 21:00:07 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: 10582829 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 179D6175A for ; Thu, 30 Aug 2018 21:06:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 09F412C32D for ; Thu, 30 Aug 2018 21:06:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F28BC2C290; Thu, 30 Aug 2018 21:06:05 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93EC42C290 for ; Thu, 30 Aug 2018 21:06:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727568AbeHaBKI (ORCPT ); Thu, 30 Aug 2018 21:10:08 -0400 Received: from 183.pool-64.klikom.net ([91.227.64.183]:23905 "EHLO rere.qmqm.pl" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1727536AbeHaBKH (ORCPT ); Thu, 30 Aug 2018 21:10:07 -0400 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 421ZcK46JQzbZ; Thu, 30 Aug 2018 22:59:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1535662769; bh=V6edOcizDa5A67hnilRwp0bSN35/WP1foanZNTCSgqQ=; h=Date:In-Reply-To:References:From:Subject:To:Cc:Cc:Cc:Cc:Cc:Cc:Cc: Cc:Cc:Cc:Cc:From; b=lVv33zDqJv/NBqCjzQApi5b35Y1nqQoHPPrtqcc5V/+ESPNsjRPe64Ngsuy1m0ZmZ R4yEQTz+KG0vv6gQhU5Vj8yxrSPZCmHt0AQIL6g+hUHeBOivHfGazIjQFF6fuGLbvK T7rST/2PRnbMgVW+4UHZ/kD4sxRbppMdsfO2ELvzeMcNwgmXVs3dKfZ1gRwgz7qBwW QEZ4hmNvzpgRMhNkYJahg13L2//YRh7z6jGQ7+d989+k+twPv+t5W8G41RWJchoTyy QSrwslxxp9A5SyAWZW4Z7vfdZvMfvIK+CpimjDOp4d8kX/cqSNFzWUDOMhsxdOoCB0 rN37BAqGedBDw== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail Date: Thu, 30 Aug 2018 23:00:07 +0200 Message-Id: In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v2 05/12] drm/bochs: use simpler remove_conflicting_pci_framebuffers() MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org Cc: Gerd Hoffmann , virtualization@lists.linux-foundation.org Cc: Alex Deucher Cc: Cc: Bartlomiej Zolnierkiewicz Cc: David Airlie Cc: Eric Anholt Cc: Cc: Cc: Cc: Maxime Ripard Cc: Thierry Reding Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.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 Thu Aug 30 21:00:07 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: 10582823 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 7DEB61805 for ; Thu, 30 Aug 2018 21:06:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E9DA2C290 for ; Thu, 30 Aug 2018 21:06:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 626132C31C; Thu, 30 Aug 2018 21:06:04 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1538E2C318 for ; Thu, 30 Aug 2018 21:06:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727544AbeHaBKG (ORCPT ); Thu, 30 Aug 2018 21:10:06 -0400 Received: from rere.qmqm.pl ([91.227.64.183]:37941 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727512AbeHaBKF (ORCPT ); Thu, 30 Aug 2018 21:10:05 -0400 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 421ZcL0ygXzqG; Thu, 30 Aug 2018 22:59:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1535662770; bh=E/+OXL9niT/BrhS47b3a25GCXCnfcejVEExRlRSVV1E=; h=Date:In-Reply-To:References:From:Subject:To:Cc:Cc:Cc:Cc:Cc:Cc:Cc: Cc:Cc:Cc:Cc:Cc:From; b=m7rkBfeGt7mDDff7iR1kGAlWjXUc9crNA+Sp1VNyc5sdgeyZiTy3I0EJm0S/MG02E FOrhcJuyWUszfcrDeOLTeIS4LmAc0rLsqNu+3l9eaXVbQCjsCHWPgW4Ul3PGHFXHHA 4U60KRuR8Hwg3AvOhswk/b3sxQBrDAg+wPsR8aJmU61m25/F1cCYm3KnM6dX2gDYCP 4JzMlez/0woZpMVev2lU4izT2ybQ/te+QE12/GH6dxVeErqL+zvKj4ySfdKcHM+igM HvXDq0blu6VSbzGNt+DM4v44P5trAm2XsIXl/kUdplkrC/oIem1qW9fMKVxpCiuEqI fmZHFM4zwt+eA== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail Date: Thu, 30 Aug 2018 23:00:07 +0200 Message-Id: <8a330a00dad89889550ff9fb7d7309d58d64181c.1535656077.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v2 06/12] drm/cirrus: use simpler remove_conflicting_pci_framebuffers() MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org Cc: virtualization@lists.linux-foundation.org Cc: Alex Deucher Cc: Cc: Bartlomiej Zolnierkiewicz Cc: David Airlie Cc: Eric Anholt Cc: Gerd Hoffmann Cc: Cc: Cc: Cc: Maxime Ripard Cc: Thierry Reding Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.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 Thu Aug 30 21:00:08 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: 10582833 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 8A456180E for ; Thu, 30 Aug 2018 21:06:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B4672C32F for ; Thu, 30 Aug 2018 21:06:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6FE802C31D; Thu, 30 Aug 2018 21:06:06 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BBFE2C347 for ; Thu, 30 Aug 2018 21:06:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727569AbeHaBKI (ORCPT ); Thu, 30 Aug 2018 21:10:08 -0400 Received: from rere.qmqm.pl ([91.227.64.183]:9013 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727543AbeHaBKH (ORCPT ); Thu, 30 Aug 2018 21:10:07 -0400 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 421ZcL4BdnzrD; Thu, 30 Aug 2018 22:59:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1535662770; bh=wFbJ95eVVgVvYyOX+YbeKv5yvs/+fwgQV95g8B0g6AI=; h=Date:In-Reply-To:References:From:Subject:To:Cc:Cc:Cc:Cc:Cc:Cc:Cc: Cc:Cc:Cc:Cc:Cc:From; b=qmMBXWC9u9Fp0gSN1bk9XfZna1yiSvasIAupwN4bJYeiu3XqlCb6i54Mh96qMgTad suSbd7FWUOPVw6Fhp4EEF8S1DYD2/CP+sFrmv46lURjwH25XOGBX4d0Wplk2i4VegE WP0/VmG3M8heZzh/fqw6E7BnSdEWAr/l6m2h+trY9LYBILpT+NopgqtIdsHdJJxsMb L0KJOR0oz/voTer7F+wayyJ6PnwiumBHU9dVcMawdZ5fm2VcIO5GK7KywUoafIX+n0 l0fLUdu80enjPtS/gqXH/txTL30cE/+vil9tj8/Q5wDJMunFs1VV9/HEC5UBvtU26K 8D7Ipc1EHTq2A== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail Date: Thu, 30 Aug 2018 23:00:08 +0200 Message-Id: <66888ed290bb80f8c529af2583611a383e2430f3.1535656077.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v2 07/12] drm/mgag200: use simpler remove_conflicting_pci_framebuffers() MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org Cc: Alex Deucher Cc: Cc: Bartlomiej Zolnierkiewicz Cc: David Airlie Cc: Eric Anholt Cc: Gerd Hoffmann Cc: Cc: Cc: Cc: Maxime Ripard Cc: Thierry Reding Cc: Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.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 Thu Aug 30 21:00:08 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: 10582817 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 9775B175A for ; Thu, 30 Aug 2018 21:06:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 881CD2C290 for ; Thu, 30 Aug 2018 21:06:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7C0F62C31D; Thu, 30 Aug 2018 21:06:03 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B84C2C290 for ; Thu, 30 Aug 2018 21:06:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727281AbeHaBKF (ORCPT ); Thu, 30 Aug 2018 21:10:05 -0400 Received: from rere.qmqm.pl ([91.227.64.183]:25518 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727510AbeHaBKF (ORCPT ); Thu, 30 Aug 2018 21:10:05 -0400 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 421ZcM1H2hzrb; Thu, 30 Aug 2018 22:59:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1535662771; bh=QC4nPiVVu1nX7KIKaPqDLZDEqgZQhHs8ZZ5p04+3mq0=; h=Date:In-Reply-To:References:From:Subject:To:Cc:Cc:Cc:Cc:Cc:Cc:Cc: Cc:Cc:Cc:Cc:From; b=B72vgY5yUlDMLcde3GpW4uK7p86vRFmrmba5G6E4HRQkVNAlvnoGmK4seY5RZnjWq X0g58txwMx9Lx21qWkw6skAq59aQ3yDC0VH48byj3AlUgyP1sC5sJqp/lwThJyQ1kR PdcK9tzbx2mqo5kcnjQAKouFNaMe7oukN4aBohtjqpA8Y83HFSOuA9FZLQqJucFXS+ BTxmNuUDzZYtA0evCI+YPWy+dKR6fCpT4AzHeKhW7kWNWkLKfy6Y5T3j/tZrhto2sr QDtypJ8aNsC581sib4/s0kNf0CT+oWxqB/SO5VfG3PQH1AP5yoEVmj/fR6ziaXC6Zj 7HGOLR+Cecolg== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail Date: Thu, 30 Aug 2018 23:00:08 +0200 Message-Id: <3b6a06b61458471bdecb40fa0af052a75d5a8222.1535656077.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v2 08/12] drm/radeon: use simpler remove_conflicting_pci_framebuffers() MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org Cc: Alex Deucher , amd-gfx@lists.freedesktop.org Cc: Bartlomiej Zolnierkiewicz Cc: David Airlie Cc: Eric Anholt Cc: Gerd Hoffmann Cc: Cc: Cc: Cc: Maxime Ripard Cc: Thierry Reding Cc: Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.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 Thu Aug 30 21:00:09 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: 10582819 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 BAAB11805 for ; Thu, 30 Aug 2018 21:06:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB58D2C290 for ; Thu, 30 Aug 2018 21:06:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F0E42C31C; Thu, 30 Aug 2018 21:06:03 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C3432C318 for ; Thu, 30 Aug 2018 21:06:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727523AbeHaBKF (ORCPT ); Thu, 30 Aug 2018 21:10:05 -0400 Received: from rere.qmqm.pl ([91.227.64.183]:26395 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727504AbeHaBKF (ORCPT ); Thu, 30 Aug 2018 21:10:05 -0400 X-Greylist: delayed 354 seconds by postgrey-1.27 at vger.kernel.org; Thu, 30 Aug 2018 21:10:03 EDT Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 421ZcN0F8qzs4; Thu, 30 Aug 2018 22:59:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1535662772; bh=gmzq5OR1+6P/pJOhCSwW9f0H/rCztuuw8Vr9j0ETzP4=; h=Date:In-Reply-To:References:From:Subject:To:Cc:Cc:Cc:Cc:Cc:Cc:Cc: Cc:Cc:Cc:Cc:From; b=oOM57PhFvJySfHZM6akaolip+5TYvofbxyDNG1I+3sDhzZ+rUfBJOOof2NHWmk+Og qnXl7mFLJsAXc8PikaMhYvgN1r66Qg+0Zwl6PmyAJQBSEdwfvkWoVI/cq4mQf95RUQ BChFYdFQet5eiCXvXHdjNFqKPdJF1rm7UT9gqiEo3hiKFvI0zx4PFmIVnlgB6aCeya hfEaL6/a8bJJDzPBUf8aJ7K8YG0JFgEjLyhB7xVP/HRjIUn5W7X/xw8rH8MeYrbUAQ eIvX5Mp5Jr/DYk9/Y9ud6ofICKIo71Zz0RdeFSEcqRp+e8AwhWXX+DMg4Fq2jD5qTB OFpXreFmijkYw== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail Date: Thu, 30 Aug 2018 23:00:09 +0200 Message-Id: <4f4a5b7472a7161dc0fc7a1a9be746d18fc8a7b1.1535656077.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v2 09/12] drm/virtio: use simpler remove_conflicting_pci_framebuffers() MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org Cc: David Airlie , virtualization@lists.linux-foundation.org Cc: Alex Deucher Cc: Cc: Bartlomiej Zolnierkiewicz Cc: Eric Anholt Cc: Gerd Hoffmann Cc: Cc: Cc: Cc: Maxime Ripard Cc: Thierry Reding Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.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 Thu Aug 30 21:00:10 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: 10582827 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 7C414174C for ; Thu, 30 Aug 2018 21:06:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6BF302C290 for ; Thu, 30 Aug 2018 21:06:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5F4182C31D; Thu, 30 Aug 2018 21:06:05 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D0F12C318 for ; Thu, 30 Aug 2018 21:06:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727555AbeHaBKH (ORCPT ); Thu, 30 Aug 2018 21:10:07 -0400 Received: from 183.pool-64.klikom.net ([91.227.64.183]:62421 "EHLO rere.qmqm.pl" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1727524AbeHaBKH (ORCPT ); Thu, 30 Aug 2018 21:10:07 -0400 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 421ZcN57BLzs7; Thu, 30 Aug 2018 22:59:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1535662772; bh=eePa/t7j5CstRGk6pBFuC4znb/qaSIMvWgJG9klZ6aY=; h=Date:In-Reply-To:References:From:Subject:To:Cc:Cc:Cc:Cc:Cc:Cc:Cc: Cc:Cc:Cc:Cc:Cc:From; b=jNjr0sltZdaTe5m1hvn+3OshVRzcmj33u9mxH7AlmARiPDk/6mESHstLv/k/ym12k ZxzHuOWkbxa2tSF2SpxBaJhj4rL5OnRt0PhClXf9cDvN/mqoeUZ1JX+tOs3EqQzOv0 NSb6L/k/vU2R+mKwrwGjomwnlyE17GSYkEJYNkKZLDu6wqpYD1tObRFAEeTCRtjY44 2qPCtZ0KENuPwOdSIvXlMEntKuGVsUu2U7Eewbp+7ircuwRnY0RMA5Cpqd0NxD7lMB 3QgkQh7LXqJOKdahItu1cyjSGXZ2gFFLJZ8B8SlR3+TFGwgdvxul8IrqW+j2vdvemq 8e0aN/7uPBE+g== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail Date: Thu, 30 Aug 2018 23:00:10 +0200 Message-Id: <6bf2ab274713156b245e897154219055396aa017.1535656077.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v2 10/12] drm/vc4: use simpler remove_conflicting_framebuffers(NULL) MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org Cc: Eric Anholt Cc: Alex Deucher Cc: Cc: Bartlomiej Zolnierkiewicz Cc: David Airlie Cc: Gerd Hoffmann Cc: Cc: Cc: Cc: Maxime Ripard Cc: Thierry Reding Cc: Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.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 Thu Aug 30 21:00:11 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: 10582839 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 49672180E for ; Thu, 30 Aug 2018 21:06:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36AB42C290 for ; Thu, 30 Aug 2018 21:06:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B5DF2C31C; Thu, 30 Aug 2018 21:06: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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD2E82C318 for ; Thu, 30 Aug 2018 21:06:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727557AbeHaBKH (ORCPT ); Thu, 30 Aug 2018 21:10:07 -0400 Received: from 183.pool-64.klikom.net ([91.227.64.183]:42133 "EHLO rere.qmqm.pl" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1727532AbeHaBKH (ORCPT ); Thu, 30 Aug 2018 21:10:07 -0400 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 421ZcP5pqpzsD; Thu, 30 Aug 2018 22:59:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1535662773; bh=WGaZ3CjyVt7Sh/UtYrEXH/3jMbfSxhu26rb+dqQOntQ=; h=Date:In-Reply-To:References:From:Subject:To:Cc:Cc:Cc:Cc:Cc:Cc:Cc: Cc:Cc:Cc:Cc:From; b=Eo+c75MrV4tM5EeTRJmb8RCIPtue4m0n5PRAcG4N5rgH0Wkz8r40C4NPWgnBWISXW VUy3grT61fWSjBDw1xfpmyF/rJ5lxqlhpF0k9AHR8TGK+SF7+z762Hj2P+KYd6iByy 6hJGUmfK0uqcqSmlZ4pmi7cP4tNiBNp/UWkrsaY5k2QXU0DUibF1TeL6Ld+H12UYvg vTG/o7a0snIuETSxxvudBfI06GsTBLc9C4kd5FYKieXx8ZMMmXJu/evNBWR6mTeu94 z2NWKHniQFZwyY2Jz/vxNJzEvrm0FPHC/TdyoOF6DMOKNGa4IZwQbEUdhSIAN9juQX oyTsNyrC2uLnQ== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail Date: Thu, 30 Aug 2018 23:00:11 +0200 Message-Id: In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v2 11/12] drm/sun4i: use simpler remove_conflicting_framebuffers(NULL) MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org Cc: Maxime Ripard , linux-arm-kernel@lists.infradead.org Cc: Alex Deucher Cc: Cc: Bartlomiej Zolnierkiewicz Cc: David Airlie Cc: Eric Anholt Cc: Gerd Hoffmann Cc: Cc: Cc: Thierry Reding Cc: Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.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 Thu Aug 30 21:00:12 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: 10582821 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 53430175A for ; Thu, 30 Aug 2018 21:06:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 457D32C290 for ; Thu, 30 Aug 2018 21:06:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39ABA2C31D; Thu, 30 Aug 2018 21:06:04 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF2782C290 for ; Thu, 30 Aug 2018 21:06:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727514AbeHaBKF (ORCPT ); Thu, 30 Aug 2018 21:10:05 -0400 Received: from rere.qmqm.pl ([91.227.64.183]:52480 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727281AbeHaBKE (ORCPT ); Thu, 30 Aug 2018 21:10:04 -0400 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 421ZcQ66FlzsN; Thu, 30 Aug 2018 22:59:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1535662774; bh=MxtO5Mhr0GkPH8MUP06AqtRLFfui2zInQhDye32pDvw=; h=Date:In-Reply-To:References:From:Subject:To:Cc:Cc:Cc:Cc:Cc:Cc:Cc: Cc:Cc:Cc:Cc:From; b=cwnrwF8H8qsPFbZvUmgcz9SsUAhrF0xoTPmnar+PgwyfY2fL8fVr9jZ/ALTDYo9Mp 1HHbKNtBQ+wyYQi9aV8nAFXiXz/LZuyzu3Jy4xWldE//VQ1pH4z5XNnC4Op6TshFbt O9Fb8mX9DCf8CA73tjmRsI6ym6WnXuUKjgTXnAGELrEGnyxbTEoYocgNc8CtEpYmzh 8fWWM9IyTXs8nlfeYNAfY25LxTZVeBVFgVA1ltrhicF2pZ9SSf01KoZLWGmkPUlNq2 sicgL3vZ50vy/xYJBqt2h2efV4xnfMGPiPjC0u5GMD3d62TX2IcqlPJsLksrxiu9/+ QZoVUSffK+gWQ== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail Date: Thu, 30 Aug 2018 23:00:12 +0200 Message-Id: <985a03e73608bcab0ec84b67edb69e334bd012fe.1535656077.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v2 12/12] drm/tegra: kick out simplefb MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org Cc: Thierry Reding , linux-tegra@vger.kernel.org Cc: Alex Deucher Cc: Cc: Bartlomiej Zolnierkiewicz Cc: David Airlie Cc: Eric Anholt Cc: Gerd Hoffmann Cc: Cc: Cc: Maxime Ripard Cc: Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.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;