R-Car DU supports different blend modes via VSP1. Add DRM blend mode supports to make it configurable. As drm_plane_create_blend_mode_property() creates the blend mode property with the default value of DRM_MODE_BLEND_PREMULTI, it changes the default blending behavior on R-Car DU. The rcar-du's blend mode was same as DRM_MODE_BLEND_COVERAGE, i.e., pixel color values have not been pre-multitplied. Signed-off-by: Takanari Hayama <taki@xxxxxxxxxx> --- drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c index 8eb9b2b097ae..283327046aa5 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c @@ -170,6 +170,18 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane) format = rcar_du_format_info(state->format->fourcc); cfg.pixelformat = format->v4l2; + switch (state->state.pixel_blend_mode) { + case DRM_MODE_BLEND_PREMULTI: + cfg.blend_mode = VSP1_DU_BLEND_MODE_PREMULTI; + break; + case DRM_MODE_BLEND_COVERAGE: + cfg.blend_mode = VSP1_DU_BLEND_MODE_COVERAGE; + break; + case DRM_MODE_BLEND_PIXEL_NONE: + cfg.blend_mode = VSP1_DU_BLEND_MODE_PIXEL_NONE; + break; + } + vsp1_du_atomic_update(plane->vsp->vsp, crtc->vsp_pipe, plane->index, &cfg); } @@ -444,6 +456,11 @@ 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)); + vsp->num_planes++; } -- 2.25.1