osd: add osd TM2 support [1/1]
authorJian Cao <jian.cao@amlogic.com>
Sat, 30 Mar 2019 11:25:18 +0000 (19:25 +0800)
committerNick Xie <nick@khadas.com>
Mon, 5 Aug 2019 06:36:59 +0000 (14:36 +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>
Signed-off-by: Luan Yuan <luan.yuan@amlogic.com>
drivers/amlogic/media/osd/osd.h
drivers/amlogic/media/osd/osd_fb.c
drivers/amlogic/media/osd/osd_hw.c

index cc2e8fb..2884b1f 100644 (file)
@@ -278,6 +278,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 356e3a3..71a881e 100644 (file)
@@ -4084,6 +4084,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 297e504..c271c42 100644 (file)
@@ -1680,6 +1680,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;
 
@@ -5052,8 +5053,7 @@ static void osd_update_disp_osd_rotate(u32 index)
        const struct vinfo_s *vinfo;
        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;