Skip to content

Commit b6a8d6b

Browse files
chadmedjannau
authored andcommitted
drm: apple: Advertise ARGB2101010 support
The full range packed 10-bit dcp format ("l10r") supports alpha so use that instead of the already slightly misused wide gamut format "w30r" to support DRM_FORMAT_ARGB2101010. Signed-off-by: James Calligeros <jcalligeros99@gmail.com> Signed-off-by: Janne Grunau <j@jannau.net>
1 parent 32cc115 commit b6a8d6b

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

drivers/gpu/drm/apple/plane.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ static u32 drm_format_to_dcp(u32 drm)
117117
return DCP_FORMAT_RGBA;
118118

119119
case DRM_FORMAT_XRGB2101010:
120-
return DCP_FORMAT_W30R;
120+
case DRM_FORMAT_ARGB2101010:
121+
return DCP_FORMAT_L10R;
121122
}
122123

123124
pr_warn("DRM format %X not supported in DCP\n", drm);
@@ -143,13 +144,15 @@ static void apple_plane_atomic_update(struct drm_plane *plane,
143144
}
144145

145146
struct drm_framebuffer *fb = base->fb;
147+
const struct drm_format_info *fmt = fb->format;
146148
/*
147-
* DCP doesn't support XBGR8 / XRGB8 natively. Blending as
149+
* DCP doesn't support XBGR8 / XRGB8 / XBGR2101010 natively. Blending as
148150
* pre-multiplied alpha with a black background can be used as
149151
* workaround for the bottommost plane.
150152
*/
151-
if (fb->format->format == DRM_FORMAT_XRGB8888 ||
152-
fb->format->format == DRM_FORMAT_XBGR8888)
153+
if (fmt->format == DRM_FORMAT_XRGB8888 ||
154+
fmt->format == DRM_FORMAT_XBGR8888 ||
155+
fmt->format == DRM_FORMAT_XBGR2101010)
153156
is_premultiplied = true;
154157

155158
new_state->src_rect = drm_to_dcp_rect_fp(&base->src);
@@ -239,13 +242,15 @@ static const struct drm_plane_funcs apple_plane_funcs = {
239242
*/
240243
static const u32 dcp_primary_formats[] = {
241244
DRM_FORMAT_XRGB2101010,
245+
DRM_FORMAT_ARGB2101010,
242246
DRM_FORMAT_XRGB8888,
243247
DRM_FORMAT_ARGB8888,
244248
DRM_FORMAT_XBGR8888,
245249
DRM_FORMAT_ABGR8888,
246250
};
247251

248252
static const u32 dcp_overlay_formats[] = {
253+
DRM_FORMAT_ARGB2101010,
249254
DRM_FORMAT_ARGB8888,
250255
DRM_FORMAT_ABGR8888,
251256
};

0 commit comments

Comments
 (0)