From patchwork Mon Dec 10 09:04:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Jourdan X-Patchwork-Id: 10723289 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 D92451759 for ; Tue, 11 Dec 2018 09:20:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C837329F04 for ; Tue, 11 Dec 2018 09:20:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BBBE629FE5; Tue, 11 Dec 2018 09:20:56 +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 6FF4429F04 for ; Tue, 11 Dec 2018 09:20:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 157A96E01E; Tue, 11 Dec 2018 09:20:54 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id 75BDD6E762 for ; Mon, 10 Dec 2018 09:05:10 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id c126so10293663wmh.0 for ; Mon, 10 Dec 2018 01:05:10 -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=acAAxuC8xw1vTrdEMgWFf+3ymowNGDjPcrhaXEGaw/k=; b=Au9XEERKiZ9ShxO1UAmUdQ0TQzXSWDW2qdDr6pT8HSJayJQhYwqz+DhR8+2CKSErD6 AQTCvKHgIxwbxknyH4GJQVPQVWPvcSP8FLPtLOf00M5LiA2y65AIvbO8Kz39ZsDQwH3t Yrv6hf087xqizmiqLjtGcqqO+p+Z+rxbvCtl6WIPTyGezCzmOOD8mD2tdIhG+dT2flbI wtwkdXbTWmZ5vLmrUmNsYgzMMoEz5FjsF+C/pca5h8jJWR99WxfUPPEb7zgvruNaLGDQ Cjevaj0AX62l6tLdenZRpvYjezokpb0jf+57nVvheBRjOyStvlljjU9LNrpTLQgiRmSB ZYdw== X-Gm-Message-State: AA+aEWYSeszj5xUlLM3Z5Eb/dwFeE9QZytsw034WQdsvCKD0P7q9plnh Oz0HNrE0ZeeS447Jyp9CSvtnFg== X-Google-Smtp-Source: AFSGD/WwDn7wNpxnXfrYlXOznRcRKD+iMC5hbzSFdAA/4q2QjwKIvN0sVQqBy4Pu5KcJY4BK5C9y8Q== 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 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 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 --- 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;