From patchwork Mon Dec 10 09:28:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Jourdan X-Patchwork-Id: 10723259 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 9C1C01759 for ; Tue, 11 Dec 2018 09:19:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8BAC529E9D for ; Tue, 11 Dec 2018 09:19:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8034F29EA6; Tue, 11 Dec 2018 09:19: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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 7AD7C29E9D for ; Tue, 11 Dec 2018 09:19:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DD85789D6C; Tue, 11 Dec 2018 09:18:54 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by gabe.freedesktop.org (Postfix) with ESMTPS id A10CC6E949 for ; Mon, 10 Dec 2018 09:29:06 +0000 (UTC) Received: by mail-wm1-x344.google.com with SMTP id c126so10379007wmh.0 for ; Mon, 10 Dec 2018 01:29:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=DLy0SwLSlaGwBkl+R1noWL7/C+Z5I/Uca6dIaJcbB2c=; b=HyW3ZBAnng6sp7xoCP0wrDwZcqwouFdxYuTBIeTkM5ko+aHnK3vsuCUSK18T2ulCy6 fM2V2bC+KQBCeqctKXelWK0ZdWFO7C8YuPF/4jVmcFPPck21Usu1k/3Rc6xS94L+75zD 2Gn3YuUz6EqKzHIJsDeXNd/Uzm7awpwRszn4Gn1Igyi85VpInjqw39MczR3XbKenFCUp XUTat+/HSX50QhHn0QFTVPHQ2GimNOBxPsb5UWVukQsuFuQTSkXyT7yHVqkRj6iC0Mlr TXYlcSjqqpVbiVjyN1K45u6YtADgRwFQk3BH3wRx/Ln2uBG80okPuzjZfBn3LxzIGnZP SUBQ== X-Gm-Message-State: AA+aEWZIONYQ2mVXpbHqkPGZHA9Xm79Hc1X2PPBiWmrBZYXdyPTWbwAd Frz3nS9gFIMV7+1+66v+Oa5I4Q== X-Google-Smtp-Source: AFSGD/W8siubOMUy4gGFt2YEE32b0gn4hrwCzt6L4ZRUZsajc4Ozf6EFG5giz6Qhitltb66SY/EepA== X-Received: by 2002:a1c:91d1:: with SMTP id t200mr9737373wmd.111.1544434145308; Mon, 10 Dec 2018 01:29:05 -0800 (PST) Received: from localhost.localdomain (abo-99-183-68.mtp.modulonet.fr. [85.68.183.99]) by smtp.gmail.com with ESMTPSA id k128sm16348976wmd.37.2018.12.10.01.29.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 01:29:04 -0800 (PST) From: Maxime Jourdan To: Neil Armstrong Subject: [PATCH RESEND] drm/meson: remove firmware framebuffers Date: Mon, 10 Dec 2018 10:28:53 +0100 Message-Id: <20181210092853.13050-1-mjourdan@baylibre.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 11 Dec 2018 09:18:52 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP In case we are using simplefb or another conflicting framebuffer, make the call to drm_fb_helper_remove_conflicting_framebuffers() Signed-off-by: Maxime Jourdan Acked-by: Neil Armstrong --- drivers/gpu/drm/meson/meson_drv.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c index d3443125e661..afbb3d707d15 100644 --- a/drivers/gpu/drm/meson/meson_drv.c +++ b/drivers/gpu/drm/meson/meson_drv.c @@ -159,6 +159,23 @@ static void meson_vpu_init(struct meson_drm *priv) writel_relaxed(0x20000, priv->io_base + _REG(VPU_WRARB_MODE_L2C1)); } +static void meson_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, "meson-drm-fb", + false); + kfree(ap); +} + static int meson_drv_bind_master(struct device *dev, bool has_components) { struct platform_device *pdev = to_platform_device(dev); @@ -242,6 +259,9 @@ static int meson_drv_bind_master(struct device *dev, bool has_components) if (ret) goto free_drm; + /* Remove early framebuffers (ie. simplefb) */ + meson_remove_framebuffers(); + drm_mode_config_init(drm); drm->mode_config.max_width = 3840; drm->mode_config.max_height = 2160;