osd: create logo_reserved node in dts in Android O
authorPengcheng Chen <pengcheng.chen@amlogic.com>
Tue, 12 Sep 2017 09:08:06 +0000 (17:08 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Fri, 15 Sep 2017 07:23:40 +0000 (00:23 -0700)
PD#150868: create logo_reserved node in dts in Android O

Change-Id: I4057aef2e40504920a9d3b086d31d96aa23bb52f
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
14 files changed:
arch/arm64/boot/dts/amlogic/gxl_p212_1g.dts
arch/arm64/boot/dts/amlogic/gxl_p212_1g_buildroot.dts
arch/arm64/boot/dts/amlogic/gxl_p212_2g.dts
arch/arm64/boot/dts/amlogic/gxl_p212_2g_buildroot.dts
arch/arm64/boot/dts/amlogic/gxl_p230_2g.dts
arch/arm64/boot/dts/amlogic/gxl_p231_1g.dts
arch/arm64/boot/dts/amlogic/gxl_p231_2g.dts
arch/arm64/boot/dts/amlogic/gxl_p231_2g_buildroot.dts
arch/arm64/boot/dts/amlogic/gxl_p400_2g.dts
arch/arm64/boot/dts/amlogic/gxl_p401_2g.dts
arch/arm64/boot/dts/amlogic/gxl_skt.dts
arch/arm64/boot/dts/amlogic/gxm_q200_2g.dts
arch/arm64/boot/dts/amlogic/gxm_skt.dts
drivers/amlogic/media/osd/osd_fb.c

index 0a5b9c4..51bb5ac 100644 (file)
                        size = <0x0 0x2000000>;
                        alignment = <0x0 0x400000>;
                };
