diff options
author | Kristian Høgsberg <[email protected]> | 2012-01-11 14:23:24 -0500 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2012-01-11 14:24:00 -0500 |
commit | 58dc1b28d1ef4d1931c52b079d304f2e1546329d (patch) | |
tree | 7e95c4a17c4393e4e6b3c4a44fa22daa033cdbb2 /src/gallium/state_trackers/egl/wayland | |
parent | 1306644a67ad90c39c55f76e9b4734d943b6b5cc (diff) |
wayland-drm: Drop the non-premul formats, use format codes from drm_fourcc.h
Diffstat (limited to 'src/gallium/state_trackers/egl/wayland')
4 files changed, 14 insertions, 29 deletions
diff --git a/src/gallium/state_trackers/egl/wayland/native_drm.c b/src/gallium/state_trackers/egl/wayland/native_drm.c index 5618f3ec296..ad238bee122 100644 --- a/src/gallium/state_trackers/egl/wayland/native_drm.c +++ b/src/gallium/state_trackers/egl/wayland/native_drm.c @@ -109,11 +109,10 @@ wayland_create_drm_buffer(struct wayland_display *display, switch (surface->color_format) { case PIPE_FORMAT_B8G8R8A8_UNORM: - format = (surface->premultiplied_alpha) ? - WL_DRM_FORMAT_PREMULTIPLIED_ARGB32 : WL_DRM_FORMAT_ARGB32; + format = WL_DRM_FORMAT_ARGB8888; break; case PIPE_FORMAT_B8G8R8X8_UNORM: - format = WL_DRM_FORMAT_XRGB32; + format = WL_DRM_FORMAT_XRGB8888; break; default: return NULL; @@ -151,14 +150,11 @@ drm_handle_format(void *data, struct wl_drm *drm, uint32_t format) struct wayland_drm_display *drmdpy = data; switch (format) { - case WL_DRM_FORMAT_ARGB32: - drmdpy->base.formats |= HAS_ARGB32; + case WL_DRM_FORMAT_ARGB8888: + drmdpy->base.formats |= HAS_ARGB8888; break; - case WL_DRM_FORMAT_PREMULTIPLIED_ARGB32: - drmdpy->base.formats |= HAS_PREMUL_ARGB32; - break; - case WL_DRM_FORMAT_XRGB32: - drmdpy->base.formats |= HAS_XRGB32; + case WL_DRM_FORMAT_XRGB8888: + drmdpy->base.formats |= HAS_XRGB8888; break; } } diff --git a/src/gallium/state_trackers/egl/wayland/native_shm.c b/src/gallium/state_trackers/egl/wayland/native_shm.c index f9a7d81c043..b76e5db33db 100644 --- a/src/gallium/state_trackers/egl/wayland/native_shm.c +++ b/src/gallium/state_trackers/egl/wayland/native_shm.c @@ -117,13 +117,10 @@ shm_handle_format(void *data, struct wl_shm *shm, uint32_t format) switch (format) { case WL_SHM_FORMAT_ARGB32: - shmdpy->base.formats |= HAS_ARGB32; + shmdpy->base.formats |= HAS_ARGB8888; break; - case WL_SHM_FORMAT_PREMULTIPLIED_ARGB32: - shmdpy->base.formats |= HAS_PREMUL_ARGB32; - break; - case WL_SHM_FORMAT_XRGB32: - shmdpy->base.formats |= HAS_XRGB32; + case WL_SHM_FORMAT_XRGB8888: + shmdpy->base.formats |= HAS_XRGB8888; break; } } diff --git a/src/gallium/state_trackers/egl/wayland/native_wayland.c b/src/gallium/state_trackers/egl/wayland/native_wayland.c index c6942931ec2..dfaa50f1a8a 100644 --- a/src/gallium/state_trackers/egl/wayland/native_wayland.c +++ b/src/gallium/state_trackers/egl/wayland/native_wayland.c @@ -41,14 +41,8 @@ const static struct { enum pipe_format format; enum wayland_format_flag flag; } wayland_formats[] = { - /* - * HAS_PREMUL_ARGB32 is ignored here. For the case that HAS_PREMUL_ARGB32 - * is set but HAS_ARGB32 isn't, we should not claim - * PIPE_FORMAT_B8G8R8A8_UNORM support because we will not be able to present - * a surface with non-premultiplied alpha. - */ - { PIPE_FORMAT_B8G8R8A8_UNORM, HAS_ARGB32 }, - { PIPE_FORMAT_B8G8R8X8_UNORM, HAS_XRGB32 }, + { PIPE_FORMAT_B8G8R8A8_UNORM, HAS_ARGB8888 }, + { PIPE_FORMAT_B8G8R8X8_UNORM, HAS_XRGB8888 }, }; static const struct native_config ** @@ -104,8 +98,7 @@ wayland_display_get_param(struct native_display *ndpy, switch (param) { case NATIVE_PARAM_PREMULTIPLIED_ALPHA: - val = ((display->formats & HAS_ARGB32) && - (display->formats & HAS_PREMUL_ARGB32)); + val = 1; break; case NATIVE_PARAM_USE_NATIVE_BUFFER: case NATIVE_PARAM_PRESERVE_BUFFER: diff --git a/src/gallium/state_trackers/egl/wayland/native_wayland.h b/src/gallium/state_trackers/egl/wayland/native_wayland.h index 143428c5f9c..e6a914fc025 100644 --- a/src/gallium/state_trackers/egl/wayland/native_wayland.h +++ b/src/gallium/state_trackers/egl/wayland/native_wayland.h @@ -37,9 +37,8 @@ struct wayland_surface; enum wayland_format_flag { - HAS_ARGB32 = (1 << 0), - HAS_PREMUL_ARGB32 = (1 << 1), - HAS_XRGB32 = (1 << 2) + HAS_ARGB8888 = (1 << 0), + HAS_XRGB8888 = (1 << 1) }; struct wayland_display { |