Skip to contentSkip to conversation

drm/vkms: Advertise PREMULTI blend mode

PATCH In review Michail Tatas 4 participants 6 messages Jul 20 – Aug 5

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/vkms: Advertise PREMULTI blend mode

Since we only support pre-multiplied alpha blend mode, advertise that, otherwise validate_blend_mode_for_alpha_formats() will throw a WARN.

---

syzbot link: https://syzkaller.appspot.com/bug?extid=6245cb95ae707991bffa

 drivers/gpu/drm/vkms/vkms_plane.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/vkms/vkms_plane.c +6 -0
index 68cb2a3335e6..a2e5ebee729a 100644
@@ -246,6 +246,12 @@ struct vkms_plane *vkms_plane_init(struct vkms_device *vkmsdev,
 					  DRM_COLOR_YCBCR_BT601,
 					  DRM_COLOR_YCBCR_FULL_RANGE);
 
+	/* Since our composer only supports pre-multiplied alpha,
+	 * advertise only the PREMULTI blend mode.
+	 */
+	drm_plane_create_blend_mode_property(&plane->base,
+					BIT(DRM_MODE_BLEND_PREMULTI));
+
 	if (vkms_config_plane_get_default_pipeline(plane_cfg))
 		vkms_initialize_colorops(&plane->base);
 
Signature · 1 line
2.43.0
#1 lore raw
Quoted 20 lines · Michail Tatas

Since we only support pre-multiplied alpha blend mode, advertise that, otherwise validate_blend_mode_for_alpha_formats() will throw a WARN.

---

syzbot link: https://syzkaller.appspot.com/bug?extid=6245cb95ae707991bffa

 drivers/gpu/drm/vkms/vkms_plane.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/vkms/vkms_plane.c +0 -0
index 68cb2a3335e6..a2e5ebee729a 100644
@@ -246,6 +246,12 @@ struct vkms_plane *vkms_plane_init(struct vkms_device *vkmsdev,
 					  DRM_COLOR_YCBCR_BT601,
 					  DRM_COLOR_YCBCR_FULL_RANGE);

drivers/gpu/drm/vkms/vkms_plane.c struct vkms_plane *vkms_plane_init(struct vkms_device *vkmsdev, · line 257

Quoted 10 lines
drivers/gpu/drm/vkms/vkms_plane.c +6 -0
 
+	/* Since our composer only supports pre-multiplied alpha,
+	 * advertise only the PREMULTI blend mode.
+	 */
+	drm_plane_create_blend_mode_property(&plane->base,
+					BIT(DRM_MODE_BLEND_PREMULTI));
+
 	if (vkms_config_plane_get_default_pipeline(plane_cfg))
 		vkms_initialize_colorops(&plane->base);
 

Hi,

Unfortunately, this still causes the warning on my machine. In my config CONFIG_DRM_VKMS is not set.

-Josh

#2 lore raw
Quoted 7 lines · Joshua Peisach

Hi,

Unfortunately, this still causes the warning on my machine. In my config CONFIG_DRM_VKMS is not set.

-Josh

Sorry, disregard. This was meant to be a fix for just VKMS. I was lead here by syzkaller thinking it would fix it for all.

-Josh

maintainer Reviewed-by on v1 1/1
#3 lore raw
In reply to Michail Tatas
Quoted 6 lines · Michail Tatas

Since we only support pre-multiplied alpha blend mode, advertise that, otherwise validate_blend_mode_for_alpha_formats() will throw a WARN.

Quoted 24 lines

---

syzbot link: https://syzkaller.appspot.com/bug?extid=6245cb95ae707991bffa

  drivers/gpu/drm/vkms/vkms_plane.c | 6 ++++++
  1 file changed, 6 insertions(+)
drivers/gpu/drm/vkms/vkms_plane.c +6 -0
index 68cb2a3335e6..a2e5ebee729a 100644
@@ -246,6 +246,12 @@ struct vkms_plane *vkms_plane_init(struct vkms_device *vkmsdev,
  					  DRM_COLOR_YCBCR_BT601,
  					  DRM_COLOR_YCBCR_FULL_RANGE);
 
+	/* Since our composer only supports pre-multiplied alpha,
+	 * advertise only the PREMULTI blend mode.
+	 */
+	drm_plane_create_blend_mode_property(&plane->base,
+					BIT(DRM_MODE_BLEND_PREMULTI));
+
  	if (vkms_config_plane_get_default_pipeline(plane_cfg))
  		vkms_initialize_colorops(&plane->base);
 
#4 lore raw

Hi Louis and DRM maintainers,

Now that Louis has reviewed and approved this fix, could someone please pick it up for the appropriate branch for linux-next?

This bug is currently breaking one of our syzbot managers, so getting it merged there would help unblock our fuzzing.

Thanks!

#5 lore raw

Cc+ Dave Airlie <[email protected]>

Quoted 5 lines

Now that Louis has reviewed and approved this fix, could someone please pick it up for the appropriate branch for linux-next?

This bug is currently breaking one of our syzbot managers, so getting it merged there would help unblock our fuzzing.

FTR, The manager has now been broken for over two weeks. Another one is currently running a 3-week-old kernel. We'd really appreciate getting this change merged.

Thanks,
Pimyn