video: rockchip: fb: add dataspace for hdr
authorHuang Jiachai <hjc@rock-chips.com>
Thu, 20 Oct 2016 08:23:05 +0000 (16:23 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Fri, 9 Dec 2016 10:54:14 +0000 (18:54 +0800)
Change-Id: I65fb95a550d6afecf6b45f65afbd24047e8d5097
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
drivers/video/rockchip/rk_fb.c
include/linux/rk_fb.h
include/linux/rk_screen.h

index 25563a4..29cb535 100644 (file)
@@ -1693,6 +1693,8 @@ static void rk_fb_update_win(struct rk_lcdc_driver *dev_drv,
                        if (reg_win_data->reg_area_data[i].smem_start > 0) {
                                win->area[i].format =
                                        reg_win_data->reg_area_data[i].data_format;
+                               win->area[i].data_space =
+                                       reg_win_data->reg_area_data[i].data_space;
                                win->area[i].ion_hdl =
                                        reg_win_data->reg_area_data[i].ion_handle;
                                win->area[i].smem_start =
@@ -2336,6 +2338,8 @@ static int rk_fb_set_win_buffer(struct fb_info *info,
                data_format &= ~CSC_MASK;
                fb_data_fmt = rk_fb_data_fmt(data_format, 0);
                reg_win_data->reg_area_data[i].data_format = fb_data_fmt;
+               reg_win_data->reg_area_data[i].data_space =
+                                       win_par->area_par[i].data_space;
                if (IS_FBDC_FMT(fb_data_fmt)) {
                        reg_win_data->reg_area_data[i].fbdc_en = 1;
                        reg_win_data->reg_area_data[i].fbdc_cor_en = 1;
index d7634a8..abab70e 100755 (executable)
@@ -118,6 +118,11 @@ enum {
 #define BT709(x)       ((CSC_BT709 << CSC_SHIFT) | ((x) & ~CSC_MASK))
 #define BT2020(x)      ((CSC_BT2020 << CSC_SHIFT) | ((x) & ~CSC_MASK))
 
+enum {
+       SDR_DATA,
+       HDR_DATA,
+};
+
 /**
  * pixel format definitions,this is copy from android/system/core/include/system/graphics.h
  */
@@ -397,6 +402,7 @@ struct rk_lcdc_bcsh {
 struct rk_lcdc_win_area {
        bool state;
        enum data_format format;
+       u8 data_space;          /* SDR or HDR */
        u8 fmt_cfg;
        u8 yuyv_fmt;
        u8 swap_rb;
@@ -582,8 +588,8 @@ struct rk_fb_area_par {
        u8  fbdc_en;
        u8  fbdc_cor_en;
        u8  fbdc_data_format;
-       u16 reserved0;
-       u32 reserved1;
+       u16 data_space; /* SDR or HDR */
+       u32 reserved0;
 };
 
 
@@ -618,6 +624,7 @@ struct rk_fb_reg_wb_data {
 struct rk_fb_reg_area_data {
        struct sync_fence *acq_fence;
        u8 data_format;        /*layer data fmt*/
+       u8 data_space;          /* indicate SDR or HDR */
        u8  index_buf;          /*judge if the buffer is index*/
        u32 y_offset;           /*yuv/rgb offset  -->LCDC_WINx_YRGB_MSTx*/
        u32 c_offset;           /*cb cr offset--->LCDC_WINx_CBR_MSTx*/
@@ -694,6 +701,7 @@ struct rk_lcdc_driver {
        u16 rotate_mode;
        u16 cabc_mode;
        u16 overlay_mode;
+       u16 pre_overlay;
        u16 output_color;
 
        u16  fb_win_map;
index 5e5cd30..67e75c2 100644 (file)
@@ -66,6 +66,7 @@ struct rk_screen {
        u16 lvds_format;
        u16 face;
        u16 color_mode;
+       u8 data_space;
        u8 lcdc_id;
        u8 screen_id;
        struct fb_videomode mode;