summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/egl/common
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2011-09-07 21:41:30 +0800
committerChia-I Wu <[email protected]>2011-09-08 01:26:24 +0800
commit6b52e82768b68dd75bfda9637f0154c5425171ed (patch)
tree8730d948a445e3b21c856e5d69bc45223c0ed966 /src/gallium/state_trackers/egl/common
parentb89bca6d8b84e7922f44258c41e37997775f98c9 (diff)
st/egl: track changes to drop wl_visual in wayland
Follow a subset of changes in 7b1d94e5d1f53ac5f59000176aea1d02fc9a1181. There are known issues, but it works to a certain degree. Non-working demos also fail gracefully. More importantly, it fixes the build.
Diffstat (limited to 'src/gallium/state_trackers/egl/common')
-rw-r--r--src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.c23
-rw-r--r--src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.h3
2 files changed, 20 insertions, 6 deletions
diff --git a/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.c b/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.c
index bc2cee4c386..50b6efd6102 100644
--- a/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.c
+++ b/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.c
@@ -15,17 +15,32 @@
void *
egl_g3d_wl_drm_helper_reference_buffer(void *user_data, uint32_t name,
int32_t width, int32_t height,
- uint32_t stride,
- struct wl_visual *visual)
+ uint32_t stride, uint32_t format)
{
struct native_display *ndpy = user_data;
struct pipe_resource templ;
struct winsys_handle wsh;
- enum pipe_format format = PIPE_FORMAT_B8G8R8A8_UNORM;
+ enum pipe_format pf;
+
+ switch (format) {
+ case WL_DRM_FORMAT_ARGB32:
+ case WL_DRM_FORMAT_PREMULTIPLIED_ARGB32:
+ pf = PIPE_FORMAT_B8G8R8A8_UNORM;
+ break;
+ case WL_DRM_FORMAT_XRGB32:
+ pf = PIPE_FORMAT_B8G8R8X8_UNORM;
+ break;
+ default:
+ pf = PIPE_FORMAT_NONE;
+ break;
+ }
+
+ if (pf == PIPE_FORMAT_NONE)
+ return NULL;
memset(&templ, 0, sizeof(templ));
templ.target = PIPE_TEXTURE_2D;
- templ.format = format;
+ templ.format = pf;
templ.bind = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW;
templ.width0 = width;
templ.height0 = height;
diff --git a/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.h b/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.h
index 71cb6c52b26..6085875f098 100644
--- a/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.h
+++ b/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.h
@@ -31,8 +31,7 @@
void *
egl_g3d_wl_drm_helper_reference_buffer(void *user_data, uint32_t name,
int32_t width, int32_t height,
- uint32_t stride,
- struct wl_visual *visual);
+ uint32_t stride, uint32_t format);
void
egl_g3d_wl_drm_helper_unreference_buffer(void *user_data, void *buffer);