From patchwork Fri Nov 24 17:53:34 2017 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: 10076099 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 63B9D602BD for ; Mon, 27 Nov 2017 08:35:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 519E928CA0 for ; Mon, 27 Nov 2017 08:35:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 467F028D9A; Mon, 27 Nov 2017 08:35:49 +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=-3.3 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CD4EE28CA0 for ; Mon, 27 Nov 2017 08:35:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A63696E253; Mon, 27 Nov 2017 08:34:36 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from rere.qmqm.pl (78-11-180-123.static.ip.netia.com.pl [78.11.180.123]) by gabe.freedesktop.org (Postfix) with ESMTPS id 358896E0B1 for ; Fri, 24 Nov 2017 18:02:46 +0000 (UTC) Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 3yk3hZ4CFTz5W; Fri, 24 Nov 2017 18:53:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1511546014; bh=+LKaI1WG0Xyyy3+m/ngwdYOdXhPfpqT8YlfqWQBQsFY=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=cNJxBRznc5MMnfl2UtlgrcjCPgAmF7FT+vWepWQe8OcJZ3u+QBfeQa2KRB+iYL7i7 L45Ou08YQcuvdO+Ggi+csH39kn9qaljFznbQ9ditmJZov48BvoIyYaMi2I1xfdC3Fv GaJA8g4eLlYh+8ydjIW2uuS2bfSa/gUOtKwPKin9VZ1uEbwS8jvuB7A0pclucRA3XX 9wEKwG3DEOqGMcHEEYqdyC8IQTHL6pnpIsDlXfZXCH/lcreJBBOdbmgLvBzRF8Cict CYfwnrRCw2FCSlF5eQYr4iHEFwtCJkFXpOMffwS6fQCFEfzNMt+8pYdZVyPugYSyEI q2EiZG1lAVT5A== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.99.2 at rere Date: Fri, 24 Nov 2017 18:53:34 +0100 Message-Id: In-Reply-To: References: From: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= Subject: [PATCH 12/13] drm/sun4i: use simpler remove_conflicting_framebuffers(NULL) MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org X-Mailman-Approved-At: Mon, 27 Nov 2017 08:34:15 +0000 Cc: David Airlie , Maxime Ripard , Chen-Yu Tsai X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use remove_conflicting_framebuffers(NULL) instead of duplicating it. Signed-off-by: Michał Mirosław --- 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 75c76cdd82bc..febc591e9c17 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -66,22 +66,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; @@ -123,7 +107,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 */ drv->fbdev = sun4i_framebuffer_init(drm);