Skip to content

Commit

Permalink
staging: drm/imx: add BGR565 format
Browse files Browse the repository at this point in the history
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Philipp Zabel authored and Greg Kroah-Hartman committed Oct 11, 2013
1 parent 7cb1779 commit 38fc7b3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/staging/imx-drm/ipu-v3/ipu-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,14 @@ static const struct ipu_rgb def_rgb_16 = {
.bits_per_pixel = 16,
};

static const struct ipu_rgb def_bgr_16 = {
.red = { .offset = 0, .length = 5, },
.green = { .offset = 5, .length = 6, },
.blue = { .offset = 11, .length = 5, },
.transp = { .offset = 0, .length = 0, },
.bits_per_pixel = 16,
};

#define Y_OFFSET(pix, x, y) ((x) + pix->width * (y))
#define U_OFFSET(pix, x, y) ((pix->width * pix->height) + \
(pix->width * (y) / 4) + (x) / 2)
Expand Down Expand Up @@ -374,6 +382,9 @@ int ipu_cpmem_set_fmt(struct ipu_ch_param __iomem *cpmem, u32 drm_fourcc)
case DRM_FORMAT_RGB565:
ipu_cpmem_set_format_rgb(cpmem, &def_rgb_16);
break;
case DRM_FORMAT_BGR565:
ipu_cpmem_set_format_rgb(cpmem, &def_bgr_16);
break;
default:
return -EINVAL;
}
Expand Down

0 comments on commit 38fc7b3

Please sign in to comment.