Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions drivers/gpu/drm/apple/plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;

Expand Down Expand Up @@ -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,
Expand All @@ -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;
Expand Down
Loading