osd: add osd TM2 support [1/1]
authorJian Cao <jian.cao@amlogic.com>
Sat, 30 Mar 2019 11:25:18 +0000 (19:25 +0800)
committerJianxiong Pan <jianxiong.pan@amlogic.com>
Thu, 11 Apr 2019 03:12:02 +0000 (11:12 +0800)
PD#SWPL-6558

Problem:
bring up osd for TM2

Solution:
osd: add osd TM2 support

Verify:
Verfied on TM2 skt board

Change-Id: I2183bd1f60793baf947c303b6d456e8c69d104ac
Signed-off-by: Jian Cao <jian.cao@amlogic.com>
13 files changed:
arch/arm/boot/dts/amlogic/mesontm2.dtsi
arch/arm/boot/dts/amlogic/tm2_pxp.dts
arch/arm/boot/dts/amlogic/tm2_t962e2_ab311.dts
arch/arm/boot/dts/amlogic/tm2_t962e2_ab319.dts
arch/arm/boot/dts/amlogic/tm2_t962x3_ab309.dts
arch/arm64/boot/dts/amlogic/mesontm2.dtsi
arch/arm64/boot/dts/amlogic/tm2_pxp.dts
arch/arm64/boot/dts/amlogic/tm2_t962e2_ab311.dts
arch/arm64/boot/dts/amlogic/tm2_t962e2_ab319.dts
arch/arm64/boot/dts/amlogic/tm2_t962x3_ab309.dts
drivers/amlogic/media/osd/osd.h
drivers/amlogic/media/osd/osd_fb.c
drivers/amlogic/media/osd/osd_hw.c

index b49cfbe..7de85f0 100644 (file)
        };
 
        meson_fb: fb {
-               compatible = "amlogic, meson-tl1";
+               compatible = "amlogic, meson-tm2";
                memory-region = <&logo_reserved>;
                status = "disabled";
                interrupts = <0 3 1
index 8ffbf10..fe88d70 100644 (file)
                        /*alloc-ranges = <0x30000000 0x50000000>;*/
                };
 
-               /* codec shared reserved */
-               codec_mm_reserved:linux,codec_mm_reserved {
-                       compatible = "amlogic, codec-mm-reserved";
-                       size = <0x0>;
-                       alignment = <0x100000>;
-                       //no-map;
-               };
-
                logo_reserved:linux,meson-fb {
                        compatible = "shared-dma-pool";
                        reusable;
                        alloc-ranges = <0x7f800000 0x800000>;
                };
 
