Skip to content

Commit

Permalink
ui: add XBGR8888 and ABGR8888 in drm_format_pixman_map
Browse files Browse the repository at this point in the history
Android uses XBGR8888 and ABGR8888 as default scanout buffer, But qemu
does not support them for qemu_pixman_to_drm_format conversion within
virtio_gpu_create_dmabuf for virtio gpu.

so, add those 2 formats into drm_format_pixman_map.

Signed-off-by: Ken Xue <Ken.Xue@amd.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20230914013151.805363-1-Ken.Xue@amd.com>
  • Loading branch information
firstbread authored and elmarco committed Oct 3, 2023
1 parent 65d7ceb commit 7db57a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions include/ui/qemu-pixman.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
# define PIXMAN_LE_r8g8b8 PIXMAN_b8g8r8
# define PIXMAN_LE_a8r8g8b8 PIXMAN_b8g8r8a8
# define PIXMAN_LE_x8r8g8b8 PIXMAN_b8g8r8x8
# define PIXMAN_LE_a8b8g8r8 PIXMAN_r8g8b8a8
# define PIXMAN_LE_x8b8g8r8 PIXMAN_r8g8b8x8
#else
# define PIXMAN_BE_r8g8b8 PIXMAN_b8g8r8
# define PIXMAN_BE_x8r8g8b8 PIXMAN_b8g8r8x8
Expand All @@ -45,6 +47,8 @@
# define PIXMAN_LE_r8g8b8 PIXMAN_r8g8b8
# define PIXMAN_LE_a8r8g8b8 PIXMAN_a8r8g8b8
# define PIXMAN_LE_x8r8g8b8 PIXMAN_x8r8g8b8
# define PIXMAN_LE_a8b8g8r8 PIXMAN_a8b8g8r8
# define PIXMAN_LE_x8b8g8r8 PIXMAN_x8b8g8r8
#endif

#define QEMU_PIXMAN_COLOR(r, g, b) \
Expand Down
4 changes: 3 additions & 1 deletion ui/qemu-pixman.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ static const struct {
} drm_format_pixman_map[] = {
{ DRM_FORMAT_RGB888, PIXMAN_LE_r8g8b8 },
{ DRM_FORMAT_ARGB8888, PIXMAN_LE_a8r8g8b8 },
{ DRM_FORMAT_XRGB8888, PIXMAN_LE_x8r8g8b8 }
{ DRM_FORMAT_XRGB8888, PIXMAN_LE_x8r8g8b8 },
{ DRM_FORMAT_XBGR8888, PIXMAN_LE_x8b8g8r8 },
{ DRM_FORMAT_ABGR8888, PIXMAN_LE_a8b8g8r8 },
};

pixman_format_code_t qemu_drm_format_to_pixman(uint32_t drm_format)
Expand Down

0 comments on commit 7db57a7

Please sign in to comment.