-
+               logo_reserved:linux,meson-fb {
+                       compatible = "shared-dma-pool";
+                       reusable;
+                       size = <0x0 0x800000>;
+                       alignment = <0x0 0x400000>;
+                       alloc-ranges = <0x0 0x3f800000 0x0 0x800000>;
+               };
                ion_reserved:linux,ion-dev {
                        compatible = "shared-dma-pool";
                        reusable;
 
        meson-fb {
                compatible = "amlogic, meson-fb";
+               memory-region = <&logo_reserved>;
                dev_name = "meson-fb";
                status = "okay";
                interrupts = <0 3 1
                        0 89 1>;
                interrupt-names = "viu-vsync", "rdma";
-               mem_size = <0x006AF000 0x01851000 0x00100000>;
-               /* uboot logo,fb0/fb1 memory size */
+               mem_size = <0x00800000 0x01800000 0x00100000>;
+               /* uboot logo,fb0/fb1 memory size,if afbcd fb0=0x01851000*/
                display_mode_default = "1080p60hz";
                scale_mode = <1>;
                /** 0:VPU free scale 1:OSD free scale 2:OSD super scale */
                display_size_default = <1920 1080 1920 3240 32>;
                /*1920*1080*4*3 = 0x17BB000*/
-               logo_addr = "0x3e000000";
+               logo_addr = "0x3f800000";
        };
        ge2d {
                compatible = "amlogic, ge2d";
index 3b10d17..74af147 100644 (file)
                serial4 = &uart_AO_B;
        };
 
-       ion_dev {
-               compatible = "amlogic, ion_dev";
-               memory-region = <&ion_reserved>;
-       };
-
        memory@00000000 {
                device_type = "memory";
                linux,usable-memory = <0x0 0x0100000 0x0 0x3ff00000>;
                        size = <0x0 0x2000000>;
                        alignment = <0x0 0x400000>;
                };
-
-               ion_reserved:linux,ion-dev {
+               fb_reserved:linux,meson-fb {
                        compatible = "shared-dma-pool";
                        reusable;
-                       size = <0x0 0x7000000>;
+                       size = <0x0 0x2400000>;
                        alignment = <0x0 0x400000>;
+                       alloc-ranges = <0x0 0x3dc00000 0x0 0x2400000>;
                };
-
                /*  vdin0 CMA pool */
                //vdin0_cma_reserved:linux,vdin0_cma {
                //      compatible = "shared-dma-pool";
 
        meson-fb {
                compatible = "amlogic, meson-fb";
+               memory-region = <&fb_reserved>;
                dev_name = "meson-fb";
                status = "okay";
                interrupts = <0 3 1
                        0 89 1>;
                interrupt-names = "viu-vsync", "rdma";
-               mem_size = <0x006AF000 0x01851000 0x00100000>;
-               /* uboot logo,fb0/fb1 memory size */
+               mem_size = <0x00800000 0x1800000 0x00100000>;
+               /* uboot logo,fb0/fb1 memory size,if afbcd fb0=0x01851000 */
                display_mode_default = "1080p60hz";
                scale_mode = <1>;
                /** 0:VPU free scale 1:OSD free scale 2:OSD super scale */
                display_size_default = <1920 1080 1920 3240 32>;
                /*1920*1080*4*3 = 0x17BB000*/
-               logo_addr = "0x3e000000";
+               logo_addr = "0x3dc00000";
        };
        ge2d {
                compatible = "amlogic, ge2d";
index c1a37de..db22f4f 100644 (file)
                        size = <0x0 0x2000000>;
                        alignment = <0x0 0x400000>;
                };
-
+               logo_reserved:linux,meson-fb {
+                       compatible = "shared-dma-pool";
+                       reusable;
+                       size = <0x0 0x800000>;
+                       alignment = <0x0 0x400000>;
+                       alloc-ranges = <0x0 0x7f800000 0x0 0x800000>;
+               };
                ion_reserved:linux,ion-dev {
                        compatible = "shared-dma-pool";
                        reusable;
 
        meson-fb {
                compatible = "amlogic, meson-fb";
+               memory-region = <&logo_reserved>;
                dev_name = "meson-fb";
                status = "okay";
                interrupts = <0 3 1
                        0 89 1>;
                interrupt-names = "viu-vsync", "rdma";
-               mem_size = <0x006AF000 0x01851000 0x00100000>;
-               /* uboot logo,fb0/fb1 memory size */
+               mem_size = <0x00800000 0x01800000 0x00100000>;
+               /* uboot logo,fb0/fb1 memory size,if afbcd fb0=0x01851000*/
                display_mode_default = "1080p60hz";
                scale_mode = <1>;
                /** 0:VPU free scale 1:OSD free scale 2:OSD super scale */
                display_size_default = <1920 1080 1920 3240 32>;
                /*1920*1080*4*3 = 0x17BB000*/
-               logo_addr = "0x7e000000";
+               logo_addr = "0x7f800000";
        };
        ge2d {
                compatible = "amlogic, ge2d";
index a08b230..47b0f7c 100644 (file)
                serial4 = &uart_AO_B;
        };
 
-       ion_dev {
-               compatible = "amlogic, ion_dev";
-               memory-region = <&ion_reserved>;
-       };
-
        memory@00000000 {
                device_type = "memory";
                linux,usable-memory = <0x0 0x0100000 0x0 0x7ff00000>;
                        size = <0x0 0x2000000>;
                        alignment = <0x0 0x400000>;
                };
-
-               ion_reserved:linux,ion-dev {
+               fb_reserved:linux,meson-fb {
                        compatible = "shared-dma-pool";
                        reusable;
-                       size = <0x0 0x7000000>;
+                       size = <0x0 0x2400000>;
                        alignment = <0x0 0x400000>;
+                       alloc-ranges = <0x0 0x7dc00000 0x0 0x2400000>;
                };
 
                /*  vdin0 CMA pool */
 
        meson-fb {
                compatible = "amlogic, meson-fb";
+               memory-region = <&fb_reserved>;
                dev_name = "meson-fb";
                status = "okay";
                interrupts = <0 3 1
                        0 89 1>;
                interrupt-names = "viu-vsync", "rdma";
-               mem_size = <0x006AF000 0x01851000 0x00100000>;
-               /* uboot logo,fb0/fb1 memory size */
+               mem_size = <0x00800000 0x1800000 0x00100000>;
+               /* uboot logo,fb0/fb1 memory size,if afbcd fb0=0x01851000 */
                display_mode_default = "1080p60hz";
                scale_mode = <1>;
                /** 0:VPU free scale 1:OSD free scale 2:OSD super scale */
                display_size_default = <1920 1080 1920 3240 32>;
                /*1920*1080*4*3 = 0x17BB000*/
-               logo_addr = "0x7e000000";
+               logo_addr = "0x7dc00000";
        };
        ge2d {
                compatible = "amlogic, ge2d";
index 93ee8c8..f87e3b8 100644 (file)
                        size = <0x0 0x2000000>;
                        alignment = <0x0 0x400000>;
                };
-
+               logo_reserved:linux,meson-fb {
+                       compatible = "shared-dma-pool";
+                       reusable;
+                       size = <0x0 0x800000>;
+                       alignment = <0x0 0x400000>;
+                       alloc-ranges = <0x0 0x7f800000 0x0 0x800000>;
+               };
                ion_reserved:linux,ion-dev {
                        compatible = "shared-dma-pool";
                        reusable;
 
        meson-fb {
                compatible = "amlogic, meson-fb";
+               memory-region = <&logo_reserved>;
                dev_name = "meson-fb";
                status = "okay";
                interrupts = <0 3 1
                        0 89 1>;
                interrupt-names = "viu-vsync", "rdma";
-               mem_size = <0x006AF000 0x01851000 0x00100000>;
-               /* uboot logo,fb0/fb1 memory size */
+               mem_size = <0x00800000 0x01800000 0x00100000>;
+               /* uboot logo,fb0/fb1 memory size,if afbcd fb0=0x01851000*/
                display_mode_default = "1080p60hz";
                scale_mode = <1>;
                /** 0:VPU free scale 1:OSD free scale 2:OSD super scale */
                display_size_default = <1920 1080 1920 3240 32>;
                /*1920*1080*4*3 = 0x17BB000*/
-               logo_addr = "0x7e000000";
+               logo_addr = "0x7f800000";
        };
        ge2d {
                compatible = "amlogic, ge2d";
index e6890c0..129451e 100644 (file)
                        size = <0x0 0x2000000>;
                        alignment = <0x0 0x400000>;
                };
-
+               logo_reserved:linux,meson-fb {
+                       compatible = "shared-dma-pool";
+                       reusable;
+                       size = <0x0 0x800000>;
+                       alignment = <0x0 0x400000>;
+                       alloc-ranges = <0x0 0x3f800000 0x0 0x800000>;
+               };
                ion_reserved:linux,ion-dev {
                        compatible = "shared-dma-pool";
                        reusable;
 
        meson-fb {
                compatible = "amlogic, meson-fb";
+               memory-region = <&logo_reserved>;
                dev_name = "meson-fb";
                status = "okay";
                interrupts = <0 3 1
                        0 89 1>;
                interrupt-names = "viu-vsync", "rdma";
-               mem_size = <0x006AF000 0x01851000 0x00100000>;
-               /* uboot logo,fb0/fb1 memory size */
+               mem_size = <0x00800000 0x01800000 0x00100000>;
+               /* uboot logo,fb0/fb1 memory size,if afbcd fb0=0x01851000*/
                display_mode_default = "1080p60hz";
                scale_mode = <1>;
                /** 0:VPU free scale 1:OSD free scale 2:OSD super scale */
                display_size_default = <1920 1080 1920 3240 32>;
                /*1920*1080*4*3 = 0x17BB000*/
-               logo_addr = "0x3e000000";
+               logo_addr = "0x3f800000";
        };
        ge2d {
                compatible = "amlogic, ge2d";
index 23f6eab..467f627 100644 (file)
                        size = <0x0 0x2000000>;
                        alignment = <0x0 0x400000>;
                };
-
+               logo_reserved:linux,meson-fb {
+                       compatible = "shared-dma-pool";
+                       reusable;
+                       size = <0x0 0x800000>;
+                       alignment = <0x0 0x400000>;
+                       alloc-ranges = <0x0 0x7f800000 0x0 0x800000>;
+               };
                ion_reserved:linux,ion-dev {
                        compatible = "shared-dma-pool";
                        reusable;
 
        meson-fb {
                compatible = "amlogic, meson-fb";
+               memory-region = <&logo_reserved>;
                dev_name = "meson-fb";
                status = "okay";
                interrupts = <0 3 1
                        0 89 1>;
                interrupt-names = "viu-vsync", "rdma";
-               mem_size = <0x006AF000 0x01851000 0x00100000>;
-               /* uboot logo,fb0/fb1 memory size */
+               mem_size = <0x00800000 0x01800000 0x00100000>;
+               /* uboot logo,fb0/fb1 memory size,if afbcd fb0=0x01851000*/
                display_mode_default = "1080p60hz";
                scale_mode = <1>;
                /** 0:VPU free scale 1:OSD free scale 2:OSD super scale */
                display_size_default = <1920 1080 1920 3240 32>;
                /*1920*1080*4*3 = 0x17BB000*/
-               logo_addr = "0x7e000000";
+               logo_addr = "0x7f800000";
        };
        ge2d {
                compatible = "amlogic, ge2d";
index 3c42cf4..c28fded 100644 (file)
                serial4 = &uart_AO_B;
        };
 
-       ion_dev {
-               compatible = "amlogic, ion_dev";
-               memory-region = <&ion_reserved>;
-       };
-
        memory@00000000 {
                device_type = "memory";
                linux,usable-memory = <0x0 0x0100000 0x0 0x7ff00000>;
                        size = <0x0 0x2000000>;
                        alignment = <0x0 0x400000>;
                };
-
-               ion_reserved:linux,ion-dev {
+               fb_reserved:linux,meson-fb {
                        compatible = "shared-dma-pool";
                        reusable;
-                       size = <0x0 0x7000000>;
+                       size = <0x0 0x2400000>;
                        alignment = <0x0 0x400000>;
+                       alloc-ranges = <0x0 0x7dc00000 0x0 0x2400000>;
                };
 
                /*  vdin0 CMA pool */
 
        meson-fb {
                compatible = "amlogic, meson-fb";
+               memory-region = <&fb_reserved>;
                dev_name = "meson-fb";
                status = "okay";
                interrupts = <0 3 1
                        0 89 1>;
                interrupt-names = "viu-vsync", "rdma";
-               mem_size = <0x006AF000 0x01851000 0x00100000>;
-               /* uboot logo,fb0/fb1 memory size */
+               mem_size = <0x00800000 0x1800000 0x00100000>;
+               /* uboot logo,fb0/fb1 memory size,if afbcd fb0=0x01851000 */
                display_mode_default = "1080p60hz";
                scale_mode = <1>;
                /** 0:VPU free scale 1:OSD free scale 2:OSD super scale */
                display_size_default = <1920 1080 1920 3240 32>;
                /*1920*1080*4*3 = 0x17BB000*/
-               logo_addr = "0x7e000000";
+               logo_addr = "0x7dc00000";
        };
        ge2d {
                compatible = "amlogic, ge2d";
index b10719b..b051ab9 100644 (file)
@@ -62,9 +62,9 @@
                fb_reserved:linux,meson-fb {
                        compatible = "shared-dma-pool";
                        reusable;
-                       size = <0x0 0x2000000>;
+                       size = <0x0 0x2400000>;
                        alignment = <0x0 0x400000>;
-                       alloc-ranges = <0x0 0x7e000000 0x0 0x2000000>;
+                       alloc-ranges = <0x0 0x7dc00000 0x0 0x2400000>;
                };
 
 
                interrupts = <0 3 1
                        0 89 1>;
                interrupt-names = "viu-vsync", "rdma";
-               mem_size = <0x006AF000 0x01851000 0x00100000>;
-               /* uboot logo,fb0/fb1 memory size */
+               mem_size = <0x00800000 0x01800000 0x00100000>;
+               /* uboot logo,fb0/fb1 memory size,if afbcd fb0=0x01851000 */
                display_mode_default = "1080p60hz";
                scale_mode = <1>;
                /** 0:VPU free scale 1:OSD free scale 2:OSD super scale */
                display_size_default = <1920 1080 1920 3240 32>;
                /*1920*1080*4*3 = 0x17BB000*/
-               logo_addr = "0x7e000000";
+               logo_addr = "0x7dc00000";
        };
 
        ge2d {
index e3c539e..7ddaab4 100644 (file)
@@ -62,9 +62,9 @@
                fb_reserved:linux,meson-fb {
                        compatible = "shared-dma-pool";
                        reusable;
-                       size = <0x0 0x2000000>;
+                       size = <0x0 0x2400000>;
                        alignment = <0x0 0x400000>;
-                       alloc-ranges = <0x0 0x7e000000 0x0 0x2000000>;
+                       alloc-ranges = <0x0 0x7dc00000 0x0 0x2400000>;
                };
 
 
                interrupts = <0 3 1
                        0 89 1>;
                interrupt-names = "viu-vsync", "rdma";
-               mem_size = <0x006AF000 0x01851000 0x00100000>;
-               /* uboot logo,fb0/fb1 memory size */
+               mem_size = <0x00800000 0x01800000 0x00100000>;
+               /* uboot logo,fb0/fb1 memory size,if afbcd fb0=0x01851000 */
                display_mode_default = "1080p60hz";
                scale_mode = <1>;
                /** 0:VPU free scale 1:OSD free scale 2:OSD super scale */
                display_size_default = <1920 1080 1920 3240 32>;
                /*1920*1080*4*3 = 0x17BB000*/
-               logo_addr = "0x7e000000";
+               logo_addr = "0x7dc00000";
        };
 
        ge2d {
index 783c176..2b27258 100644 (file)
                        size = <0x0 0x2000000>;
                        alignment = <0x0 0x400000>;
                };
-
+               logo_reserved:linux,meson-fb {
+                       compatible = "shared-dma-pool";
+                       reusable;
+                       size = <0x0 0x800000>;
+                       alignment = <0x0 0x400000>;
+                       alloc-ranges = <0x0 0x3f800000 0x0 0x800000>;
+               };
                ion_reserved:linux,ion-dev {
                        compatible = "shared-dma-pool";
                        reusable;
 
        meson-fb {
                compatible = "amlogic, meson-fb";
+               memory-region = <&logo_reserved>;
                dev_name = "meson-fb";
                status = "okay";
                interrupts = <0 3 1
                        0 89 1>;
                interrupt-names = "viu-vsync", "rdma";
-               mem_size = <0x006AF000 0x01851000 0x00100000>;
+               mem_size = <0x00800000 0x01800000 0x00100000>;
+               /* uboot logo,fb0/fb1 memory size,if afbcd fb0=0x01851000*/
                display_mode_default = "1080p60hz";
                scale_mode = <1>;
                /** 0:VPU free scale 1:OSD free scale 2:OSD super scale */
                display_size_default = <1920 1080 1920 3240 32>;
                /*1920*1080*4*3 = 0x17BB000*/
-               logo_addr = "0x7e000000";
+               logo_addr = "0x3f800000";
        };
        ge2d {
                compatible = "amlogic, ge2d";
index 2239925..3b21f65 100644 (file)
                        size = <0x0 0x2000000>;
                        alignment = <0x0 0x400000>;
                };
-
+               logo_reserved:linux,meson-fb {
+                       compatible = "shared-dma-pool";
+                       reusable;
+                       size = <0x0 0x800000>;
+                       alignment = <0x0 0x400000>;
+                       alloc-ranges = <0x0 0x7f800000 0x0 0x800000>;
+               };
                ion_reserved:linux,ion-dev {
                        compatible = "shared-dma-pool";
                        reusable;
 
        meson-fb {
                compatible = "amlogic, meson-fb";
+               memory-region = <&logo_reserved>;
                dev_name = "meson-fb";
                status = "okay";
                interrupts = <0 3 1
                        0 89 1>;
                interrupt-names = "viu-vsync", "rdma";
-               mem_size = <0x006AF000 0x01851000 0x00100000>;
-               /* uboot logo,fb0/fb1 memory size */
+               mem_size = <0x00800000 0x01851000 0x00100000>;
+               /* uboot logo,fb0/fb1 memory size,if afbcd fb0=0x01851000*/
                display_mode_default = "1080p60hz";
                scale_mode = <1>;
                /** 0:VPU free scale 1:OSD free scale 2:OSD super scale */
                display_size_default = <1920 1080 1920 3240 32>;
                /*1920*1080*4*3 = 0x17BB000*/
-               logo_addr = "0x7e000000";
+               logo_addr = "0x7f800000";
        };
        ge2d {
                compatible = "amlogic, ge2d";
index fe756a5..3a43f5a 100644 (file)
                        size = <0x0 0x2000000>;
                        alignment = <0x0 0x400000>;
                };
-
+               logo_reserved:linux,meson-fb {
+                       compatible = "shared-dma-pool";
+                       reusable;
+                       size = <0x0 0x800000>;
+                       alignment = <0x0 0x400000>;
+                       alloc-ranges = <0x0 0x3f800000 0x0 0x800000>;
+               };
                ion_reserved:linux,ion-dev {
                        compatible = "shared-dma-pool";
                        reusable;
 
        meson-fb {
                compatible = "amlogic, meson-fb";
+               memory-region = <&logo_reserved>;
                dev_name = "meson-fb";
                status = "okay";
                interrupts = <0 3 1
                        0 89 1>;
                interrupt-names = "viu-vsync", "rdma";
-               mem_size = <0x006AF000 0x01851000 0x00100000>;
-               /* uboot logo,fb0/fb1 memory size */
+               mem_size = <0x00800000 0x01851000 0x00100000>;
+               /* uboot logo,fb0/fb1 memory size,if afbcd fb0=0x01851000*/
                display_mode_default = "1080p60hz";
                scale_mode = <1>;
                /** 0:VPU free scale 1:OSD free scale 2:OSD super scale */
                display_size_default = <1920 1080 1920 3240 32>;
                /*1920*1080*4*3 = 0x17BB000*/
-               logo_addr = "0x3e000000";
+               logo_addr = "0x3f800000";
        };
        ge2d {
                compatible = "amlogic, ge2d";
index f2cdc50..728bd90 100644 (file)
@@ -1112,8 +1112,9 @@ static int osd_mmap(struct fb_info *info, struct vm_area_struct *vma)
                var = &info->var;
                /* read cma/fb-reserved memory first */
                if ((b_reserved_mem == true) &&
-                       (fb_memsize[0] + fb_memsize[1] +
-                               fb_memsize[2]) <= size) {
+                       ((fb_memsize[0] + fb_memsize[1] +
+                       fb_memsize[2] <= size) &&
+                       (fb_memsize[fb_index + 1] > 0))) {
                        fb_rmem_size[fb_index] = fb_memsize[fb_index + 1];
                        if (fb_index == DEV_OSD0)
                                fb_rmem_paddr[fb_index] = base +
@@ -3051,7 +3052,7 @@ static int __init rmem_fb_setup(struct reserved_mem *rmem)
        fb_rmem.base = rmem->base;
        fb_rmem.size = rmem->size;
        rmem->ops = &rmem_fb_ops;
-       osd_log_dbg("Reserved memory: created fb at 0x%p, size %ld MiB\n",
+       osd_log_info("Reserved memory: created fb at 0x%p, size %ld MiB\n",
                     (void *)rmem->base, (unsigned long)rmem->size / SZ_1M);
        return 0;
 }