* [PATCH] ui: add XBGR8888 and ABGR8888 in drm_format_pixman_map
@ 2023-09-14 1:31 Ken Xue
2023-09-14 5:56 ` Philippe Mathieu-Daudé
2023-09-15 11:40 ` Marc-André Lureau
0 siblings, 2 replies; 3+ messages in thread
From: Ken Xue @ 2023-09-14 1:31 UTC (permalink / raw)
To: qemu-devel; +Cc: pierre-eric.pelloux-prayer, Hui.Yu, Ken Xue
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>
---
include/ui/qemu-pixman.h | 4 ++++
ui/qemu-pixman.c | 4 +++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h
index 51f870932791..e587c48b1fde 100644
--- a/include/ui/qemu-pixman.h
+++ b/include/ui/qemu-pixman.h
@@ -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
@@ -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) \
diff --git a/ui/qemu-pixman.c b/ui/qemu-pixman.c
index be00a96340d3..b43ec38bf0e9 100644
--- a/ui/qemu-pixman.c
+++ b/ui/qemu-pixman.c
@@ -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)
base-commit: 9a8af699677cdf58e92ff43f38ea74bbe9d37ab0
--
2.35.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ui: add XBGR8888 and ABGR8888 in drm_format_pixman_map
2023-09-14 1:31 [PATCH] ui: add XBGR8888 and ABGR8888 in drm_format_pixman_map Ken Xue
@ 2023-09-14 5:56 ` Philippe Mathieu-Daudé
2023-09-15 11:40 ` Marc-André Lureau
1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-14 5:56 UTC (permalink / raw)
To: Ken Xue, qemu-devel
Cc: pierre-eric.pelloux-prayer, Hui.Yu, Gerd Hoffmann,
Marc-André Lureau
Cc'ing maintainers:
$ ./scripts/get_maintainer.pl -f ui/qemu-pixman.c
Gerd Hoffmann <kraxel@redhat.com> (odd fixer:Graphics)
"Marc-André Lureau" <marcandre.lureau@redhat.com> (odd fixer:Graphics)
On 14/9/23 03:31, Ken Xue wrote:
> 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>
> ---
> include/ui/qemu-pixman.h | 4 ++++
> ui/qemu-pixman.c | 4 +++-
> 2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h
> index 51f870932791..e587c48b1fde 100644
> --- a/include/ui/qemu-pixman.h
> +++ b/include/ui/qemu-pixman.h
> @@ -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
> @@ -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) \
> diff --git a/ui/qemu-pixman.c b/ui/qemu-pixman.c
> index be00a96340d3..b43ec38bf0e9 100644
> --- a/ui/qemu-pixman.c
> +++ b/ui/qemu-pixman.c
> @@ -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)
>
> base-commit: 9a8af699677cdf58e92ff43f38ea74bbe9d37ab0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ui: add XBGR8888 and ABGR8888 in drm_format_pixman_map
2023-09-14 1:31 [PATCH] ui: add XBGR8888 and ABGR8888 in drm_format_pixman_map Ken Xue
2023-09-14 5:56 ` Philippe Mathieu-Daudé
@ 2023-09-15 11:40 ` Marc-André Lureau
1 sibling, 0 replies; 3+ messages in thread
From: Marc-André Lureau @ 2023-09-15 11:40 UTC (permalink / raw)
To: Ken Xue; +Cc: qemu-devel, pierre-eric.pelloux-prayer, Hui.Yu
On Thu, Sep 14, 2023 at 9:26 AM Ken Xue <Ken.Xue@amd.com> wrote:
>
> 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>
> ---
> include/ui/qemu-pixman.h | 4 ++++
> ui/qemu-pixman.c | 4 +++-
> 2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h
> index 51f870932791..e587c48b1fde 100644
> --- a/include/ui/qemu-pixman.h
> +++ b/include/ui/qemu-pixman.h
> @@ -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
> @@ -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) \
> diff --git a/ui/qemu-pixman.c b/ui/qemu-pixman.c
> index be00a96340d3..b43ec38bf0e9 100644
> --- a/ui/qemu-pixman.c
> +++ b/ui/qemu-pixman.c
> @@ -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)
>
> base-commit: 9a8af699677cdf58e92ff43f38ea74bbe9d37ab0
> --
> 2.35.1
>
>
--
Marc-André Lureau
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-09-15 11:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-14 1:31 [PATCH] ui: add XBGR8888 and ABGR8888 in drm_format_pixman_map Ken Xue
2023-09-14 5:56 ` Philippe Mathieu-Daudé
2023-09-15 11:40 ` Marc-André Lureau
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).