Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1382828

[PATCH] drm/vc4: Kick out the simplefb framebuffer before we set up KMS.

Path csiph.com!goblin2!goblin.stu.neva.ru!gothmog.csi.it!bofh.it!news.nic.it!robomod
From Eric Anholt <eric@anholt.net>
Newsgroups linux.kernel
Subject [PATCH] drm/vc4: Kick out the simplefb framebuffer before we set up KMS.
Date Tue, 19 Apr 2016 22:40:02 +0200
Message-ID <rpKBc-4bP-17@gated-at.bofh.it> (permalink)
X-Mailer git-send-email 2.8.0.rc3
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 55
Organization linux.* mail to news gateway
X-Original-Cc linux-kernel@vger.kernel.org, David Airlie <airlied@linux.ie>, Hans de Goede <hdegoede@redhat.com>, linux-fbdev@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, Stephen Warren <swarren@wwwdotorg.org>, Florian Fainelli <f.fainelli@gmail.com>, Eric Anholt <eric@anholt.net>
X-Original-Date Tue, 19 Apr 2016 13:37:09 -0700
X-Original-Message-ID <1461098229-8664-1-git-send-email-eric@anholt.net>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1382828

Show key headers only | View raw


If we don't, then simplefb stays loaded on /dev/fb0 even though
scanout isn't happening from simplefb's memory area any more, and you
end up with no console.

Signed-off-by: Eric Anholt <eric@anholt.net>
---

Dave: It would be nice if I could merge this patch through
bcm2835-dt-next, where I'm trying to get the VC4 DT merged even though
the defconfig includes both VC4 and simplefb.  There aren't any
conflicts with anything I'm merging through drm-next.

 drivers/gpu/drm/vc4/vc4_drv.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c
index b7d2ff0e6e1f..109b10651959 100644
--- a/drivers/gpu/drm/vc4/vc4_drv.c
+++ b/drivers/gpu/drm/vc4/vc4_drv.c
@@ -153,6 +153,24 @@ static void vc4_match_add_drivers(struct device *dev,
 	}
 }
 
+static void vc4_kick_out_firmware_fb(void)
+{
+	struct apertures_struct *ap;
+
+	ap = alloc_apertures(1);
+	if (!ap)
+		return;
+
+	/* Since VC4 is a UMA device, the simplefb node may have been
+	 * located anywhere in memory.
+	 */
+	ap->ranges[0].base = 0;
+	ap->ranges[0].size = ~0;
+
+	remove_conflicting_framebuffers(ap, "vc4drmfb", false);
+	kfree(ap);
+}
+
 static int vc4_drm_bind(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -186,6 +204,8 @@ static int vc4_drm_bind(struct device *dev)
 	if (ret)
 		goto gem_destroy;
 
+	vc4_kick_out_firmware_fb();
+
 	ret = drm_dev_register(drm, 0);
 	if (ret < 0)
 		goto unbind_all;
-- 
2.8.0.rc3

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH] drm/vc4: Kick out the simplefb framebuffer before we set up KMS. Eric Anholt <eric@anholt.net> - 2016-04-19 22:40 +0200
  Re: [PATCH] drm/vc4: Kick out the simplefb framebuffer before we set  up KMS. Dave Airlie <airlied@gmail.com> - 2016-04-19 23:40 +0200

csiph-web