diff options
Diffstat (limited to 'src/gallium/winsys')
20 files changed, 55 insertions, 991 deletions
diff --git a/src/gallium/winsys/g3dvl/Makefile b/src/gallium/winsys/g3dvl/Makefile deleted file mode 100644 index 424ddea87a..0000000000 --- a/src/gallium/winsys/g3dvl/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -TOP = ../../../.. -include $(TOP)/configs/current - -SUBDIRS = $(GALLIUM_WINSYS_DIRS) - -default install clean: - @for dir in $(SUBDIRS) ; do \ - if [ -d $$dir ] ; then \ - (cd $$dir && $(MAKE) $@) || exit 1; \ - fi \ - done diff --git a/src/gallium/winsys/g3dvl/nouveau/Makefile b/src/gallium/winsys/g3dvl/nouveau/Makefile deleted file mode 100644 index f07a7926d6..0000000000 --- a/src/gallium/winsys/g3dvl/nouveau/Makefile +++ /dev/null @@ -1,43 +0,0 @@ -TARGET = libnouveau_dri.so -GALLIUMDIR = ../../.. -DRMDIR ?= /usr -DRIDIR = ../../../../driclient - -OBJECTS = nouveau_screen_vl.o nouveau_context_vl.o nouveau_swapbuffers.o - -CFLAGS += -g -Wall -Werror=implicit-function-declaration -fPIC \ - -I${GALLIUMDIR}/include \ - -I${GALLIUMDIR}/winsys/g3dvl \ - -I${GALLIUMDIR}/winsys/drm/nouveau \ - -I${DRMDIR}/include \ - -I${DRMDIR}/include/drm \ - -I${DRMDIR}/include/nouveau \ - -I${GALLIUMDIR}/drivers \ - -I${GALLIUMDIR}/auxiliary \ - -I${DRIDIR}/include - -LDFLAGS += -L${DRMDIR}/lib \ - -L${DRIDIR}/lib \ - -L${GALLIUMDIR}/winsys/drm/nouveau/common \ - -L${GALLIUMDIR}/auxiliary \ - -L${GALLIUMDIR}/drivers/nv30 \ - -L${GALLIUMDIR}/drivers/nv40 \ - -L${GALLIUMDIR}/drivers/nv50 - -LIBS += -lnouveaudrm -ldriclient -ldrm_nouveau -ldrm -lnv30 -lnv40 -lnv50 -lgallium -lm - -############################################# - -.PHONY = all clean libdriclient - -all: ${TARGET} - -${TARGET}: ${OBJECTS} libdriclient - $(CC) ${LDFLAGS} -shared -o $@ ${OBJECTS} ${LIBS} - -libdriclient: - cd ${DRIDIR}/src; ${MAKE} - -clean: - cd ${DRIDIR}/src; ${MAKE} clean - rm -rf ${OBJECTS} ${TARGET} diff --git a/src/gallium/winsys/g3dvl/nouveau/nouveau_context_vl.c b/src/gallium/winsys/g3dvl/nouveau/nouveau_context_vl.c deleted file mode 100644 index dfc4905bc0..0000000000 --- a/src/gallium/winsys/g3dvl/nouveau/nouveau_context_vl.c +++ /dev/null @@ -1,172 +0,0 @@ -#include "nouveau_context_vl.h" -#include <pipe/p_defines.h> -#include <pipe/p_context.h> -#include <pipe/p_screen.h> -#include <util/u_memory.h> -#include <common/nouveau_dri.h> -#include <common/nouveau_local.h> -#include <common/nouveau_winsys_pipe.h> -#include "nouveau_screen_vl.h" - -/* -#ifdef DEBUG -static const struct dri_debug_control debug_control[] = { - { "bo", DEBUG_BO }, - { NULL, 0 } -}; -int __nouveau_debug = 0; -#endif -*/ - -int -nouveau_context_create(dri_context_t *dri_context) -{ - dri_screen_t *dri_screen; - struct nouveau_screen_vl *nv_screen; - struct nouveau_context_vl *nv; - - assert (dri_context); - - dri_screen = dri_context->dri_screen; - nv_screen = dri_screen->private; - nv = CALLOC_STRUCT(nouveau_context_vl); - - if (!nv) - return 1; - - if (nouveau_context_init(&nv_screen->base, dri_context->drm_context, - (drmLock*)&dri_screen->sarea->lock, NULL, &nv->base)) - { - FREE(nv); - return 1; - } - - dri_context->private = (void*)nv; - nv->dri_context = dri_context; - nv->nv_screen = nv_screen; - - /* - driParseConfigFiles(&nv->dri_option_cache, &nv_screen->option_cache, - nv->dri_screen->myNum, "nouveau"); -#ifdef DEBUG - __nouveau_debug = driParseDebugString(getenv("NOUVEAU_DEBUG"), - debug_control); -#endif - */ - - nv->base.nvc->pctx[nv->base.pctx_id]->priv = nv; - - return 0; -} - -void -nouveau_context_destroy(dri_context_t *dri_context) -{ - struct nouveau_context_vl *nv = dri_context->private; - - assert(dri_context); - - nouveau_context_cleanup(&nv->base); - - FREE(nv); -} - -int -nouveau_context_bind(struct nouveau_context_vl *nv, dri_drawable_t *dri_drawable) -{ - assert(nv); - assert(dri_drawable); - - if (nv->dri_drawable != dri_drawable) - { - nv->dri_drawable = dri_drawable; - dri_drawable->private = nv; - } - - return 0; -} - -int -nouveau_context_unbind(struct nouveau_context_vl *nv) -{ - assert(nv); - - nv->dri_drawable = NULL; - - return 0; -} - -/* Show starts here */ - -int bind_pipe_drawable(struct pipe_context *pipe, Drawable drawable) -{ - struct nouveau_context_vl *nv; - dri_drawable_t *dri_drawable; - - assert(pipe); - - nv = pipe->priv; - - driCreateDrawable(nv->nv_screen->dri_screen, drawable, &dri_drawable); - - nouveau_context_bind(nv, dri_drawable); - - return 0; -} - -int unbind_pipe_drawable(struct pipe_context *pipe) -{ - assert (pipe); - - nouveau_context_unbind(pipe->priv); - - return 0; -} - -struct pipe_context* create_pipe_context(Display *display, int screen) -{ - dri_screen_t *dri_screen; - dri_framebuffer_t dri_framebuf; - dri_context_t *dri_context; - struct nouveau_context_vl *nv; - - assert(display); - - driCreateScreen(display, screen, &dri_screen, &dri_framebuf); - driCreateContext(dri_screen, XDefaultVisual(display, screen), &dri_context); - - nouveau_screen_create(dri_screen, &dri_framebuf); - nouveau_context_create(dri_context); - - nv = dri_context->private; - - return nv->base.nvc->pctx[nv->base.pctx_id]; -} - -int destroy_pipe_context(struct pipe_context *pipe) -{ - struct pipe_screen *screen; - struct pipe_winsys *winsys; - struct nouveau_context_vl *nv; - dri_screen_t *dri_screen; - dri_context_t *dri_context; - - assert(pipe); - - screen = pipe->screen; - winsys = pipe->winsys; - nv = pipe->priv; - dri_context = nv->dri_context; - dri_screen = dri_context->dri_screen; - - pipe->destroy(pipe); - screen->destroy(screen); - FREE(winsys); - - nouveau_context_destroy(dri_context); - nouveau_screen_destroy(dri_screen); - driDestroyContext(dri_context); - driDestroyScreen(dri_screen); - - return 0; -} diff --git a/src/gallium/winsys/g3dvl/nouveau/nouveau_context_vl.h b/src/gallium/winsys/g3dvl/nouveau/nouveau_context_vl.h deleted file mode 100644 index 1115c3130c..0000000000 --- a/src/gallium/winsys/g3dvl/nouveau/nouveau_context_vl.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __NOUVEAU_CONTEXT_VL_H__ -#define __NOUVEAU_CONTEXT_VL_H__ - -#include <driclient.h> -#include <nouveau/nouveau_winsys.h> -#include <common/nouveau_context.h> - -/*#include "xmlconfig.h"*/ - -struct nouveau_context_vl { - struct nouveau_context base; - struct nouveau_screen_vl *nv_screen; - dri_context_t *dri_context; - dri_drawable_t *dri_drawable; - unsigned int last_stamp; - /*driOptionCache dri_option_cache;*/ - drm_context_t drm_context; - drmLock drm_lock; -}; - -extern int nouveau_context_create(dri_context_t *); -extern void nouveau_context_destroy(dri_context_t *); -extern int nouveau_context_bind(struct nouveau_context_vl *, dri_drawable_t *); -extern int nouveau_context_unbind(struct nouveau_context_vl *); - -#ifdef DEBUG -extern int __nouveau_debug; - -#define DEBUG_BO (1 << 0) - -#define DBG(flag, ...) do { \ - if (__nouveau_debug & (DEBUG_##flag)) \ - NOUVEAU_ERR(__VA_ARGS__); \ -} while(0) -#else -#define DBG(flag, ...) -#endif - -#endif diff --git a/src/gallium/winsys/g3dvl/nouveau/nouveau_screen_vl.c b/src/gallium/winsys/g3dvl/nouveau/nouveau_screen_vl.c deleted file mode 100644 index b7c74f8299..0000000000 --- a/src/gallium/winsys/g3dvl/nouveau/nouveau_screen_vl.c +++ /dev/null @@ -1,88 +0,0 @@ -#include "nouveau_screen_vl.h" -#include <util/u_memory.h> -#include <nouveau_drm.h> -#include <common/nouveau_dri.h> -#include <common/nouveau_local.h> - -#if NOUVEAU_DRM_HEADER_PATCHLEVEL != 12 -#error nouveau_drm.h version does not match expected version -#endif - -/* -PUBLIC const char __driConfigOptions[] = -DRI_CONF_BEGIN -DRI_CONF_END; -static const GLuint __driNConfigOptions = 0; -*/ - -int nouveau_check_dri_drm_ddx(dri_version_t *dri, dri_version_t *drm, dri_version_t *ddx) -{ - static const dri_version_t ddx_expected = {0, 0, NOUVEAU_DRM_HEADER_PATCHLEVEL}; - static const dri_version_t dri_expected = {4, 0, 0}; - static const dri_version_t drm_expected = {0, 0, NOUVEAU_DRM_HEADER_PATCHLEVEL}; - - assert(dri); - assert(drm); - assert(ddx); - - if (dri->major != dri_expected.major || dri->minor < dri_expected.minor) - { - NOUVEAU_ERR("Unexpected DRI version.\n"); - return 1; - } - if (drm->major != drm_expected.major || drm->minor < drm_expected.minor) - { - NOUVEAU_ERR("Unexpected DRM version.\n"); - return 1; - } - if (ddx->major != ddx_expected.major || ddx->minor < ddx_expected.minor) - { - NOUVEAU_ERR("Unexpected DDX version.\n"); - return 1; - } - - return 0; -} - -int -nouveau_screen_create(dri_screen_t *dri_screen, dri_framebuffer_t *dri_framebuf) -{ - struct nouveau_dri *nv_dri = dri_framebuf->private; - struct nouveau_screen_vl *nv_screen; - - assert(dri_screen); - assert(dri_framebuf); - - if (nouveau_check_dri_drm_ddx(&dri_screen->dri, &dri_screen->drm, &dri_screen->ddx)) - return 1; - - nv_screen = CALLOC_STRUCT(nouveau_screen_vl); - - if (!nv_screen) - return 1; - - if (nouveau_screen_init(nv_dri, dri_screen->fd, &nv_screen->base)) - { - FREE(nv_screen); - return 1; - } - - /* - driParseOptionInfo(&nv_screen->option_cache, - __driConfigOptions, __driNConfigOptions); - */ - - nv_screen->dri_screen = dri_screen; - dri_screen->private = (void*)nv_screen; - - return 0; -} - -void -nouveau_screen_destroy(dri_screen_t *dri_screen) -{ - struct nouveau_screen_vl *nv_screen = dri_screen->private; - - nouveau_screen_cleanup(&nv_screen->base); - FREE(nv_screen); -} diff --git a/src/gallium/winsys/g3dvl/nouveau/nouveau_screen_vl.h b/src/gallium/winsys/g3dvl/nouveau/nouveau_screen_vl.h deleted file mode 100644 index 0c1ceca6de..0000000000 --- a/src/gallium/winsys/g3dvl/nouveau/nouveau_screen_vl.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef __NOUVEAU_SCREEN_VL_H__ -#define __NOUVEAU_SCREEN_VL_H__ - -#include <driclient.h> -#include <common/nouveau_screen.h> - -/* TODO: Investigate using DRI options for interesting things */ -/*#include "xmlconfig.h"*/ - -struct nouveau_screen_vl -{ - struct nouveau_screen base; - dri_screen_t *dri_screen; - /*driOptionCache option_cache;*/ -}; - -int nouveau_screen_create(dri_screen_t *dri_screen, dri_framebuffer_t *dri_framebuf); -void nouveau_screen_destroy(dri_screen_t *dri_screen); - -#endif diff --git a/src/gallium/winsys/g3dvl/nouveau/nouveau_swapbuffers.c b/src/gallium/winsys/g3dvl/nouveau/nouveau_swapbuffers.c deleted file mode 100644 index 77e46a2054..0000000000 --- a/src/gallium/winsys/g3dvl/nouveau/nouveau_swapbuffers.c +++ /dev/null @@ -1,94 +0,0 @@ -#include <driclient.h> -#include <common/nouveau_local.h> -#include <common/nouveau_screen.h> -#include "nouveau_context_vl.h" -#include "nouveau_swapbuffers.h" - -void -nouveau_copy_buffer(dri_drawable_t *dri_drawable, struct pipe_surface *surf, - const drm_clip_rect_t *rect) -{ - struct nouveau_context_vl *nv = dri_drawable->private; - struct pipe_context *pipe = nv->base.nvc->pctx[nv->base.pctx_id]; - drm_clip_rect_t *pbox; - int nbox, i; - - LOCK_HARDWARE(&nv->base); - if (!dri_drawable->num_cliprects) { - UNLOCK_HARDWARE(&nv->base); - return; - } - pbox = dri_drawable->cliprects; - nbox = dri_drawable->num_cliprects; - - for (i = 0; i < nbox; i++, pbox++) { - int sx, sy, dx, dy, w, h; - - sx = pbox->x1 - dri_drawable->x; - sy = pbox->y1 - dri_drawable->y; - dx = pbox->x1; - dy = pbox->y1; - w = pbox->x2 - pbox->x1; - h = pbox->y2 - pbox->y1; - - pipe->surface_copy(pipe, nv->base.frontbuffer, - dx, dy, surf, sx, sy, w, h); - } - - FIRE_RING(nv->base.nvc->channel); - UNLOCK_HARDWARE(&nv->base); -} - -void -nouveau_copy_sub_buffer(dri_drawable_t *dri_drawable, struct pipe_surface *surf, int x, int y, int w, int h) -{ - if (surf) { - drm_clip_rect_t rect; - rect.x1 = x; - rect.y1 = y; - rect.x2 = x + w; - rect.y2 = y + h; - - nouveau_copy_buffer(dri_drawable, surf, &rect); - } -} - -void -nouveau_swap_buffers(dri_drawable_t *dri_drawable, struct pipe_surface *surf) -{ - if (surf) - nouveau_copy_buffer(dri_drawable, surf, NULL); -} - -void -nouveau_flush_frontbuffer(struct pipe_winsys *pws, struct pipe_surface *surf, - void *context_private) -{ - struct nouveau_context_vl *nv; - dri_drawable_t *dri_drawable; - - assert(pws); - assert(surf); - assert(context_private); - - nv = context_private; - dri_drawable = nv->dri_drawable; - - nouveau_copy_buffer(dri_drawable, surf, NULL); -} - -void -nouveau_contended_lock(struct nouveau_context *nv) -{ - struct nouveau_context_vl *nv_vl = (struct nouveau_context_vl*)nv; - dri_drawable_t *dri_drawable = nv_vl->dri_drawable; - dri_screen_t *dri_screen = nv_vl->dri_context->dri_screen; - - /* If the window moved, may need to set a new cliprect now. - * - * NOTE: This releases and regains the hw lock, so all state - * checking must be done *after* this call: - */ - if (dri_drawable) - DRI_VALIDATE_DRAWABLE_INFO(dri_screen, dri_drawable); -} diff --git a/src/gallium/winsys/g3dvl/nouveau/nouveau_swapbuffers.h b/src/gallium/winsys/g3dvl/nouveau/nouveau_swapbuffers.h deleted file mode 100644 index 35e934adba..0000000000 --- a/src/gallium/winsys/g3dvl/nouveau/nouveau_swapbuffers.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef __NOUVEAU_SWAPBUFFERS_H__ -#define __NOUVEAU_SWAPBUFFERS_H__ - -extern void nouveau_copy_buffer(dri_drawable_t *, struct pipe_surface *, - const drm_clip_rect_t *); -extern void nouveau_copy_sub_buffer(dri_drawable_t *, struct pipe_surface *, - int x, int y, int w, int h); -extern void nouveau_swap_buffers(dri_drawable_t *, struct pipe_surface *); - -#endif diff --git a/src/gallium/winsys/g3dvl/vl_winsys.h b/src/gallium/winsys/g3dvl/vl_winsys.h deleted file mode 100644 index b4fa0d67a1..0000000000 --- a/src/gallium/winsys/g3dvl/vl_winsys.h +++ /dev/null @@ -1,51 +0,0 @@ -/************************************************************************** - * - * Copyright 2009 Younes Manton. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - -#ifndef vl_winsys_h -#define vl_winsys_h - -#include <X11/Xlib.h> -#include <pipe/p_defines.h> -#include <pipe/p_format.h> - -struct pipe_screen; -struct pipe_video_context; - -struct pipe_screen* -vl_screen_create(Display *display, int screen); - -struct pipe_video_context* -vl_video_create(Display *display, int screen, - struct pipe_screen *p_screen, - enum pipe_video_profile profile, - enum pipe_video_chroma_format chroma_format, - unsigned width, unsigned height); - -Drawable -vl_video_bind_drawable(struct pipe_video_context *vpipe, Drawable drawable); - -#endif diff --git a/src/gallium/winsys/g3dvl/xlib/Makefile b/src/gallium/winsys/g3dvl/xlib/Makefile deleted file mode 100644 index 9877660a27..0000000000 --- a/src/gallium/winsys/g3dvl/xlib/Makefile +++ /dev/null @@ -1,68 +0,0 @@ -# This makefile produces a "stand-alone" libXvMCg3dvl.so which is -# based on Xlib (no DRI HW acceleration) - -TOP = ../../../../.. -include $(TOP)/configs/current - -XVMC_MAJOR = 1 -XVMC_MINOR = 0 -XVMC_LIB = XvMCg3dvl -XVMC_LIB_NAME = lib$(XVMC_LIB).so -XVMC_LIB_DEPS = $(EXTRA_LIB_PATH) -lXvMC -lXv -lX11 -lm - -INCLUDES = -I$(TOP)/src/gallium/include \ - -I$(TOP)/src/gallium/auxiliary \ - -I$(TOP)/src/gallium/drivers \ - -I$(TOP)/src/gallium/winsys/g3dvl - -DEFINES += -DGALLIUM_SOFTPIPE \ - -DGALLIUM_TRACE - -SOURCES = xsp_winsys.c - -# XXX: Hack, if we include libxvmctracker.a in LIBS none of the symbols are -# pulled in by the linker because xsp_winsys.c doesn't refer to them -OBJECTS = $(SOURCES:.c=.o) $(TOP)/src/gallium/state_trackers/xorg/xvmc/*.o - -LIBS = $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \ - $(TOP)/src/gallium/auxiliary/libgallium.a - -.c.o: - $(CC) -c $(INCLUDES) $(DEFINES) $(CFLAGS) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDES) $(DEFINES) $(CFLAGS) $< -o $@ - -.PHONY: default $(TOP)/$(LIB_DIR)/gallium clean - -default: depend $(TOP)/$(LIB_DIR)/gallium $(TOP)/$(LIB_DIR)/gallium/$(XVMC_LIB_NAME) - -$(TOP)/$(LIB_DIR)/gallium: - @mkdir -p $(TOP)/$(LIB_DIR)/gallium - -# Make the libXvMCg3dvl.so library -$(TOP)/$(LIB_DIR)/gallium/$(XVMC_LIB_NAME): $(OBJECTS) $(LIBS) Makefile - $(MKLIB) -o $(XVMC_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ - -major $(XVMC_MAJOR) -minor $(XVMC_MINOR) $(MKLIB_OPTIONS) \ - -install $(TOP)/$(LIB_DIR)/gallium -id $(INSTALL_LIB_DIR)/lib$(XVMC_LIB).1.dylib \ - $(XVMC_LIB_DEPS) $(OBJECTS) $(LIBS) - -depend: $(SOURCES) Makefile - $(RM) depend - touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDES) $(SOURCES) - -#install: default -# $(INSTALL) -d $(INSTALL_DIR)/include/GL -# $(INSTALL) -d $(INSTALL_DIR)/$(LIB_DIR) -# $(INSTALL) -m 644 $(TOP)/include/GL/*.h $(INSTALL_DIR)/include/GL -# @if [ -e $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) ]; then \ -# $(INSTALL) $(TOP)/$(LIB_DIR)/libGL* $(INSTALL_DIR)/$(LIB_DIR); \ -# fi - -clean: Makefile - $(RM) $(TOP)/$(LIB_DIR)/gallium/$(XVMC_LIB_NAME) - $(RM) *.o *~ - $(RM) depend depend.bak - --include depend diff --git a/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c b/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c deleted file mode 100644 index 048af62ed3..0000000000 --- a/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c +++ /dev/null @@ -1,330 +0,0 @@ -/************************************************************************** - * - * Copyright 2009 Younes Manton. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - -#include <vl_winsys.h> -#include <X11/Xutil.h> -#include <util/u_simple_screen.h> -#include <pipe/p_state.h> -#include <util/u_inlines.h> -#include <util/u_format.h> -#include <util/u_memory.h> -#include <util/u_math.h> -#include <softpipe/sp_winsys.h> -#include <softpipe/sp_video_context.h> -#include <softpipe/sp_texture.h> - -/* pipe_winsys implementation */ - -struct xsp_pipe_winsys -{ - struct pipe_winsys base; - Display *display; - int screen; - XImage *fbimage; -}; - -struct xsp_context -{ - Drawable drawable; - - void (*pipe_destroy)(struct pipe_video_context *vpipe); -}; - -struct xsp_buffer -{ - struct pipe_buffer base; - boolean is_user_buffer; - void *data; - void *mapped_data; -}; - -static struct pipe_buffer* xsp_buffer_create(struct pipe_winsys *pws, unsigned alignment, unsigned usage, unsigned size) -{ - struct xsp_buffer *buffer; - - assert(pws); - - buffer = calloc(1, sizeof(struct xsp_buffer)); - pipe_reference_init(&buffer->base.reference, 1); - buffer->base.alignment = alignment; - buffer->base.usage = usage; - buffer->base.size = size; - buffer->data = align_malloc(size, alignment); - - return (struct pipe_buffer*)buffer; -} - -static struct pipe_buffer* xsp_user_buffer_create(struct pipe_winsys *pws, void *data, unsigned size) -{ - struct xsp_buffer *buffer; - - assert(pws); - - buffer = calloc(1, sizeof(struct xsp_buffer)); - pipe_reference_init(&buffer->base.reference, 1); - buffer->base.size = size; - buffer->is_user_buffer = TRUE; - buffer->data = data; - - return (struct pipe_buffer*)buffer; -} - -static void* xsp_buffer_map(struct pipe_winsys *pws, struct pipe_buffer *buffer, unsigned flags) -{ - struct xsp_buffer *xsp_buf = (struct xsp_buffer*)buffer; - - assert(pws); - assert(buffer); - - xsp_buf->mapped_data = xsp_buf->data; - - return xsp_buf->mapped_data; -} - -static void xsp_buffer_unmap(struct pipe_winsys *pws, struct pipe_buffer *buffer) -{ - struct xsp_buffer *xsp_buf = (struct xsp_buffer*)buffer; - - assert(pws); - assert(buffer); - - xsp_buf->mapped_data = NULL; -} - -static void xsp_buffer_destroy(struct pipe_buffer *buffer) -{ - struct xsp_buffer *xsp_buf = (struct xsp_buffer*)buffer; - - assert(buffer); - - if (!xsp_buf->is_user_buffer) - align_free(xsp_buf->data); - - free(xsp_buf); -} - -static struct pipe_buffer* xsp_surface_buffer_create -( - struct pipe_winsys *pws, - unsigned width, - unsigned height, - enum pipe_format format, - unsigned usage, - unsigned tex_usage, - unsigned *stride -) -{ - const unsigned int ALIGNMENT = 1; - unsigned nblocksy; - - nblocksy = util_format_get_nblocksy(format, height); - *stride = align(util_format_get_stride(format, width), ALIGNMENT); - - return pws->buffer_create(pws, ALIGNMENT, usage, - *stride * nblocksy); -} - -static void xsp_fence_reference(struct pipe_winsys *pws, struct pipe_fence_handle **ptr, struct pipe_fence_handle *fence) -{ - assert(pws); - assert(ptr); - assert(fence); -} - -static int xsp_fence_signalled(struct pipe_winsys *pws, struct pipe_fence_handle *fence, unsigned flag) -{ - assert(pws); - assert(fence); - - return 0; -} - -static int xsp_fence_finish(struct pipe_winsys *pws, struct pipe_fence_handle *fence, unsigned flag) -{ - assert(pws); - assert(fence); - - return 0; -} - -static void xsp_flush_frontbuffer(struct pipe_winsys *pws, struct pipe_surface *surface, void *context_private) -{ - struct xsp_pipe_winsys *xsp_winsys; - struct xsp_context *xsp_context; - - assert(pws); - assert(surface); - assert(context_private); - - xsp_winsys = (struct xsp_pipe_winsys*)pws; - xsp_context = (struct xsp_context*)context_private; - xsp_winsys->fbimage->width = surface->width; - xsp_winsys->fbimage->height = surface->height; - xsp_winsys->fbimage->bytes_per_line = surface->width * (xsp_winsys->fbimage->bits_per_pixel >> 3); - xsp_winsys->fbimage->data = (char*)((struct xsp_buffer *)softpipe_texture(surface->texture)->buffer)->data + surface->offset; - - XPutImage - ( - xsp_winsys->display, xsp_context->drawable, - XDefaultGC(xsp_winsys->display, xsp_winsys->screen), - xsp_winsys->fbimage, 0, 0, 0, 0, - surface->width, surface->height - ); - XFlush(xsp_winsys->display); -} - -static const char* xsp_get_name(struct pipe_winsys *pws) -{ - assert(pws); - return "X11 SoftPipe"; -} - -static void xsp_destroy(struct pipe_winsys *pws) -{ - struct xsp_pipe_winsys *xsp_winsys = (struct xsp_pipe_winsys*)pws; - - assert(pws); - - /* XDestroyImage() wants to free the data as well */ - xsp_winsys->fbimage->data = NULL; - - XDestroyImage(xsp_winsys->fbimage); - FREE(xsp_winsys); -} - -/* Called through pipe_video_context::destroy() */ -static void xsp_pipe_destroy(struct pipe_video_context *vpipe) -{ - struct xsp_context *xsp_context; - - assert(vpipe); - - xsp_context = vpipe->priv; - - /* Call the original destroy */ - xsp_context->pipe_destroy(vpipe); - - FREE(xsp_context); -} - -/* Show starts here */ - -Drawable -vl_video_bind_drawable(struct pipe_video_context *vpipe, Drawable drawable) -{ - struct xsp_context *xsp_context; - Drawable old_drawable; - - assert(vpipe); - - xsp_context = vpipe->priv; - old_drawable = xsp_context->drawable; - xsp_context->drawable = drawable; - - return old_drawable; -} - -struct pipe_screen* -vl_screen_create(Display *display, int screen) -{ - struct xsp_pipe_winsys *xsp_winsys; - - assert(display); - - xsp_winsys = CALLOC_STRUCT(xsp_pipe_winsys); - if (!xsp_winsys) - return NULL; - - xsp_winsys->base.buffer_create = xsp_buffer_create; - xsp_winsys->base.user_buffer_create = xsp_user_buffer_create; - xsp_winsys->base.buffer_map = xsp_buffer_map; - xsp_winsys->base.buffer_unmap = xsp_buffer_unmap; - xsp_winsys->base.buffer_destroy = xsp_buffer_destroy; - xsp_winsys->base.surface_buffer_create = xsp_surface_buffer_create; - xsp_winsys->base.fence_reference = xsp_fence_reference; - xsp_winsys->base.fence_signalled = xsp_fence_signalled; - xsp_winsys->base.fence_finish = xsp_fence_finish; - xsp_winsys->base.flush_frontbuffer = xsp_flush_frontbuffer; - xsp_winsys->base.get_name = xsp_get_name; - xsp_winsys->base.destroy = xsp_destroy; - xsp_winsys->display = display; - xsp_winsys->screen = screen; - xsp_winsys->fbimage = XCreateImage - ( - display, - XDefaultVisual(display, screen), - XDefaultDepth(display, screen), - ZPixmap, - 0, - NULL, - 0, /* Don't know the width and height until flush_frontbuffer */ - 0, - 32, - 0 - ); - - if (!xsp_winsys->fbimage) { - FREE(xsp_winsys); - return NULL; - } - - XInitImage(xsp_winsys->fbimage); - - return softpipe_create_screen(&xsp_winsys->base); -} - -struct pipe_video_context* -vl_video_create(Display *display, int screen, - struct pipe_screen *p_screen, - enum pipe_video_profile profile, - enum pipe_video_chroma_format chroma_format, - unsigned width, unsigned height) -{ - struct pipe_video_context *vpipe; - struct xsp_context *xsp_context; - - assert(p_screen); - assert(width && height); - - vpipe = sp_video_create(p_screen, profile, chroma_format, width, height); - if (!vpipe) - return NULL; - - xsp_context = CALLOC_STRUCT(xsp_context); - if (!xsp_context) { - vpipe->destroy(vpipe); - return NULL; - } - - /* Override this so we can free our xsp_context when the pipe is freed */ - xsp_context->pipe_destroy = vpipe->destroy; - vpipe->destroy = xsp_pipe_destroy; - - vpipe->priv = xsp_context; - - return vpipe; -} diff --git a/src/gallium/winsys/nouveau/drm/nouveau_drm_api.c b/src/gallium/winsys/nouveau/drm/nouveau_drm_api.c index 716d4bacd3..6fd6009d3a 100644 --- a/src/gallium/winsys/nouveau/drm/nouveau_drm_api.c +++ b/src/gallium/winsys/nouveau/drm/nouveau_drm_api.c @@ -19,12 +19,16 @@ dri_surface_from_handle(struct drm_api *api, struct pipe_screen *pscreen, unsigned width, unsigned height, unsigned pitch) { struct pipe_surface *ps = NULL; - struct pipe_texture *pt = NULL; - struct pipe_texture tmpl; + struct pipe_resource *pt = NULL; + struct pipe_resource tmpl; struct winsys_handle whandle; + unsigned bind = (PIPE_BIND_SCANOUT | + PIPE_BIND_RENDER_TARGET | + PIPE_BIND_BLIT_DESTINATION | + PIPE_BIND_BLIT_SOURCE); memset(&tmpl, 0, sizeof(tmpl)); - tmpl.tex_usage = PIPE_TEXTURE_USAGE_SCANOUT; + tmpl.bind = bind; tmpl.target = PIPE_TEXTURE_2D; tmpl.last_level = 0; tmpl.depth0 = 1; @@ -36,16 +40,14 @@ dri_surface_from_handle(struct drm_api *api, struct pipe_screen *pscreen, whandle.stride = pitch; whandle.handle = handle; - pt = pscreen->texture_from_handle(pscreen, &tmpl, &whandle); + pt = pscreen->resource_from_handle(pscreen, &tmpl, &whandle); if (!pt) return NULL; - ps = pscreen->get_tex_surface(pscreen, pt, 0, 0, 0, - PIPE_BUFFER_USAGE_GPU_READ | - PIPE_BUFFER_USAGE_GPU_WRITE); + ps = pscreen->get_tex_surface(pscreen, pt, 0, 0, 0, bind); /* we don't need the texture from this point on */ - pipe_texture_reference(&pt, NULL); + pipe_resource_reference(&pt, NULL); return ps; } diff --git a/src/gallium/winsys/radeon/drm/radeon_drm.h b/src/gallium/winsys/radeon/drm/radeon_drm.h index 2dc077c052..78451b6f01 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm.h +++ b/src/gallium/winsys/radeon/drm/radeon_drm.h @@ -37,22 +37,6 @@ struct pipe_screen* radeon_create_screen(struct drm_api* api, int drmFB, struct drm_create_screen_arg *arg); -boolean radeon_buffer_from_texture(struct drm_api* api, - struct pipe_screen* screen, - struct pipe_texture* texture, - struct pipe_buffer** buffer, - unsigned* stride); - -boolean radeon_handle_from_buffer(struct drm_api* api, - struct pipe_screen* screen, - struct pipe_buffer* buffer, - unsigned* handle); - -boolean radeon_global_handle_from_buffer(struct drm_api* api, - struct pipe_screen* screen, - struct pipe_buffer* buffer, - unsigned* handle); - void radeon_destroy_drm_api(struct drm_api* api); /* Guess at whether this chipset should use r300g. diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c b/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c index 5fd20cc775..c9179a3620 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c @@ -72,9 +72,9 @@ radeon_drm_buffer_map(struct pb_buffer *_buf, struct radeon_drm_buffer *buf = radeon_drm_buffer(_buf); int write = 0; - if (flags & PIPE_BUFFER_USAGE_DONTBLOCK) { - if ((_buf->base.usage & PIPE_BUFFER_USAGE_VERTEX) || - (_buf->base.usage & PIPE_BUFFER_USAGE_INDEX)) + if (flags & PIPE_TRANSFER_DONTBLOCK) { + if ((_buf->base.usage & PIPE_BIND_VERTEX_BUFFER) || + (_buf->base.usage & PIPE_BIND_INDEX_BUFFER)) if (radeon_bo_is_referenced_by_cs(buf->bo, buf->mgr->rws->cs)) return NULL; } @@ -82,7 +82,7 @@ radeon_drm_buffer_map(struct pb_buffer *_buf, if (buf->bo->ptr != NULL) return buf->bo->ptr; - if (flags & PIPE_BUFFER_USAGE_DONTBLOCK) { + if (flags & PIPE_TRANSFER_DONTBLOCK) { uint32_t domain; if (radeon_bo_is_busy(buf->bo, &domain)) return NULL; @@ -92,7 +92,7 @@ radeon_drm_buffer_map(struct pb_buffer *_buf, buf->mgr->rws->flush_cb(buf->mgr->rws->flush_data); } - if (flags & PIPE_BUFFER_USAGE_CPU_WRITE) { + if (flags & PIPE_TRANSFER_WRITE) { write = 1; } @@ -148,16 +148,20 @@ static uint32_t radeon_domain_from_usage(unsigned usage) { uint32_t domain = 0; - if (usage & PIPE_BUFFER_USAGE_GPU_WRITE) { + if (usage & PIPE_BIND_RENDER_TARGET) { domain |= RADEON_GEM_DOMAIN_VRAM; } - if (usage & PIPE_BUFFER_USAGE_PIXEL) { + if (usage & PIPE_BIND_DEPTH_STENCIL) { domain |= RADEON_GEM_DOMAIN_VRAM; } - if (usage & PIPE_BUFFER_USAGE_VERTEX) { + if (usage & PIPE_BIND_SAMPLER_VIEW) { + domain |= RADEON_GEM_DOMAIN_VRAM; + } + /* also need BIND_BLIT_SOURCE/DESTINATION ? */ + if (usage & PIPE_BIND_VERTEX_BUFFER) { domain |= RADEON_GEM_DOMAIN_GTT; } - if (usage & PIPE_BUFFER_USAGE_INDEX) { + if (usage & PIPE_BIND_INDEX_BUFFER) { domain |= RADEON_GEM_DOMAIN_GTT; } @@ -187,7 +191,7 @@ struct pb_buffer *radeon_drm_bufmgr_create_buffer_from_handle(struct pb_manager pipe_reference_init(&buf->base.base.reference, 1); buf->base.base.alignment = 0; - buf->base.base.usage = PIPE_BUFFER_USAGE_PIXEL; + buf->base.base.usage = PIPE_BIND_SAMPLER_VIEW; buf->base.base.size = 0; buf->base.vtbl = &radeon_drm_buffer_vtbl; buf->mgr = mgr; diff --git a/src/gallium/winsys/radeon/drm/radeon_r300.c b/src/gallium/winsys/radeon/drm/radeon_r300.c index 935c1d84d0..735b93bc77 100644 --- a/src/gallium/winsys/radeon/drm/radeon_r300.c +++ b/src/gallium/winsys/radeon/drm/radeon_r300.c @@ -42,10 +42,10 @@ radeon_r300_winsys_buffer_create(struct r300_winsys_screen *rws, desc.alignment = alignment; desc.usage = usage; - if (usage & PIPE_BUFFER_USAGE_CONSTANT) + if (usage & PIPE_BIND_CONSTANT_BUFFER) provider = ws->mman; - else if ((usage & PIPE_BUFFER_USAGE_VERTEX) || - (usage & PIPE_BUFFER_USAGE_INDEX)) + else if ((usage & PIPE_BIND_VERTEX_BUFFER) || + (usage & PIPE_BIND_INDEX_BUFFER)) provider = ws->cman; else provider = ws->kman; diff --git a/src/gallium/winsys/sw/dri/dri_sw_winsys.c b/src/gallium/winsys/sw/dri/dri_sw_winsys.c index 870c6afc12..1bca827bd6 100644 --- a/src/gallium/winsys/sw/dri/dri_sw_winsys.c +++ b/src/gallium/winsys/sw/dri/dri_sw_winsys.c @@ -148,7 +148,7 @@ dri_sw_displaytarget_unmap(struct sw_winsys *ws, static struct sw_displaytarget * dri_sw_displaytarget_from_handle(struct sw_winsys *winsys, - const struct pipe_texture *templ, + const struct pipe_resource *templ, struct winsys_handle *whandle, unsigned *stride) { diff --git a/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c b/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c index 4dba4b577b..2e12f6e6cc 100644 --- a/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c +++ b/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c @@ -172,7 +172,7 @@ no_gdt: static struct sw_displaytarget * gdi_sw_displaytarget_from_handle(struct sw_winsys *winsys, - const struct pipe_texture *templet, + const struct pipe_resource *templet, struct winsys_handle *whandle, unsigned *stride) { diff --git a/src/gallium/winsys/sw/null/null_sw_winsys.c b/src/gallium/winsys/sw/null/null_sw_winsys.c index 5027e57b30..157efa9973 100644 --- a/src/gallium/winsys/sw/null/null_sw_winsys.c +++ b/src/gallium/winsys/sw/null/null_sw_winsys.c @@ -91,7 +91,7 @@ null_sw_displaytarget_create(struct sw_winsys *winsys, static struct sw_displaytarget * null_sw_displaytarget_from_handle(struct sw_winsys *winsys, - const struct pipe_texture *templet, + const struct pipe_resource *templet, struct winsys_handle *whandle, unsigned *stride) { diff --git a/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c b/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c index 459b1c1e2a..9a68d9faff 100644 --- a/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c +++ b/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c @@ -57,7 +57,7 @@ struct wrapper_sw_winsys struct wrapper_sw_displaytarget { struct wrapper_sw_winsys *winsys; - struct pipe_texture *tex; + struct pipe_resource *tex; struct pipe_transfer *transfer; unsigned width; @@ -89,26 +89,26 @@ static boolean wsw_dt_get_stride(struct wrapper_sw_displaytarget *wdt, unsigned *stride) { struct pipe_context *pipe = wdt->winsys->pipe; - struct pipe_texture *tex = wdt->tex; + struct pipe_resource *tex = wdt->tex; struct pipe_transfer *tr; - tr = pipe->get_tex_transfer(pipe, tex, 0, 0, 0, - PIPE_TRANSFER_READ_WRITE, - 0, 0, wdt->width, wdt->height); + tr = pipe_get_transfer(pipe, tex, 0, 0, 0, + PIPE_TRANSFER_READ_WRITE, + 0, 0, wdt->width, wdt->height); if (!tr) return FALSE; *stride = tr->stride; wdt->stride = tr->stride; - pipe->tex_transfer_destroy(pipe, tr); + pipe->transfer_destroy(pipe, tr); return TRUE; } static struct sw_displaytarget * wsw_dt_wrap_texture(struct wrapper_sw_winsys *wsw, - struct pipe_texture *tex, unsigned *stride) + struct pipe_resource *tex, unsigned *stride) { struct wrapper_sw_displaytarget *wdt = CALLOC_STRUCT(wrapper_sw_displaytarget); if (!wdt) @@ -125,21 +125,21 @@ wsw_dt_wrap_texture(struct wrapper_sw_winsys *wsw, err_free: FREE(wdt); err_unref: - pipe_texture_reference(&tex, NULL); + pipe_resource_reference(&tex, NULL); return NULL; } static struct sw_displaytarget * wsw_dt_create(struct sw_winsys *ws, - unsigned tex_usage, + unsigned bind, enum pipe_format format, unsigned width, unsigned height, unsigned alignment, unsigned *stride) { struct wrapper_sw_winsys *wsw = wrapper_sw_winsys(ws); - struct pipe_texture templ; - struct pipe_texture *tex; + struct pipe_resource templ; + struct pipe_resource *tex; /* * XXX Why don't we just get the template. @@ -148,11 +148,11 @@ wsw_dt_create(struct sw_winsys *ws, templ.width0 = width; templ.height0 = height; templ.format = format; - templ.tex_usage = tex_usage; + templ.bind = bind; /* XXX alignment: we can't do anything about this */ - tex = wsw->screen->texture_create(wsw->screen, &templ); + tex = wsw->screen->resource_create(wsw->screen, &templ); if (!tex) return NULL; @@ -161,14 +161,14 @@ wsw_dt_create(struct sw_winsys *ws, static struct sw_displaytarget * wsw_dt_from_handle(struct sw_winsys *ws, - const struct pipe_texture *templ, + const struct pipe_resource *templ, struct winsys_handle *whandle, unsigned *stride) { struct wrapper_sw_winsys *wsw = wrapper_sw_winsys(ws); - struct pipe_texture *tex; + struct pipe_resource *tex; - tex = wsw->screen->texture_from_handle(wsw->screen, templ, whandle); + tex = wsw->screen->resource_from_handle(wsw->screen, templ, whandle); if (!tex) return NULL; @@ -182,7 +182,7 @@ wsw_dt_map(struct sw_winsys *ws, { struct wrapper_sw_displaytarget *wdt = wrapper_sw_displaytarget(dt); struct pipe_context *pipe = wdt->winsys->pipe; - struct pipe_texture *tex = wdt->tex; + struct pipe_resource *tex = wdt->tex; struct pipe_transfer *tr; void *ptr; @@ -190,9 +190,9 @@ wsw_dt_map(struct sw_winsys *ws, assert(!wdt->transfer); - tr = pipe->get_tex_transfer(pipe, tex, 0, 0, 0, - PIPE_TRANSFER_READ_WRITE, - 0, 0, wdt->width, wdt->height); + tr = pipe_get_transfer(pipe, tex, 0, 0, 0, + PIPE_TRANSFER_READ_WRITE, + 0, 0, wdt->width, wdt->height); if (!tr) return NULL; @@ -212,7 +212,7 @@ wsw_dt_map(struct sw_winsys *ws, return wdt->ptr; err: - pipe->tex_transfer_destroy(pipe, tr); + pipe->transfer_destroy(pipe, tr); return NULL; } @@ -231,7 +231,7 @@ wsw_dt_unmap(struct sw_winsys *ws, return; pipe->transfer_unmap(pipe, wdt->transfer); - pipe->tex_transfer_destroy(pipe, wdt->transfer); + pipe->transfer_destroy(pipe, wdt->transfer); wdt->transfer = NULL; } @@ -241,7 +241,7 @@ wsw_dt_destroy(struct sw_winsys *ws, { struct wrapper_sw_displaytarget *wdt = wrapper_sw_displaytarget(dt); - pipe_texture_reference(&wdt->tex, NULL); + pipe_resource_reference(&wdt->tex, NULL); FREE(wdt); } diff --git a/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c b/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c index ad843b7def..ec4f919d08 100644 --- a/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c +++ b/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c @@ -49,7 +49,7 @@ #include <X11/extensions/XShm.h> /** - * Subclass of pipe_buffer for Xlib winsys. + * Display target for Xlib winsys. * Low-level OS/window system memory buffer */ struct xm_displaytarget @@ -412,7 +412,7 @@ no_xm_dt: static struct sw_displaytarget * xm_displaytarget_from_handle(struct sw_winsys *winsys, - const struct pipe_texture *templet, + const struct pipe_resource *templet, struct winsys_handle *whandle, unsigned *stride) { |