diff options
author | Chia-I Wu <[email protected]> | 2011-09-07 21:41:30 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2011-09-08 01:26:24 +0800 |
commit | 6b52e82768b68dd75bfda9637f0154c5425171ed (patch) | |
tree | 8730d948a445e3b21c856e5d69bc45223c0ed966 /src/gallium/state_trackers/egl/wayland | |
parent | b89bca6d8b84e7922f44258c41e37997775f98c9 (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/wayland')
-rw-r--r-- | src/gallium/state_trackers/egl/wayland/native_drm.c | 23 | ||||
-rw-r--r-- | src/gallium/state_trackers/egl/wayland/native_shm.c | 15 |
2 files changed, 24 insertions, 14 deletions
diff --git a/src/gallium/state_trackers/egl/wayland/native_drm.c b/src/gallium/state_trackers/egl/wayland/native_drm.c index 7a5b33affd8..05c32f47734 100644 --- a/src/gallium/state_trackers/egl/wayland/native_drm.c +++ b/src/gallium/state_trackers/egl/wayland/native_drm.c @@ -97,7 +97,7 @@ wayland_create_drm_buffer(struct wayland_display *display, struct pipe_resource *resource; struct winsys_handle wsh; uint width, height; - struct wl_visual *visual; + uint32_t format; resource = resource_surface_get_single_resource(surface->rsurf, attachment); resource_surface_get_size(surface->rsurf, &width, &height); @@ -107,19 +107,21 @@ wayland_create_drm_buffer(struct wayland_display *display, pipe_resource_reference(&resource, NULL); - switch (surface->type) { - case WL_WINDOW_SURFACE: - visual = surface->win->visual; + switch (surface->color_format) { + case PIPE_FORMAT_B8G8R8A8_UNORM: + /* assume premultiplied */ + format = WL_DRM_FORMAT_PREMULTIPLIED_ARGB32; break; - case WL_PIXMAP_SURFACE: - visual = surface->pix->visual; + case PIPE_FORMAT_B8G8R8X8_UNORM: + format = WL_DRM_FORMAT_XRGB32; break; default: return NULL; + break; } return wl_drm_create_buffer(drmdpy->wl_drm, wsh.handle, - width, height, wsh.stride, visual); + width, height, wsh.stride, format); } static void @@ -144,6 +146,12 @@ drm_handle_device(void *data, struct wl_drm *drm, const char *device) } static void +drm_handle_format(void *data, struct wl_drm *drm, uint32_t format) +{ + /* TODO */ +} + +static void drm_handle_authenticated(void *data, struct wl_drm *drm) { struct wayland_drm_display *drmdpy = data; @@ -153,6 +161,7 @@ drm_handle_authenticated(void *data, struct wl_drm *drm) static const struct wl_drm_listener drm_listener = { drm_handle_device, + drm_handle_format, drm_handle_authenticated }; diff --git a/src/gallium/state_trackers/egl/wayland/native_shm.c b/src/gallium/state_trackers/egl/wayland/native_shm.c index 018fbe8e0ef..598df9fe2ce 100644 --- a/src/gallium/state_trackers/egl/wayland/native_shm.c +++ b/src/gallium/state_trackers/egl/wayland/native_shm.c @@ -84,7 +84,7 @@ wayland_create_shm_buffer(struct wayland_display *display, struct pipe_resource *resource; struct winsys_handle wsh; uint width, height; - struct wl_visual *visual; + uint32_t format; resource = resource_surface_get_single_resource(surface->rsurf, attachment); resource_surface_get_size(surface->rsurf, &width, &height); @@ -93,20 +93,21 @@ wayland_create_shm_buffer(struct wayland_display *display, pipe_resource_reference(&resource, NULL); - switch (surface->type) { - case WL_WINDOW_SURFACE: - visual = surface->win->visual; + switch (surface->color_format) { + case PIPE_FORMAT_B8G8R8A8_UNORM: + format = WL_SHM_FORMAT_PREMULTIPLIED_ARGB32; break; - case WL_PIXMAP_SURFACE: - visual = surface->pix->visual; + case PIPE_FORMAT_B8G8R8X8_UNORM: + format = WL_SHM_FORMAT_XRGB32; break; default: return NULL; + break; } return wl_shm_create_buffer(shmdpy->wl_shm, wsh.fd, width, height, - wsh.stride, visual); + wsh.stride, format); } static boolean |