Skip to contentSkip to conversation

drm/meson: remove firmware framebuffers

PATCH RESEND Applied Maxime Jourdan 2 participants 5 messages Dec 10, 2018 – Jan 14, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 drm/meson: remove firmware framebuffers

In case we are using simplefb or another conflicting framebuffer, make the call to drm_fb_helper_remove_conflicting_framebuffers()

---
 drivers/gpu/drm/meson/meson_drv.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/gpu/drm/meson/meson_drv.c +20 -0
index d3443125e661..afbb3d707d15 100644
@@ -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;
Signature · 1 line
2.19.2
#1 lore raw

Hi Maxime,

Quoted 20 lines · Maxime Jourdan

In case we are using simplefb or another conflicting framebuffer, make the call to drm_fb_helper_remove_conflicting_framebuffers()

---
 drivers/gpu/drm/meson/meson_drv.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/gpu/drm/meson/meson_drv.c +4 -0
index d3443125e661..afbb3d707d15 100644
@@ -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;
+

drivers/gpu/drm/meson/meson_drv.c static void meson_vpu_init(struct meson_drm *priv) · line 175

Quoted 10 lines
drivers/gpu/drm/meson/meson_drv.c +10 -0
+	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);

I always wondered, where does the "meson-drm-fb" comes from ???

Neil

Quoted 17 lines
drivers/gpu/drm/meson/meson_drv.c +6 -0
+	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;
#2 lore raw

Hi Neil,

Quoted 37 lines · Neil Armstrong

Hi Maxime,

Quoted 20 lines · Maxime Jourdan

In case we are using simplefb or another conflicting framebuffer, make the call to drm_fb_helper_remove_conflicting_framebuffers()

---
 drivers/gpu/drm/meson/meson_drv.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/gpu/drm/meson/meson_drv.c +4 -0
index d3443125e661..afbb3d707d15 100644
@@ -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;
+

drivers/gpu/drm/meson/meson_drv.c static void meson_vpu_init(struct meson_drm *priv) · line 175

Quoted 10 lines
drivers/gpu/drm/meson/meson_drv.c +10 -0
+     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);

I always wondered, where does the "meson-drm-fb" comes from ???

Quoted 2 lines

Neil

This name ultimately ends up in a printk and has no functional impact. See drivers/video/fbdev/core/fbmem.c:1613 :

printk(KERN_INFO "fb%d: switching to %s from %s\n", i, name, registered_fb[i]->fix.id);

I just picked one that was similar to the names of other drm drivers calling drm_fb_helper_remove_conflicting_framebuffers().

Maxime

#3 lore raw
Quoted 42 lines · Maxime Jourdan

Hi Neil,

Quoted 37 lines · Neil Armstrong

Hi Maxime,

Quoted 20 lines · Maxime Jourdan

In case we are using simplefb or another conflicting framebuffer, make the call to drm_fb_helper_remove_conflicting_framebuffers()

---
 drivers/gpu/drm/meson/meson_drv.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/gpu/drm/meson/meson_drv.c +4 -0
index d3443125e661..afbb3d707d15 100644
@@ -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;
+

drivers/gpu/drm/meson/meson_drv.c static void meson_vpu_init(struct meson_drm *priv) · line 175

Quoted 10 lines
drivers/gpu/drm/meson/meson_drv.c +10 -0
+     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);

I always wondered, where does the "meson-drm-fb" comes from ???

Quoted 2 lines

Neil

Quoted 8 lines

This name ultimately ends up in a printk and has no functional impact. See drivers/video/fbdev/core/fbmem.c:1613 :

printk(KERN_INFO "fb%d: switching to %s from %s\n", i, name, registered_fb[i]->fix.id);

I just picked one that was similar to the names of other drm drivers calling drm_fb_helper_remove_conflicting_framebuffers().

Ok Cool !

Quoted 3 lines

Maxime

I'll push it when the bindings are acked and when v4.21-rc1 is tagged !

Neil

#4 lore raw
Quoted 55 lines · Neil Armstrong
Quoted 42 lines · Maxime Jourdan

Hi Neil,

Quoted 37 lines · Neil Armstrong

Hi Maxime,

Quoted 20 lines · Maxime Jourdan

In case we are using simplefb or another conflicting framebuffer, make the call to drm_fb_helper_remove_conflicting_framebuffers()

---
 drivers/gpu/drm/meson/meson_drv.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/gpu/drm/meson/meson_drv.c +4 -0
index d3443125e661..afbb3d707d15 100644
@@ -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;
+

drivers/gpu/drm/meson/meson_drv.c static void meson_vpu_init(struct meson_drm *priv) · line 175

Quoted 10 lines
drivers/gpu/drm/meson/meson_drv.c +10 -0
+     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);

I always wondered, where does the "meson-drm-fb" comes from ???

Quoted 2 lines

Neil

Quoted 8 lines

This name ultimately ends up in a printk and has no functional impact. See drivers/video/fbdev/core/fbmem.c:1613 :

printk(KERN_INFO "fb%d: switching to %s from %s\n", i, name, registered_fb[i]->fix.id);

I just picked one that was similar to the names of other drm drivers calling drm_fb_helper_remove_conflicting_framebuffers().

Ok Cool !

Quoted 1 line
Quoted 9 lines
Quoted 2 lines

Maxime

I'll push it when the bindings are acked and when v4.21-rc1 is tagged !

Neil

Applied to drm-misc-next.

Thanks,
Neil