summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakanari Hayama <taki@igel.co.jp>2022-08-10 17:37:11 +0900
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2022-09-07 23:48:39 +0300
commit0a58c9b11b7958a1c9a2d804c5b45f9ab33609e4 (patch)
tree963bf4bf405c672a9b823884c90c2b367407f58e
parentb07f5a4d4457a047104315190930a06fc5f26391 (diff)
downloadlwn-0a58c9b11b7958a1c9a2d804c5b45f9ab33609e4.tar.gz
lwn-0a58c9b11b7958a1c9a2d804c5b45f9ab33609e4.zip
drm: rcar-du: Add DRM_MODE_BLEND_PIXEL_NONE support
DRM_MODE_BLEND_PIXEL_NONE ignores an alpha channel. Rcar-du driver supports only 3 formats with an alpha channel (DRM_FORMAT_ARGB1555, DRM_FORMAT_ARGB8888 and DRM_FORMAT_ARGB4444). We simply override the format passed to VSP1 for blending with the pixel format without alpha channel. Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Takanari Hayama <taki@igel.co.jp> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_vsp.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
index 3d560969b59c..e465aef41585 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
@@ -152,6 +152,7 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
.alpha = state->state.alpha >> 8,
.zpos = state->state.zpos,
};
+ u32 fourcc = state->format->fourcc;
unsigned int i;
cfg.src.left = state->state.src.x1 >> 16;
@@ -168,7 +169,23 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
cfg.mem[i] = sg_dma_address(state->sg_tables[i].sgl)
+ fb->offsets[i];
- format = rcar_du_format_info(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;
+ }
+ }
+
+ format = rcar_du_format_info(fourcc);
cfg.pixelformat = format->v4l2;
cfg.premult = state->state.pixel_blend_mode == DRM_MODE_BLEND_PREMULTI;
@@ -439,6 +456,7 @@ int rcar_du_vsp_init(struct rcar_du_vsp *vsp, struct device_node *np,
num_planes - 1);
drm_plane_create_blend_mode_property(&plane->plane,
+ BIT(DRM_MODE_BLEND_PIXEL_NONE) |
BIT(DRM_MODE_BLEND_PREMULTI) |
BIT(DRM_MODE_BLEND_COVERAGE));