osd_drm: osd drm for g12b bring up
authorpengcheng chen <pengcheng.chen@amlogic.com>
Mon, 28 May 2018 12:25:50 +0000 (20:25 +0800)
committerYixun Lan <yixun.lan@amlogic.com>
Fri, 29 Jun 2018 07:06:09 +0000 (00:06 -0700)
PD#165090: osd drm for g12b bring up

Change-Id: Id69a152b22ba3e408d20fa494b9475c9ad3797de
Signed-off-by: pengcheng chen <pengcheng.chen@amlogic.com>
Documentation/devicetree/bindings/display/amlogic,meson-vpu.txt
drivers/amlogic/drm/am_meson_vpu.c
drivers/amlogic/media/osd/osd_hw.c

index 900443fa87114f602123c94966fe8e8181e19bb1..38cb0bb877a9332e2ee28e1cd2a3f13df7b1876e 100644 (file)
@@ -60,6 +60,7 @@ Required properties:
        - TXLX (T962X, T962E) : "amlogic,meson-txlx-vpu"
        - AXG (A113G, A113D) : "amlogic,meson-axg-vpu"
        - G12A (S905D2) : "amlogic,meson-g12a-vpu"
+       - G12B (W400) : "amlogic,meson-g12b-vpu"
        followed by the common "amlogic,meson-gx-vpu"
 - reg: base address and size of he following memory-mapped regions :
        - vpu
index 41244d01e9e882f356cf9fbf842be05a1f0437ea..3e5c3238794874a4649030781377906bbc46d23e 100644 (file)
@@ -216,6 +216,21 @@ static struct osd_device_data_s osd_g12a = {
        .has_viu2 = 1,
 };
 
+static struct osd_device_data_s osd_g12b = {
+       .cpu_id = __MESON_CPU_MAJOR_ID_G12B,
+       .osd_ver = OSD_HIGH_ONE,
+       .afbc_type = MALI_AFBC,
+       .osd_count = 3,
+       .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_meson_dev;
 static u32 logo_memsize;
 static struct page *logo_page;
@@ -803,6 +818,8 @@ static const struct of_device_id am_meson_vpu_driver_dt_match[] = {
         .data = &osd_axg, },
        { .compatible = "amlogic,meson-g12a-vpu",
         .data = &osd_g12a, },
+       { .compatible = "amlogic,meson-g12b-vpu",
+       .data = &osd_g12b, },
        {},
 };
 MODULE_DEVICE_TABLE(of, am_meson_vpu_driver_dt_match);
index edbeaaeb7f03c3a3c6fbad23ff3bd71ae28dc966..f979fe23bb887071d7bb5fb4202ae5fb3ce6947a 100644 (file)
@@ -7800,7 +7800,6 @@ static bool osd_direct_render(struct osd_plane_map_s *plane_map)
                        osd_hw.osd_afbcd[index].enable);
                osd_log_dbg2("osd_afbcd_inter_format=%d\n",
                        osd_hw.osd_afbcd[index].inter_format);
-
                return 0;
        }
 
@@ -7815,6 +7814,11 @@ static bool osd_direct_render(struct osd_plane_map_s *plane_map)
                osd_hw.free_src_data_backup[index].y_start + 1;
        osd_hw.free_scale_enable[index] = 1;
 
+       osd_hw.src_data[index].x = plane_map->src_x;
+       osd_hw.src_data[index].y = plane_map->src_y;
+       osd_hw.src_data[index].w = plane_map->src_w;
+       osd_hw.src_data[index].h = plane_map->src_h;
+
        if (osd_hw.free_scale_enable[index] ||
                (width_src != width_dst) ||
                (height_src != height_dst) ||
@@ -7894,6 +7898,16 @@ static bool osd_direct_render(struct osd_plane_map_s *plane_map)
                                &freescale_dst[index],
                                sizeof(struct pandata_s));
                        freescale_update = true;
+                       osd_hw.dst_data[index].x =
+                               osd_hw.free_dst_data[index].x_start;
+                       osd_hw.dst_data[index].y =
+                               osd_hw.free_dst_data[index].x_start;
+                       osd_hw.dst_data[index].w =
+                               osd_hw.free_dst_data[index].x_end -
+                               osd_hw.free_dst_data[index].x_start + 1;
+                       osd_hw.dst_data[index].h =
+                               osd_hw.free_dst_data[index].y_end -
+                               osd_hw.free_dst_data[index].y_start + 1;
 
                        if ((height_dst != height_src) ||
                                (width_dst != width_src))
@@ -7957,6 +7971,17 @@ static bool osd_direct_render(struct osd_plane_map_s *plane_map)
                        osd_hw.dispdata[index].y_start = y_start;
                        osd_hw.dispdata[index].y_end = y_end;
                }
+               osd_hw.dst_data[index].x =
+                       osd_hw.dispdata[index].x_start;
+               osd_hw.dst_data[index].y =
+                       osd_hw.dispdata[index].x_start;
+               osd_hw.dst_data[index].w =
+                       osd_hw.dispdata[index].x_end -
+                       osd_hw.dispdata[index].x_start + 1;
+               osd_hw.dst_data[index].h =
+                       osd_hw.dispdata[index].y_end -
+                       osd_hw.dispdata[index].y_start + 1;
+
        }
        return freescale_update;
 }