linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] drm/meson: remove firmware framebuffers
@ 2018-12-10  9:28 Maxime Jourdan
  2018-12-12  9:55 ` Neil Armstrong
  0 siblings, 1 reply; 5+ messages in thread
From: Maxime Jourdan @ 2018-12-10  9:28 UTC (permalink / raw)
  To: Neil Armstrong; +Cc: linux-amlogic, dri-devel, linux-kernel, linux-arm-kernel

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 <mjourdan@baylibre.com>
---
 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;
-- 
2.19.2


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH RESEND] drm/meson: remove firmware framebuffers
  2018-12-10  9:28 [PATCH RESEND] drm/meson: remove firmware framebuffers Maxime Jourdan
@ 2018-12-12  9:55 ` Neil Armstrong
  2018-12-12 12:22   ` Maxime Jourdan
  0 siblings, 1 reply; 5+ messages in thread
From: Neil Armstrong @ 2018-12-12  9:55 UTC (permalink / raw)
  To: Maxime Jourdan; +Cc: linux-amlogic, dri-devel, linux-kernel, linux-arm-kernel

Hi Maxime,

On 10/12/2018 10:28, Maxime Jourdan wrote:
> 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 <mjourdan@baylibre.com>
> ---
>  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);

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

Neil

> +	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;
> 


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH RESEND] drm/meson: remove firmware framebuffers
  2018-12-12  9:55 ` Neil Armstrong
@ 2018-12-12 12:22   ` Maxime Jourdan
  2018-12-12 12:39     ` Neil Armstrong
  0 siblings, 1 reply; 5+ messages in thread
From: Maxime Jourdan @ 2018-12-12 12:22 UTC (permalink / raw)
  To: Neil Armstrong; +Cc: linux-amlogic, dri-devel, linux-kernel, linux-arm-kernel

Hi Neil,
On Wed, Dec 12, 2018 at 10:55 AM Neil Armstrong <narmstrong@baylibre.com> wrote:
>
> Hi Maxime,
>
> On 10/12/2018 10:28, Maxime Jourdan wrote:
> > 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 <mjourdan@baylibre.com>
> > ---
> >  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);
>
> I always wondered, where does the "meson-drm-fb" comes from ???
>
> 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

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH RESEND] drm/meson: remove firmware framebuffers
  2018-12-12 12:22   ` Maxime Jourdan
@ 2018-12-12 12:39     ` Neil Armstrong
  2019-01-14 15:34       ` Neil Armstrong
  0 siblings, 1 reply; 5+ messages in thread
From: Neil Armstrong @ 2018-12-12 12:39 UTC (permalink / raw)
  To: Maxime Jourdan; +Cc: linux-amlogic, dri-devel, linux-kernel, linux-arm-kernel

On 12/12/2018 13:22, Maxime Jourdan wrote:
> Hi Neil,
> On Wed, Dec 12, 2018 at 10:55 AM Neil Armstrong <narmstrong@baylibre.com> wrote:
>>
>> Hi Maxime,
>>
>> On 10/12/2018 10:28, Maxime Jourdan wrote:
>>> 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 <mjourdan@baylibre.com>
>>> ---
>>>  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);
>>
>> I always wondered, where does the "meson-drm-fb" comes from ???
>>
>> 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().

Ok Cool !

> 
> Maxime
> 

Acked-by: Neil Armstrong <narmstrong@baylibre.com>

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

Neil

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH RESEND] drm/meson: remove firmware framebuffers
  2018-12-12 12:39     ` Neil Armstrong
@ 2019-01-14 15:34       ` Neil Armstrong
  0 siblings, 0 replies; 5+ messages in thread
From: Neil Armstrong @ 2019-01-14 15:34 UTC (permalink / raw)
  To: Maxime Jourdan; +Cc: linux-amlogic, dri-devel, linux-kernel, linux-arm-kernel

On 12/12/2018 13:39, Neil Armstrong wrote:
> On 12/12/2018 13:22, Maxime Jourdan wrote:
>> Hi Neil,
>> On Wed, Dec 12, 2018 at 10:55 AM Neil Armstrong <narmstrong@baylibre.com> wrote:
>>>
>>> Hi Maxime,
>>>
>>> On 10/12/2018 10:28, Maxime Jourdan wrote:
>>>> 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 <mjourdan@baylibre.com>
>>>> ---
>>>>  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);
>>>
>>> I always wondered, where does the "meson-drm-fb" comes from ???
>>>
>>> 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().
> 
> Ok Cool !
> 
>>
>> Maxime
>>
> 
> Acked-by: Neil Armstrong <narmstrong@baylibre.com>
> 
> I'll push it when the bindings are acked and when v4.21-rc1 is tagged !
> 
> Neil
> 

Applied to drm-misc-next.

Thanks,
Neil

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-01-14 15:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-10  9:28 [PATCH RESEND] drm/meson: remove firmware framebuffers Maxime Jourdan
2018-12-12  9:55 ` Neil Armstrong
2018-12-12 12:22   ` Maxime Jourdan
2018-12-12 12:39     ` Neil Armstrong
2019-01-14 15:34       ` Neil Armstrong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).