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: 10584767 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 C847113AC for ; Sat, 1 Sep 2018 14:08:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C86C12A210 for ; Sat, 1 Sep 2018 14:08:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC8772A21D; Sat, 1 Sep 2018 14:08:50 +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 9F2C02A210 for ; Sat, 1 Sep 2018 14:08:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727352AbeIASU7 (ORCPT ); Sat, 1 Sep 2018 14:20:59 -0400 Received: from rere.qmqm.pl ([91.227.64.183]:13638 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727247AbeIASU7 (ORCPT ); Sat, 1 Sep 2018 14:20:59 -0400 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 Cc: Alex Deucher , amd-gfx@lists.freedesktop.org Cc: Bartlomiej Zolnierkiewicz , Dave Airlie , David Airlie , Eric Anholt , Gerd Hoffmann , Jonathan Hunter , linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, linux-tegra@vger.kernel.org, Maxime Ripard , Thierry Reding , virtualization@lists.linux-foundation.org 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;