From cb5eee07d8353916eb64a6d9455bfd6f6261105e Mon Sep 17 00:00:00 2001 From: Marcelo Alcantara Date: Wed, 2 Dec 2026 10:20:41 +1000 Subject: [PATCH] drm/apple: set blend mode property on v14.7 and v26.6 primary planes Both apple_plane_init_v14_7() and apple_plane_init_v26_6() expose DRM_FORMAT_ARGB8888 without registering a pixel blend mode property, triggering a DRM core validation warning on every boot: [PLANE:35:plane-0] pixel format with alpha exposed but blend mode not setup. Please fix. Both wire encoders (dcp_v14_encode_surface() and dcp_m4_surface_encode()) set surface[2] (is_premultiplied) only for opaque XRGB formats and pass 0 for ARGB surfaces, so DCP blends alpha as coverage (the same contract as apple_plane_init() when premultiplied is false). Register drm_plane_create_blend_mode_property() with BIT(DRM_MODE_BLEND_COVERAGE) in both helpers, matching apple_plane_init(). Signed-off-by: Marcelo Alcantara --- drivers/gpu/drm/apple/plane.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/gpu/drm/apple/plane.c b/drivers/gpu/drm/apple/plane.c index e21e626ddee88..3bb7b49b1960c 100644 --- a/drivers/gpu/drm/apple/plane.c +++ b/drivers/gpu/drm/apple/plane.c @@ -927,6 +927,7 @@ struct drm_plane *apple_plane_init_v14_7(struct drm_device *dev, enum drm_plane_type type) { struct apple_plane *plane; + int ret; if (type != DRM_PLANE_TYPE_PRIMARY) return ERR_PTR(-EINVAL); @@ -938,6 +939,15 @@ struct drm_plane *apple_plane_init_v14_7(struct drm_device *dev, if (IS_ERR(plane)) return ERR_CAST(plane); + /* + * v14.7 sets surface[2] (is_premultiplied) only for opaque XRGB + * formats; ARGB surfaces pass 0 so DCP blends alpha as coverage. + */ + ret = drm_plane_create_blend_mode_property(&plane->base, + BIT(DRM_MODE_BLEND_COVERAGE)); + if (ret) + return ERR_PTR(ret); + drm_plane_helper_add(&plane->base, &apple_primary_plane_helper_funcs); plane->iomfb_surf = iomfb_surf; @@ -988,6 +998,7 @@ struct drm_plane *apple_plane_init_v26_6(struct drm_device *dev, unsigned long possible_crtcs, u32 iomfb_surf) { struct apple_plane *plane; + int ret; plane = drmm_universal_plane_alloc(dev, struct apple_plane, base, possible_crtcs, &apple_plane_funcs, @@ -997,6 +1008,16 @@ struct drm_plane *apple_plane_init_v26_6(struct drm_device *dev, DRM_PLANE_TYPE_PRIMARY, NULL); if (IS_ERR(plane)) return ERR_CAST(plane); + + /* + * v26.6 sets surface[2] (is_premultiplied) only for XRGB8888; + * ARGB8888 surfaces pass 0 so DCP blends alpha as coverage. + */ + ret = drm_plane_create_blend_mode_property(&plane->base, + BIT(DRM_MODE_BLEND_COVERAGE)); + if (ret) + return ERR_PTR(ret); + drm_plane_helper_add(&plane->base, &apple_primary_plane_helper_funcs_v26_6); plane->iomfb_surf = iomfb_surf; return &plane->base;