Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3408887imu; Mon, 10 Dec 2018 01:30:01 -0800 (PST) X-Google-Smtp-Source: AFSGD/VxmkUIM3d8JXQWSL2Z01Yk3Cy909gEwHpxu02Q+TFDnqKs3UG8IDkGnhPRTci0gihmiJAF X-Received: by 2002:a65:6094:: with SMTP id t20mr10123690pgu.285.1544434201653; Mon, 10 Dec 2018 01:30:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544434201; cv=none; d=google.com; s=arc-20160816; b=lzet938zgkr7A62eYXO2XiYgsOaNKup4AmXEZCxmakQUz7yIHKQSgN4UvnzgZMlC8k OdpRvxBsdn1i63oZtVtOncHgFxXGbCiKIqMeAALCKhZ1V/UBIxX4s+VCUlQeIchvtAle j9CuMlY1eGs7I1zsGP0gJX9TSRZXZGpH3BrXGXDWr/3afGnAh7RIXz5c7MKOW0JafkMu hNQxl1laZiF0CHnyXAdhdVIOssbgJLAUXPrw75I4OjIUvlCDUj5RqPs60V+2OwHuzLaJ 6scLIrgGKsCsk287/Vt1ecOVKO4x1A2nzOmob1LRzKqcWc0tkqbfK/kmXoD+dXyptnoE yVBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=acAAxuC8xw1vTrdEMgWFf+3ymowNGDjPcrhaXEGaw/k=; b=EA/xzzUu9x/RbsRrPcJ/iw7yEyDKeYYRhaxbhclyXfUeYrvOwzZzLYMKz0Jx7BoDbY POOYdW/2Scb907H9qwU6J7OKILDHl+T5zGlWbDK0RnFhgU4GKMK2vl/ti6ykllAWNGf6 aE+JZGko0YGKXztGkc3bTyez8/qpA5IhVXX5nz2WExOPTih2EvhRmWbHil+sLztwlkpL MnzCWg3Bdv0nz4zrPLfGnyYsgcMcHR5WxhUNujaI0BB8p0itwBXQSQWUrKz8KdZT58GM sx1PastbLSYJDQ+wExnkVM/WILoLaTMnK2p9apWLPUktYk57+wzQnYH9ScnbuhPkpUUl Gpyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=jt1J7aQy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z136si9741501pgz.28.2018.12.10.01.29.45; Mon, 10 Dec 2018 01:30:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=jt1J7aQy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726946AbeLJJFL (ORCPT + 99 others); Mon, 10 Dec 2018 04:05:11 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:37768 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726667AbeLJJFK (ORCPT ); Mon, 10 Dec 2018 04:05:10 -0500 Received: by mail-wm1-f68.google.com with SMTP id g67so10274239wmd.2 for ; Mon, 10 Dec 2018 01:05:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=acAAxuC8xw1vTrdEMgWFf+3ymowNGDjPcrhaXEGaw/k=; b=jt1J7aQyGQlJI3EAKqTBItpaPYQr688BavuyAc1+va5mHIYQwqWazQN6De0z89j3+s yVGuuXZF791gkZG9rMGo966zlZF0sy25P5URvAf5V77O9lTV+tdH20U45zoEC5pJ7db/ mML7K3qJ9sw4qMK+09+oOp6k5MQM3RK2hPfp0qVGbkBFVY80aX8iK62ccYm9M8ANtXsV 5AOstZOIeVtqw9MQuZp7yOGIOMrmgFCCbdrVHgfdbKhAAhJLzb8H59xh5iaVYw5k5rpG 8JFSSP+pdhT8FK2l1c99UeyY9yrTXmf7TmWSyCwd3U03ZmPcoIu7fyZZSMDcn2p5otP+ TMlA== 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=acAAxuC8xw1vTrdEMgWFf+3ymowNGDjPcrhaXEGaw/k=; b=KhjEXFMVvTLG6IOch4yoMX8k+dA7Jf5icPkWL2g6/xpZ8TKrdds1wENGqe9pOz7ckz nP12u1zzE+jq6xVzS356aZjF/4H3DzG7ob4fFReZWPkcq1S2belRsKwgDVYbx69C9gs5 m8NxedUiaqLzxPhHEBuSmTc4sRUz0BHswG40GQrRVNRE+1CbjBvqtKSumF91mLmW0gkz 4rsymU7Wr+EKqwENU1Wu+RDW49ecGYL3+05nHepwX8b5WHituXIb5Xv2fwyzNLuI46b7 6LgYl7RUigcmyq8ZpzsRka/uIr6Utf43jphZ3BYtlL5lRSeH6lKk3yMhWYgMtmWhX0sy bF2w== X-Gm-Message-State: AA+aEWYEByKLn40oSDBRnkajFropVtPxz45USyRoMxvuXMtfsgDa33qd 7v+HjOi49U3mzikt4hQ/9UVGkb/RHbasxg== X-Received: by 2002:a1c:cbc7:: with SMTP id b190mr10597829wmg.13.1544432709087; Mon, 10 Dec 2018 01:05:09 -0800 (PST) Received: from localhost.localdomain (abo-99-183-68.mtp.modulonet.fr. [85.68.183.99]) by smtp.gmail.com with ESMTPSA id s202sm11066031wme.40.2018.12.10.01.05.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 01:05:08 -0800 (PST) From: Maxime Jourdan To: Neil Armstrong Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/meson: remove firmware framebuffers Date: Mon, 10 Dec 2018 10:04:48 +0100 Message-Id: <20181210090448.4301-1-mjourdan@baylibre.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/gpu/drm/meson/meson_drv.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c index d3443125e661..82fbd7ae80e4 100644 --- a/drivers/gpu/drm/meson/meson_drv.c +++ b/drivers/gpu/drm/meson/meson_drv.c @@ -159,6 +159,22 @@ 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 +258,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; -- 2.19.2