[PATCH 4/5] remove previous create/release_buffer
Halley Zhao
halley.zhao at intel.com
Thu Apr 19 02:35:27 PDT 2012
implementation
from dri
---
src/egl/drivers/dri2/egl_dri2.c | 42
-----------------
src/egl/wayland/wayland-drm/wayland-drm.h | 6 ---
.../egl/common/native_wayland_drm_bufmgr_helper.c | 48
--------------------
.../egl/common/native_wayland_drm_bufmgr_helper.h | 9 ----
src/gallium/state_trackers/egl/drm/native_drm.c | 2 -
.../state_trackers/egl/wayland/native_drm.c | 2 -
src/gallium/state_trackers/egl/x11/native_dri2.c | 2 -
7 files changed, 0 insertions(+), 111 deletions(-)
diff --git a/src/egl/drivers/dri2/egl_dri2.c
b/src/egl/drivers/dri2/egl_dri2.c
index 9065c42..a49b618 100755
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1260,50 +1260,8 @@ dri2_export_drm_image_mesa(_EGLDriver *drv,
_EGLDisplay *disp, _EGLImage *img,
}
#ifdef HAVE_WAYLAND_PLATFORM
-
-static void *
-dri2_wl_reference_buffer(void *user_data, uint32_t name,
- int32_t width, int32_t height,
- uint32_t stride, uint32_t format)
-{
- _EGLDisplay *disp = user_data;
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
- __DRIimage *image;
- int dri_format;
-
- switch (format) {
- case WL_GBM_FORMAT_ARGB8888:
- dri_format =__DRI_IMAGE_FORMAT_ARGB8888;
- break;
- case WL_GBM_FORMAT_XRGB8888:
- dri_format = __DRI_IMAGE_FORMAT_XRGB8888;
- break;
- default:
- return NULL;
- }
-
- image = dri2_dpy->image->createImageFromName(dri2_dpy->dri_screen,
- width, height,
- dri_format, name, stride / 4,
- NULL);
-
- return image;
-}
-
-static void
-dri2_wl_release_buffer(void *user_data, void *buffer)
-{
- _EGLDisplay *disp = user_data;
- __DRIimage *image = buffer;
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
-
- dri2_dpy->image->destroyImage(image);
-}
-
static struct wl_gbm_callbacks wl_gbm_callbacks = {
.authenticate = NULL,
- .reference_buffer = dri2_wl_reference_buffer,
- .release_buffer = dri2_wl_release_buffer
};
static EGLBoolean
diff --git a/src/egl/wayland/wayland-drm/wayland-drm.h
b/src/egl/wayland/wayland-drm/wayland-drm.h
index 75447aa..5498b79 100644
--- a/src/egl/wayland/wayland-drm/wayland-drm.h
+++ b/src/egl/wayland/wayland-drm/wayland-drm.h
@@ -8,12 +8,6 @@ struct wl_gbm;
struct wl_gbm_callbacks {
int (*authenticate)(void *user_data, uint32_t id);
-
- void *(*reference_buffer)(void *user_data, uint32_t name,
- int32_t width, int32_t height,
- uint32_t stride, uint32_t format);
-
- void (*release_buffer)(void *user_data, void *buffer);
};
struct wl_gbm *
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 1db7ff5..15463ec 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
@@ -12,54 +12,6 @@
#include "native_wayland_drm_bufmgr_helper.h"
-void *
-egl_g3d_wl_gbm_helper_reference_buffer(void *user_data, uint32_t name,
- int32_t width, int32_t height,
- uint32_t stride, uint32_t
format)
-{
- struct native_display *ndpy = user_data;
- struct pipe_resource templ;
- struct winsys_handle wsh;
- enum pipe_format pf;
-
- switch (format) {
- case WL_GBM_FORMAT_ARGB8888:
- pf = PIPE_FORMAT_B8G8R8A8_UNORM;
- break;
- case WL_GBM_FORMAT_XRGB8888:
- 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 = pf;
- templ.bind = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW;
- templ.width0 = width;
- templ.height0 = height;
- templ.depth0 = 1;
- templ.array_size = 1;
-
- memset(&wsh, 0, sizeof(wsh));
- wsh.handle = name;
- wsh.stride = stride;
-
- return ndpy->screen->resource_from_handle(ndpy->screen, &templ,
&wsh);
-}
-
-void
-egl_g3d_wl_gbm_helper_unreference_buffer(void *user_data, void *buffer)
-{
- struct pipe_resource *resource = buffer;
-
- pipe_resource_reference(&resource, NULL);
-}
struct pipe_resource *
egl_g3d_wl_gbm_common_wl_buffer_get_resource(struct native_display
*ndpy,
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 4d9a41d..57867eb 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
@@ -27,15 +27,6 @@
#define _NATIVE_WAYLAND_GBM_BUFMGR_HELPER_H_
#include "wayland-drm.h"
-
-void *
-egl_g3d_wl_gbm_helper_reference_buffer(void *user_data, uint32_t name,
- int32_t width, int32_t height,
- uint32_t stride, uint32_t
format);
-
-void
-egl_g3d_wl_gbm_helper_unreference_buffer(void *user_data, void
*buffer);
-
struct pipe_resource *
egl_g3d_wl_gbm_common_wl_buffer_get_resource(struct native_display
*ndpy,
struct wl_buffer *buffer);
diff --git a/src/gallium/state_trackers/egl/drm/native_drm.c
b/src/gallium/state_trackers/egl/drm/native_drm.c
index 7d9deac..4540287 100755
--- a/src/gallium/state_trackers/egl/drm/native_drm.c
+++ b/src/gallium/state_trackers/egl/drm/native_drm.c
@@ -199,8 +199,6 @@ drm_display_authenticate(void *user_data, uint32_t
magic)
static struct wl_gbm_callbacks wl_gbm_callbacks = {
drm_display_authenticate,
- egl_g3d_wl_gbm_helper_reference_buffer,
- egl_g3d_wl_gbm_helper_unreference_buffer
};
static boolean
diff --git a/src/gallium/state_trackers/egl/wayland/native_drm.c
b/src/gallium/state_trackers/egl/wayland/native_drm.c
index 6738b2b..a692654 100644
--- a/src/gallium/state_trackers/egl/wayland/native_drm.c
+++ b/src/gallium/state_trackers/egl/wayland/native_drm.c
@@ -249,8 +249,6 @@ wayland_drm_display_authenticate(void *user_data,
uint32_t magic)
static struct wl_gbm_callbacks wl_gbm_callbacks = {
wayland_drm_display_authenticate,
- egl_g3d_wl_gbm_helper_reference_buffer,
- egl_g3d_wl_gbm_helper_unreference_buffer
};
static boolean
diff --git a/src/gallium/state_trackers/egl/x11/native_dri2.c
b/src/gallium/state_trackers/egl/x11/native_dri2.c
index cfd3c95..c7b6b5f 100755
--- a/src/gallium/state_trackers/egl/x11/native_dri2.c
+++ b/src/gallium/state_trackers/egl/x11/native_dri2.c
@@ -849,8 +849,6 @@ dri2_display_authenticate(void *user_data, uint32_t
magic)
static struct wl_gbm_callbacks wl_gbm_callbacks = {
dri2_display_authenticate,
- egl_g3d_wl_gbm_helper_reference_buffer,
- egl_g3d_wl_gbm_helper_unreference_buffer
};
static boolean
--
1.7.5.4
More information about the wayland-devel
mailing list