From 1cefe0404b55db96fd47c552f038d56f1adca124 Mon Sep 17 00:00:00 2001 From: hjc Date: Mon, 9 Mar 2015 15:44:14 +0800 Subject: [PATCH] rk3368 lcdc: add fbdc data format: HAL_PIXEL_FORMAT_FBDC_RGBA888 --- drivers/video/rockchip/lcdc/rk3368_lcdc.c | 6 ++++++ drivers/video/rockchip/rk_fb.c | 7 +++++++ include/linux/rk_fb.h | 2 ++ 3 files changed, 15 insertions(+) mode change 100644 => 100755 include/linux/rk_fb.h diff --git a/drivers/video/rockchip/lcdc/rk3368_lcdc.c b/drivers/video/rockchip/lcdc/rk3368_lcdc.c index de7173e54587..0766541fc9c6 100755 --- a/drivers/video/rockchip/lcdc/rk3368_lcdc.c +++ b/drivers/video/rockchip/lcdc/rk3368_lcdc.c @@ -2705,6 +2705,12 @@ static int win_0_1_set_par(struct lcdc_device *lcdc_dev, win->fmt_10 = 0; win->area[0].fbdc_fmt_cfg = 0x0c; break; + case FBDC_ABGR_888: + fmt_cfg = 0; + swap_rb = 1; + win->fmt_10 = 0; + win->area[0].fbdc_fmt_cfg = 0x0c; + break; case FBDC_RGBX_888: fmt_cfg = 0; swap_rb = 0; diff --git a/drivers/video/rockchip/rk_fb.c b/drivers/video/rockchip/rk_fb.c index 1384b32299d6..9492ebec7650 100755 --- a/drivers/video/rockchip/rk_fb.c +++ b/drivers/video/rockchip/rk_fb.c @@ -149,6 +149,7 @@ int rk_fb_pixel_width(int data_format) case ABGR888: case ARGB888: case FBDC_ARGB_888: + case FBDC_ABGR_888: case FBDC_RGBX_888: pixel_width = 4 * 8; break; @@ -225,6 +226,9 @@ static int rk_fb_data_fmt(int data_format, int bits_per_pixel) case HAL_PIXEL_FORMAT_FBDC_U8U8U8U8: /* fbdc argb888 */ fb_data_fmt = FBDC_ARGB_888; break; + case HAL_PIXEL_FORMAT_FBDC_RGBA888: /* fbdc abgr888 */ + fb_data_fmt = FBDC_ABGR_888; + break; case HAL_PIXEL_FORMAT_FBDC_U8U8U8: /* fbdc rgb888 */ fb_data_fmt = FBDC_RGBX_888; break; @@ -551,6 +555,7 @@ char *get_format_string(enum data_format format, char *fmt) strcpy(fmt, "FBDC_RGB_565"); break; case FBDC_ARGB_888: + case FBDC_ABGR_888: strcpy(fmt, "FBDC_ARGB_888"); break; case FBDC_RGBX_888: @@ -1934,6 +1939,7 @@ static int rk_fb_set_win_buffer(struct fb_info *info, ppixel_a |= ((fb_data_fmt == ARGB888) || (fb_data_fmt == FBDC_ARGB_888) || + (fb_data_fmt == FBDC_ABGR_888) || (fb_data_fmt == ABGR888)) ? 1 : 0; /* visiable pos in panel */ reg_win_data->reg_area_data[i].xpos = win_par->area_par[i].xpos; @@ -2885,6 +2891,7 @@ static int rk_fb_set_par(struct fb_info *info) win->alpha_mode = 4; /* AB_SRC_OVER; */ win->alpha_en = ((win->area[0].format == ARGB888) || (win->area[0].format == FBDC_ARGB_888) || + (win->area[0].format == FBDC_ABGR_888) || (win->area[0].format == ABGR888)) ? 1 : 0; win->g_alpha_val = 0; diff --git a/include/linux/rk_fb.h b/include/linux/rk_fb.h old mode 100644 new mode 100755 index c0bd7f19f21c..6f3347b7fae5 --- a/include/linux/rk_fb.h +++ b/include/linux/rk_fb.h @@ -199,6 +199,7 @@ enum { HAL_PIXEL_FORMAT_FBDC_RGB565 = 0x26, HAL_PIXEL_FORMAT_FBDC_U8U8U8U8 = 0x27, /*ARGB888*/ HAL_PIXEL_FORMAT_FBDC_U8U8U8 = 0x28, /*RGBP888*/ + HAL_PIXEL_FORMAT_FBDC_RGBA888 = 0x29, /*ABGR888*/ }; //display data format @@ -219,6 +220,7 @@ enum data_format { FBDC_RGB_565 = 0x26, FBDC_ARGB_888, FBDC_RGBX_888, + FBDC_ABGR_888, }; enum -- 2.34.1