diff options
author | Dhaval Patel <pdhaval@codeaurora.org> | 2015-04-13 12:19:20 -0700 |
---|---|---|
committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:40:25 -0700 |
commit | 3e28d1359568bfd1e5f752f40d206da64208fd0e (patch) | |
tree | b14a862e6cae79e26aa28fe476e177415e5f06dd | |
parent | 6344ac8b7fdbb6bc8ba8fd07fde97faf4eb52e1d (diff) |
msm: mdss: add RGBX UBWC format support in mdss for msm8996
MDSS hardware on msm8996 target supports RGBX UBWC format
because it handles the RGBA and RGBX formats in same manner.
This change adds the RGBX UBWC format support with
compression ratio information.
Change-Id: I674d136496910e017d4c21d56b62def7eff0562e
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
-rw-r--r-- | drivers/video/fbdev/msm/mdss_mdp_formats.h | 35 | ||||
-rw-r--r-- | drivers/video/fbdev/msm/mdss_mdp_util.c | 9 | ||||
-rw-r--r-- | include/uapi/linux/msm_mdp.h | 1 |
3 files changed, 34 insertions, 11 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_formats.h b/drivers/video/fbdev/msm/mdss_mdp_formats.h index fc29b8afe90e..bbd577c91f03 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_formats.h +++ b/drivers/video/fbdev/msm/mdss_mdp_formats.h @@ -178,18 +178,32 @@ enum { * that the size of the factors tables are multiple of the ubwc_map * table and throw an error if a mismatch is found. */ -#define UBWC_TOTAL_FORMATS 3 +#define UBWC_TOTAL_FORMATS 4 static struct mdss_fudge_factor ubwc_rt_factors[][UBWC_TOTAL_FORMATS] = { - /* RGB_565_UBWC | RGBA_8888_UBWC | YUV_H2V2_UBWC */ - {{1, 1} , {126, 100} , {123, 100} } , /* 8996 v0 */ - {{1, 1} , {126, 100} , {123, 100} } , /* 8996 v1,v2 */ + /* 8996 v1*/ + {{1, 1} , /* RGB_565_UBWC */ + {126, 100} , /* RGBA_8888_UBWC */ + {126, 100} , /* RGBX_8888_UBWC */ + {123, 100} } , /* YUV_H2V2_UBWC */ + /* 8996 v2/v3 */ + {{1, 1} , /* RGB_565_UBWC */ + {126, 100} , /* RGBA_8888_UBWC */ + {126, 100} , /* RGBX_8888_UBWC */ + {123, 100} }, /* YUV_H2V2_UBWC */ }; static struct mdss_fudge_factor ubwc_nrt_factors[][UBWC_TOTAL_FORMATS] = { - /* RGB_565_UBWC | RGBA_8888_UBWC | YUV_H2V2_UBWC */ - {{1, 1} , {146, 100} , {1, 1} } , /* 8996 v0 */ - {{1, 1} , {146, 100} , {128, 100} } , /* 8996 v1,v2 */ + /* 8996 v1*/ + {{1, 1} , /* RGB_565_UBWC */ + {146, 100} , /* RGBA_8888_UBWC */ + {146, 100} , /* RGBX_8888_UBWC */ + {1, 1} } , /* YUV_H2V2_UBWC */ + /* 8996 v2/v3 */ + {{1, 1} , /* RGB_565_UBWC */ + {146, 100} , /* RGBA_8888_UBWC */ + {146, 100} , /* RGBX_8888_UBWC */ + {128, 100} } , /* YUV_H2V2_UBWC */ }; /* @@ -214,6 +228,13 @@ static struct mdss_mdp_format_params_ubwc mdss_mdp_format_ubwc_map[] = { .comp_ratio_nrt = {1, 1}, }, { + .mdp_format = FMT_RGB_8888(MDP_RGBX_8888_UBWC, + MDSS_MDP_FETCH_UBWC, VALID_ROT_WB_FORMAT, 0, + C2_R_Cr, C0_G_Y, C1_B_Cb, C3_ALPHA), + .comp_ratio_rt = {1, 1}, + .comp_ratio_nrt = {1, 1}, + }, + { .mdp_format = FMT_YUV_PSEUDO(MDP_Y_CBCR_H2V2_UBWC, MDSS_MDP_FETCH_UBWC, MDSS_MDP_CHROMA_420, VALID_ROT_WB_FORMAT, C1_B_Cb, C2_R_Cr), diff --git a/drivers/video/fbdev/msm/mdss_mdp_util.c b/drivers/video/fbdev/msm/mdss_mdp_util.c index 80a0486696d9..872efc01b5b2 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_util.c +++ b/drivers/video/fbdev/msm/mdss_mdp_util.c @@ -538,15 +538,16 @@ static int mdss_mdp_get_ubwc_plane_size(struct mdss_mdp_format_params *fmt, ALIGN(DIV_ROUND_UP(height / 2, 8), 16), 4096); } else if (fmt->format == MDP_RGBA_8888_UBWC || + fmt->format == MDP_RGBX_8888_UBWC || fmt->format == MDP_RGB_565_UBWC) { uint32_t stride_alignment, bpp, aligned_bitstream_width; - if (fmt->format == MDP_RGBA_8888_UBWC) { - stride_alignment = 64; - bpp = 4; - } else { + if (fmt->format == MDP_RGB_565_UBWC) { stride_alignment = 128; bpp = 2; + } else { + stride_alignment = 64; + bpp = 4; } ps->num_planes = 2; diff --git a/include/uapi/linux/msm_mdp.h b/include/uapi/linux/msm_mdp.h index 2a7ab5158f27..697fd39ea826 100644 --- a/include/uapi/linux/msm_mdp.h +++ b/include/uapi/linux/msm_mdp.h @@ -174,6 +174,7 @@ enum { MDP_RGB_565_UBWC, MDP_RGBA_8888_UBWC, MDP_Y_CBCR_H2V2_UBWC, + MDP_RGBX_8888_UBWC, MDP_IMGTYPE_LIMIT, MDP_RGB_BORDERFILL, /* border fill pipe */ MDP_FB_FORMAT = MDP_IMGTYPE2_START, /* framebuffer format */ |