diff mbox series

[RFC,2/2] video: meson: Use reserving memory function without kernel linear mapping

Message ID 20200219184342.15974-3-michael@amarulasolutions.com
State Superseded
Headers show
Series Update reserved memory for simple framebuffer | expand

Commit Message

Michael Nazzareno Trimarchi Feb. 19, 2020, 6:43 p.m. UTC
Memory reserved for the simple framebuffer should not be used
and part of memory linear mapping

Signed-off-by: Michael Trimarchi <michael at amarulasolutions.com>
---
 drivers/video/meson/meson_vpu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Simon Glass Feb. 20, 2020, 3:05 a.m. UTC | #1
Hi Michael,

On Wed, 19 Feb 2020 at 11:43, Michael Trimarchi
<michael at amarulasolutions.com> wrote:
>
> Memory reserved for the simple framebuffer should not be used
> and part of memory linear mapping
>
> Signed-off-by: Michael Trimarchi <michael at amarulasolutions.com>
> ---
>  drivers/video/meson/meson_vpu.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Is there a binding file for this? Please add it to a patch.

>
> diff --git a/drivers/video/meson/meson_vpu.c b/drivers/video/meson/meson_vpu.c
> index 4eb66398d0..134e011b82 100644
> --- a/drivers/video/meson/meson_vpu.c
> +++ b/drivers/video/meson/meson_vpu.c
> @@ -173,9 +173,9 @@ static void meson_vpu_setup_simplefb(void *fdt)
>          * at the end of the RAM and we strip this portion from the kernel
>          * allowed region
>          */
> -       mem_start = gd->bd->bi_dram[0].start;
> -       mem_size = gd->bd->bi_dram[0].size - meson_fb.fb_size;
> -       ret = fdt_fixup_memory_banks(fdt, &mem_start, &mem_size, 1);
> +       mem_start = meson_fb.base;
> +       mem_size = meson_fb.fb_size;
> +       ret = fdt_fixup_reserved_memory(blob, "display_reserved", &mem_start, &mem_size);

Odd that this uses underscore...normally bindings use hyphen.

>         if (ret) {
>                 eprintf("Cannot setup simplefb: Error reserving memory\n");
>                 return;
> --
> 2.17.1
>

Regards,
Simon
Michael Nazzareno Trimarchi Feb. 20, 2020, 6:07 a.m. UTC | #2
Hi

On Thu, Feb 20, 2020 at 4:05 AM Simon Glass <sjg at chromium.org> wrote:
>
> Hi Michael,
>
> On Wed, 19 Feb 2020 at 11:43, Michael Trimarchi
> <michael at amarulasolutions.com> wrote:
> >
> > Memory reserved for the simple framebuffer should not be used
> > and part of memory linear mapping
> >
> > Signed-off-by: Michael Trimarchi <michael at amarulasolutions.com>
> > ---
> >  drivers/video/meson/meson_vpu.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
>
> Is there a binding file for this? Please add it to a patch.
>

This is an example how to use it. I need to repost it. There is a
compilation issue
later. I need only to have some feedback from Neil because I can not
test this board

> >
> > diff --git a/drivers/video/meson/meson_vpu.c b/drivers/video/meson/meson_vpu.c
> > index 4eb66398d0..134e011b82 100644
> > --- a/drivers/video/meson/meson_vpu.c
> > +++ b/drivers/video/meson/meson_vpu.c
> > @@ -173,9 +173,9 @@ static void meson_vpu_setup_simplefb(void *fdt)
> >          * at the end of the RAM and we strip this portion from the kernel
> >          * allowed region
> >          */
> > -       mem_start = gd->bd->bi_dram[0].start;
> > -       mem_size = gd->bd->bi_dram[0].size - meson_fb.fb_size;
> > -       ret = fdt_fixup_memory_banks(fdt, &mem_start, &mem_size, 1);
> > +       mem_start = meson_fb.base;
> > +       mem_size = meson_fb.fb_size;
> > +       ret = fdt_fixup_reserved_memory(blob, "display_reserved", &mem_start, &mem_size);
>
> Odd that this uses underscore...normally bindings use hyphen.
>

Will fix. There are few things that I need to change here because
sunxi, meson use simpleframe buffer
but they have some code duplication

Micheal

> >         if (ret) {
> >                 eprintf("Cannot setup simplefb: Error reserving memory\n");
> >                 return;
> > --
> > 2.17.1
> >
>
> Regards,
> Simon
diff mbox series

Patch

diff --git a/drivers/video/meson/meson_vpu.c b/drivers/video/meson/meson_vpu.c
index 4eb66398d0..134e011b82 100644
--- a/drivers/video/meson/meson_vpu.c
+++ b/drivers/video/meson/meson_vpu.c
@@ -173,9 +173,9 @@  static void meson_vpu_setup_simplefb(void *fdt)
 	 * at the end of the RAM and we strip this portion from the kernel
 	 * allowed region
 	 */
-	mem_start = gd->bd->bi_dram[0].start;
-	mem_size = gd->bd->bi_dram[0].size - meson_fb.fb_size;
-	ret = fdt_fixup_memory_banks(fdt, &mem_start, &mem_size, 1);
+	mem_start = meson_fb.base;
+	mem_size = meson_fb.fb_size;
+	ret = fdt_fixup_reserved_memory(blob, "display_reserved", &mem_start, &mem_size);
 	if (ret) {
 		eprintf("Cannot setup simplefb: Error reserving memory\n");
 		return;