Commit 0dfcf80d authored by Damian Hobson-Garcia's avatar Damian Hobson-Garcia Committed by Laurent Pinchart

drm: rcar-du: Add more formats to DRM_MODE_BLEND_PIXEL_NONE support

Add additional pixel formats for which blending is disabled when
DRM_MODE_BLEND_PIXEL_NONE is set.

Refactor the fourcc selection into a separate function to handle the
increased number of formats.
Signed-off-by: default avatarDamian Hobson-Garcia <dhobsong@igel.co.jp>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
parent 6e6c74a4
...@@ -177,6 +177,37 @@ static const u32 rcar_du_vsp_formats_gen4[] = { ...@@ -177,6 +177,37 @@ static const u32 rcar_du_vsp_formats_gen4[] = {
DRM_FORMAT_Y212, DRM_FORMAT_Y212,
}; };
static u32 rcar_du_vsp_state_get_format(struct rcar_du_vsp_plane_state *state)
{
u32 fourcc = state->format->fourcc;
if (state->state.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
switch (fourcc) {
case DRM_FORMAT_ARGB1555:
fourcc = DRM_FORMAT_XRGB1555;
break;
case DRM_FORMAT_ARGB4444:
fourcc = DRM_FORMAT_XRGB4444;
break;
case DRM_FORMAT_ARGB8888:
fourcc = DRM_FORMAT_XRGB8888;
break;
case DRM_FORMAT_BGRA8888:
fourcc = DRM_FORMAT_BGRX8888;
break;
case DRM_FORMAT_RGBA1010102:
fourcc = DRM_FORMAT_RGBX1010102;
break;
}
}
return fourcc;
}
static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane) static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
{ {
struct rcar_du_vsp_plane_state *state = struct rcar_du_vsp_plane_state *state =
...@@ -190,7 +221,7 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane) ...@@ -190,7 +221,7 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
.alpha = state->state.alpha >> 8, .alpha = state->state.alpha >> 8,
.zpos = state->state.zpos, .zpos = state->state.zpos,
}; };
u32 fourcc = state->format->fourcc; u32 fourcc = rcar_du_vsp_state_get_format(state);
unsigned int i; unsigned int i;
cfg.src.left = state->state.src.x1 >> 16; cfg.src.left = state->state.src.x1 >> 16;
...@@ -207,22 +238,6 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane) ...@@ -207,22 +238,6 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
cfg.mem[i] = sg_dma_address(state->sg_tables[i].sgl) cfg.mem[i] = sg_dma_address(state->sg_tables[i].sgl)
+ fb->offsets[i]; + fb->offsets[i];
if (state->state.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
switch (fourcc) {
case DRM_FORMAT_ARGB1555:
fourcc = DRM_FORMAT_XRGB1555;
break;
case DRM_FORMAT_ARGB4444:
fourcc = DRM_FORMAT_XRGB4444;
break;
case DRM_FORMAT_ARGB8888:
fourcc = DRM_FORMAT_XRGB8888;
break;
}
}
format = rcar_du_format_info(fourcc); format = rcar_du_format_info(fourcc);
cfg.pixelformat = format->v4l2; cfg.pixelformat = format->v4l2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment