Skip to content
Browse files

msm_fb: display: Add YV12 support in the MDP

Added changes to support YV12 input format in the MDP.

Change-Id: I23fb10ea30117e20de654d9516f7d024b99f6c96
Signed-off-by: Pradeep Jilagam <pjilagam@codeaurora.org>
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
  • Loading branch information...
1 parent d1c983f commit e7054b8bed6ad8c2c1d60287b72fe9ff254f4dda Pradeep Jilagam committed with Oct 5, 2011
Showing with 36 additions and 8 deletions.
  1. +35 −8 drivers/video/msm/mdp4_overlay.c
  2. +1 −0 include/linux/msm_mdp.h
View
43 drivers/video/msm/mdp4_overlay.c
@@ -464,6 +464,7 @@ static void mdp4_overlay_vg_get_src_offset(struct mdp4_overlay_pipe *pipe,
switch (pipe->src_format) {
case MDP_Y_CR_CB_H2V2:
+ case MDP_Y_CR_CB_GH2V2:
case MDP_Y_CB_CR_H2V2:
*luma_off = pipe->src_x;
*chroma_off = pipe->src_x/2;
@@ -524,6 +525,11 @@ void mdp4_overlay_vg_setup(struct mdp4_overlay_pipe *pipe)
dst_xy = ((pipe->dst_y << 16) | pipe->dst_x);
ptype = mdp4_overlay_format2type(pipe->src_format);
+ if (pipe->src_format == MDP_Y_CR_CB_GH2V2) {
+ frame_size = ((pipe->src_height << 16) |
+ ALIGN(pipe->src_width, 16));
+ src_size = ((pipe->src_h << 16) | ALIGN(pipe->src_w, 16));
+ }
format = mdp4_overlay_format(pipe);
pattern = mdp4_overlay_unpack_pattern(pipe);
@@ -612,6 +618,7 @@ int mdp4_overlay_format2type(uint32 format)
case MDP_Y_CBCR_H2V2_TILE:
case MDP_Y_CRCB_H2V2_TILE:
case MDP_Y_CR_CB_H2V2:
+ case MDP_Y_CR_CB_GH2V2:
case MDP_Y_CB_CR_H2V2:
case MDP_Y_CRCB_H1V1:
case MDP_Y_CBCR_H1V1:
@@ -860,6 +867,7 @@ int mdp4_overlay_format2pipe(struct mdp4_overlay_pipe *pipe)
pipe->bpp = 2; /* 2 bpp */
break;
case MDP_Y_CR_CB_H2V2:
+ case MDP_Y_CR_CB_GH2V2:
case MDP_Y_CB_CR_H2V2:
pipe->frame_format = MDP4_FRAME_FORMAT_LINEAR;
pipe->fetch_plane = OVERLAY_PLANE_PLANAR;
@@ -955,6 +963,7 @@ void transp_color_key(int format, uint32 transp,
b_num = 8;
break;
case MDP_Y_CR_CB_H2V2:
+ case MDP_Y_CR_CB_GH2V2:
case MDP_Y_CRCB_H2V2:
case MDP_Y_CRCB_H2V1:
case MDP_Y_CRCB_H1V1:
@@ -2498,16 +2507,34 @@ int mdp4_overlay_play(struct fb_info *info, struct msmfb_overlay_data *req,
pipe->srcp1_ystride = pipe->src_width;
} else if (pipe->fetch_plane == OVERLAY_PLANE_PLANAR) {
- addr += pipe->src_width * pipe->src_height;
- pipe->srcp1_addr = addr;
- addr += ((pipe->src_width / 2) * (pipe->src_height / 2));
- pipe->srcp2_addr = addr;
+ if (pipe->src_format == MDP_Y_CR_CB_GH2V2) {
+ addr += (ALIGN(pipe->src_width, 16) *
+ pipe->src_height);
+ pipe->srcp1_addr = addr;
+ addr += ((ALIGN((pipe->src_width / 2), 16)) *
+ (pipe->src_height / 2));
+ pipe->srcp2_addr = addr;
+ } else {
+ addr += (pipe->src_width * pipe->src_height);
+ pipe->srcp1_addr = addr;
+ addr += ((pipe->src_width / 2) *
+ (pipe->src_height / 2));
+ pipe->srcp2_addr = addr;
+ }
/* mdp planar format expects Cb in srcp1 and Cr in p2 */
- if (pipe->src_format == MDP_Y_CR_CB_H2V2)
+ if ((pipe->src_format == MDP_Y_CR_CB_H2V2) ||
+ (pipe->src_format == MDP_Y_CR_CB_GH2V2))
swap(pipe->srcp1_addr, pipe->srcp2_addr);
- pipe->srcp0_ystride = pipe->src_width;
- pipe->srcp1_ystride = pipe->src_width / 2;
- pipe->srcp2_ystride = pipe->src_width / 2;
+
+ if (pipe->src_format == MDP_Y_CR_CB_GH2V2) {
+ pipe->srcp0_ystride = ALIGN(pipe->src_width, 16);
+ pipe->srcp1_ystride = ALIGN(pipe->src_width / 2, 16);
+ pipe->srcp2_ystride = ALIGN(pipe->src_width / 2, 16);
+ } else {
+ pipe->srcp0_ystride = pipe->src_width;
+ pipe->srcp1_ystride = pipe->src_width / 2;
+ pipe->srcp2_ystride = pipe->src_width / 2;
+ }
}
if (pipe->pipe_num >= OVERLAY_PIPE_VG1)
View
1 include/linux/msm_mdp.h
@@ -80,6 +80,7 @@ enum {
MDP_Y_CRCB_H2V2_TILE, /* Y and CrCb, pseudo planer tile */
MDP_Y_CBCR_H2V2_TILE, /* Y and CbCr, pseudo planer tile */
MDP_Y_CR_CB_H2V2, /* Y, Cr and Cb, planar */
+ MDP_Y_CR_CB_GH2V2, /* Y, Cr and Cb, planar aligned to Android YV12 */
MDP_Y_CB_CR_H2V2, /* Y, Cb and Cr, planar */
MDP_Y_CRCB_H1V1, /* Y and CrCb, pseduo planer w/ Cr is in MSB */
MDP_Y_CBCR_H1V1, /* Y and CbCr, pseduo planer w/ Cb is in MSB */

0 comments on commit e7054b8

Please sign in to comment.
Something went wrong with that request. Please try again.