+               /* codec shared reserved */
+               codec_mm_reserved:linux,codec_mm_reserved {
+                       compatible = "amlogic, codec-mm-reserved";
+                       size = <0x0>;
+                       alignment = <0x100000>;
+                       //no-map;
+               };
+
                ion_cma_reserved:linux,ion-dev {
                        compatible = "shared-dma-pool";
                        reusable;
 &meson_fb {
        status = "okay";
        display_size_default = <1920 1080 1920 2160 32>;
-       mem_size = <0x00800000 0x1980000 0x100000 0x800000>;
+       mem_size = <0x00800000 0x1980000 0x100000 0x100000 0x800000>;
        logo_addr = "0x7f800000";
        mem_alloc = <1>;
        pxp_mode = <1>; /** 0:normal mode 1:pxp mode */
index 3d7c79d..ec8f5fb 100644 (file)
 &meson_fb {
        status = "okay";
        display_size_default = <1920 1080 1920 2160 32>;
-       mem_size = <0x00800000 0x1980000 0x100000 0x800000>;
+       mem_size = <0x00800000 0x1980000 0x100000 0x100000 0x800000>;
        logo_addr = "0x7f800000";
        mem_alloc = <0>;
        pxp_mode = <0>; /** 0:normal mode 1:pxp mode */
index 6646cee..8dc663d 100644 (file)
 &meson_fb {
        status = "okay";
        display_size_default = <1920 1080 1920 2160 32>;
-       mem_size = <0x00800000 0x1980000 0x100000 0x800000>;
+       mem_size = <0x00800000 0x1980000 0x100000 0x100000 0x800000>;
        logo_addr = "0x7f800000";
        mem_alloc = <0>;
        pxp_mode = <0>; /** 0:normal mode 1:pxp mode */
index aece557..b764d9e 100644 (file)
 &meson_fb {
        status = "okay";
        display_size_default = <1920 1080 1920 2160 32>;
-       mem_size = <0x00800000 0x1980000 0x100000 0x800000>;
+       mem_size = <0x00800000 0x1980000 0x100000 0x100000 0x800000>;
        logo_addr = "0x7f800000";
        mem_alloc = <0>;
        pxp_mode = <0>; /** 0:normal mode 1:pxp mode */
index c5c1d28..8a5300d 100644 (file)
        };
 
        meson_fb: fb {
-               compatible = "amlogic, meson-tl1";
+               compatible = "amlogic, meson-tm2";
                memory-region = <&logo_reserved>;
                status = "disabled";
                interrupts = <0 3 1
index 233ef24..0b22d1e 100644 (file)
                        alloc-ranges = <0x0 0x05000000 0x0 0x400000>;
                };
 
+               logo_reserved:linux,meson-fb {
+                       compatible = "shared-dma-pool";
+                       reusable;
+                       size = <0x0 0x800000>;
+                       alignment = <0x0 0x400000>;
+                       alloc-ranges = <0x0 0x7f800000 0x0 0x800000>;
+               };
+
                codec_mm_cma:linux,codec_mm_cma {
                        compatible = "shared-dma-pool";
                        reusable;
                        //no-map;
                };
 
-               logo_reserved:linux,meson-fb {
-                       compatible = "shared-dma-pool";
-                       reusable;
-                       size = <0x0 0x800000>;
-                       alignment = <0x0 0x400000>;
-                       alloc-ranges = <0x0 0x7f800000 0x0 0x800000>;
-               };
-
                ion_cma_reserved:linux,ion-dev {
                        compatible = "shared-dma-pool";
                        reusable;
 &meson_fb {
        status = "okay";
        display_size_default = <1920 1080 1920 2160 32>;
-       mem_size = <0x00800000 0x1980000 0x100000 0x800000>;
+       mem_size = <0x00800000 0x1980000 0x100000 0x100000 0x800000>;
        logo_addr = "0x7f800000";
        mem_alloc = <1>;
        pxp_mode = <1>; /** 0:normal mode 1:pxp mode */
index 6c68b86..f538435 100644 (file)
 &meson_fb {
        status = "okay";
        display_size_default = <1920 1080 1920 2160 32>;
-       mem_size = <0x00800000 0x1980000 0x100000 0x800000>;
+       mem_size = <0x00800000 0x1980000 0x100000 0x100000 0x800000>;
        logo_addr = "0x7f800000";
        mem_alloc = <0>;
        pxp_mode = <0>; /** 0:normal mode 1:pxp mode */
index 26ef579..4f37ef6 100644 (file)
 &meson_fb {
        status = "okay";
        display_size_default = <1920 1080 1920 2160 32>;
-       mem_size = <0x00800000 0x1980000 0x100000 0x800000>;
+       mem_size = <0x00800000 0x1980000 0x100000 0x100000 0x800000>;
        logo_addr = "0x7f800000";
        mem_alloc = <0>;
        pxp_mode = <0>; /** 0:normal mode 1:pxp mode */
index d4bcc4d..50e8433 100644 (file)
 &meson_fb {
        status = "okay";
        display_size_default = <1920 1080 1920 2160 32>;
-       mem_size = <0x00800000 0x1980000 0x100000 0x800000>;
+       mem_size = <0x00800000 0x1980000 0x100000 0x100000 0x800000>;
        logo_addr = "0x7f800000";
        mem_alloc = <0>;
        pxp_mode = <0>; /** 0:normal mode 1:pxp mode */
index ae45075..404c53a 100644 (file)
@@ -279,6 +279,7 @@ enum cpuid_type_e {
        __MESON_CPU_MAJOR_ID_G12B,
        __MESON_CPU_MAJOR_ID_TL1,
        __MESON_CPU_MAJOR_ID_SM1,
+       __MESON_CPU_MAJOR_ID_TM2,
        __MESON_CPU_MAJOR_ID_UNKNOWN,
 };
 
index c13fabe..4b6c078 100644 (file)
@@ -3878,6 +3878,21 @@ static struct osd_device_data_s osd_tl1 = {
        .has_viu2 = 1,
 };
 
+static struct osd_device_data_s osd_tm2 = {
+       .cpu_id = __MESON_CPU_MAJOR_ID_TM2,
+       .osd_ver = OSD_HIGH_ONE,
+       .afbc_type = MALI_AFBC,
+       .osd_count = 4,
+       .has_deband = 1,
+       .has_lut = 1,
+       .has_rdma = 1,
+       .has_dolby_vision = 0,
+       .osd_fifo_len = 64, /* fifo len 64*8 = 512 */
+       .vpp_fifo_len = 0xfff,/* 2048 */
+       .dummy_data = 0x00808000,
+       .has_viu2 = 1,
+};
+
 static struct osd_device_data_s osd_sm1 = {
        .cpu_id = __MESON_CPU_MAJOR_ID_SM1,
        .osd_ver = OSD_HIGH_ONE,
@@ -3943,6 +3958,10 @@ static const struct of_device_id meson_fb_dt_match[] = {
                .compatible = "amlogic, meson-sm1",
                .data = &osd_sm1,
        },
+       {
+               .compatible = "amlogic, meson-tm2",
+               .data = &osd_tm2,
+       },
        {},
 };
 
index cde532f..2feeee0 100644 (file)
@@ -1964,6 +1964,7 @@ static u32 osd_get_hw_reset_flag(void)
        case __MESON_CPU_MAJOR_ID_G12B:
        case __MESON_CPU_MAJOR_ID_TL1:
        case __MESON_CPU_MAJOR_ID_SM1:
+       case __MESON_CPU_MAJOR_ID_TM2:
                {
                int i, afbc_enable = 0;
 
@@ -5456,8 +5457,7 @@ static void osd_update_disp_osd_rotate(u32 index)
        const struct vinfo_s *vinfo = NULL;
        int out_y_crop_start, out_y_crop_end;
 
-       if (osd_hw.osd_meson_dev.cpu_id < __MESON_CPU_MAJOR_ID_G12B ||
-               osd_hw.osd_meson_dev.cpu_id == __MESON_CPU_MAJOR_ID_SM1)
+       if (osd_hw.osd_meson_dev.cpu_id != __MESON_CPU_MAJOR_ID_G12B)
                return;
        src_fmt = get_viu2_src_format();
        src_data.x = 0;