Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/drivers/gpu/drm/apple/apple_drv.c b/drivers/gpu/drm/apple/apple_drv.c
- index 9f99516b7..f8e851aa4 100644
- --- a/drivers/gpu/drm/apple/apple_drv.c
- +++ b/drivers/gpu/drm/apple/apple_drv.c
- @@ -510,7 +510,7 @@ static int apple_drm_init(struct device *dev)
- if (ret)
- goto err_unbind;
- - drm_client_setup_with_fourcc(&apple->drm, DRM_FORMAT_XRGB8888);
- + drm_client_setup_with_fourcc(&apple->drm, DRM_FORMAT_ARGB8888);
- return 0;
- diff --git a/drivers/gpu/drm/apple/plane.c b/drivers/gpu/drm/apple/plane.c
- index f92875e63..70b294ea2 100644
- --- a/drivers/gpu/drm/apple/plane.c
- +++ b/drivers/gpu/drm/apple/plane.c
- @@ -359,16 +359,12 @@ static const struct drm_plane_funcs apple_plane_funcs = {
- * formats, an extra RGBA format, and a biplanar RGB10_A8 format (fourcc b3a8)
- * used for HDR.
- *
- - * Note: we don't have non-alpha formats but userspace breaks without XRGB. It
- - * doesn't matter for the primary plane, but cursors/overlays must not
- - * advertise formats without alpha.
- + * DCP uses alpha when blending cropped surfaces, even for the bottommost
- + * plane. Only advertise RGB formats with an alpha channel.
- */
- static const u32 dcp_primary_formats[] = {
- - DRM_FORMAT_XRGB2101010,
- DRM_FORMAT_ARGB2101010,
- - DRM_FORMAT_XRGB8888,
- DRM_FORMAT_ARGB8888,
- - DRM_FORMAT_XBGR8888,
- DRM_FORMAT_ABGR8888,
- DRM_FORMAT_NV12,
- DRM_FORMAT_NV16,
- @@ -398,9 +394,7 @@ static const u32 dcp_overlay_formats[] = {
- * Formats for the 12.x firmware which does not support "l10r" / ARGB2101010
- */
- static const u32 dcp_primary_formats_12_x[] = {
- - DRM_FORMAT_XRGB8888,
- DRM_FORMAT_ARGB8888,
- - DRM_FORMAT_XBGR8888,
- DRM_FORMAT_ABGR8888,
- DRM_FORMAT_NV12,
- DRM_FORMAT_NV16,
- diff --git a/drivers/gpu/drm/clients/drm_fbdev_client.c b/drivers/gpu/drm/clients/drm_fbdev_client.c
- index 91d196a39..1639d0e7e 100644
- --- a/drivers/gpu/drm/clients/drm_fbdev_client.c
- +++ b/drivers/gpu/drm/clients/drm_fbdev_client.c
- @@ -158,6 +158,8 @@ int drm_fbdev_client_setup(struct drm_device *dev, const struct drm_format_info
- if (!fb_helper)
- return -ENOMEM;
- drm_fb_helper_prepare(dev, fb_helper, color_mode, NULL);
- + if (format && format->depth)
- + fb_helper->preferred_format = format->format;
- ret = drm_client_init(dev, &fb_helper->client, "fbdev", &drm_fbdev_client_funcs);
- if (ret) {
- diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
- index 80ca785bd..b567f513b 100644
- --- a/drivers/gpu/drm/drm_fb_helper.c
- +++ b/drivers/gpu/drm/drm_fb_helper.c
- @@ -401,6 +401,7 @@ void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper,
- helper->funcs = funcs;
- helper->dev = dev;
- helper->preferred_bpp = preferred_bpp;
- + helper->preferred_format = DRM_FORMAT_INVALID;
- }
- EXPORT_SYMBOL(drm_fb_helper_prepare);
- @@ -1415,6 +1416,14 @@ static int __drm_fb_helper_find_sizes(struct drm_fb_helper *fb_helper,
- if (surface_format != DRM_FORMAT_INVALID)
- break; /* found supported format */
- + /* Preserve an explicit format instead of reducing it to a color mode. */
- + if (fb_helper->preferred_format &&
- + drm_plane_has_format(plane, fb_helper->preferred_format,
- + DRM_FORMAT_MOD_LINEAR)) {
- + surface_format = fb_helper->preferred_format;
- + break;
- + }
- +
- /* try preferred color mode */
- surface_format = drm_fb_helper_find_format(fb_helper,
- plane->format_types,
- diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
- index 0c5e5ed7b..fe5fcca41 100644
- --- a/include/drm/drm_fb_helper.h
- +++ b/include/drm/drm_fb_helper.h
- @@ -198,6 +198,12 @@ struct drm_fb_helper {
- */
- int preferred_bpp;
- + /**
- + * @preferred_format: Explicit driver-preferred framebuffer format, or
- + * zero to select a format from @preferred_bpp.
- + */
- + u32 preferred_format;
- +
- #ifdef CONFIG_FB_DEFERRED_IO
- /**
- * @fbdefio:
Advertisement
Add Comment
Please, Sign In to add comment