Hi Laurent,

> 2022/08/19 11:08、Laurent Pinchart <laurent.pinch...@ideasonboard.com>のメール:
> 
> Hello Hayama-san,
> 
> Thank you for the patch.
> 
> On Wed, Aug 10, 2022 at 05:37:10PM +0900, Takanari Hayama wrote:
>> R-Car DU driver implicitly supports DRM_MODE_BLEND_COVERAGE only.
>> This adds a support for DRM_MODE_BLEND_PREMULTI. As a consequence,
>> DRM_MODE_BLEND_PREMULTI becomes the default. If DRM_MODE_BLEND_COVERAGE
>> is desired, it should be set explicitly.
>> 
>> This behavior comes from how DRM blend mode is supported.
>> drm_plane_create_blend_mode_property() creates the blend mode property
>> with the default value of DRM_MODE_BLEND_PREMULTI. This default value
>> cannot be modified from the atomic driver.
>> 
>> Signed-off-by: Takanari Hayama <t...@igel.co.jp>
>> ---
>> drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 6 ++++++
>> 1 file changed, 6 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..b9580fcfec7a 100644
>> --- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
>> +++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
>> @@ -167,6 +167,8 @@ 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];
>> 
>> +    cfg.premult = (state->state.pixel_blend_mode == 
>> DRM_MODE_BLEND_PREMULTI);
> 
> I'll drop the parentheses here too, and if you don't mind, I'll move
> this down after setting cfg.pixelformat, as premult qualifies the format
> so it's more logical in that reading order (no change on the behaviour
> of course).

Thank you. I also agree with the proposed change in order.

> Reviewed-by: Laurent Pinchart <laurent.pinch...@ideasonboard.com>
> 
>> +
>>      format = rcar_du_format_info(state->format->fourcc);
>>      cfg.pixelformat = format->v4l2;
>> 
>> @@ -444,6 +446,10 @@ 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_PREMULTI) |
>> +                                    BIT(DRM_MODE_BLEND_COVERAGE));
>> +
>>              vsp->num_planes++;
>>      }
>> 
> 
> -- 
> Regards,
> 
> Laurent Pinchart

Cheers,
Takanari Hayama, Ph.D. <t...@igel.co.jp>
IGEL Co., Ltd.
https://www.igel.co.jp/

Reply via email to