From 8ebc795ec4265577fe67185a32d8985debda076a Mon Sep 17 00:00:00 2001 From: Younes Manton Date: Thu, 5 Nov 2009 23:58:29 -0500 Subject: [PATCH] g3dvl: Shared drm winsys bits. --- src/gallium/winsys/Makefile | 2 +- src/gallium/winsys/g3dvl/Makefile | 3 +- src/gallium/winsys/g3dvl/dri/Makefile | 14 ++ .../winsys/g3dvl/dri}/XF86dri.c | 0 .../drm_nouveau_winsys.c => dri/dri_winsys.c} | 0 .../winsys/g3dvl/dri}/driclient.c | 0 .../winsys/g3dvl/dri}/driclient.h | 0 .../winsys/g3dvl/dri}/xf86dri.h | 0 .../winsys/g3dvl/dri}/xf86dristr.h | 0 src/gallium/winsys/g3dvl/drm/Makefile | 12 ++ .../Makefile => drm/Makefile.template} | 36 +--- src/gallium/winsys/g3dvl/drm/nouveau/Makefile | 26 +++ .../winsys/g3dvl/nouveau/nouveau_context_vl.c | 172 ------------------ .../winsys/g3dvl/nouveau/nouveau_context_vl.h | 39 ---- .../winsys/g3dvl/nouveau/nouveau_screen_vl.c | 88 --------- .../winsys/g3dvl/nouveau/nouveau_screen_vl.h | 20 -- .../g3dvl/nouveau/nouveau_swapbuffers.c | 94 ---------- .../g3dvl/nouveau/nouveau_swapbuffers.h | 10 - 18 files changed, 60 insertions(+), 456 deletions(-) create mode 100644 src/gallium/winsys/g3dvl/dri/Makefile rename src/{driclient/src => gallium/winsys/g3dvl/dri}/XF86dri.c (100%) rename src/gallium/winsys/g3dvl/{nouveau/drm_nouveau_winsys.c => dri/dri_winsys.c} (100%) rename src/{driclient/src => gallium/winsys/g3dvl/dri}/driclient.c (100%) rename src/{driclient/include => gallium/winsys/g3dvl/dri}/driclient.h (100%) rename src/{driclient/include => gallium/winsys/g3dvl/dri}/xf86dri.h (100%) rename src/{driclient/src => gallium/winsys/g3dvl/dri}/xf86dristr.h (100%) create mode 100644 src/gallium/winsys/g3dvl/drm/Makefile rename src/gallium/winsys/g3dvl/{nouveau/Makefile => drm/Makefile.template} (65%) create mode 100644 src/gallium/winsys/g3dvl/drm/nouveau/Makefile delete mode 100644 src/gallium/winsys/g3dvl/nouveau/nouveau_context_vl.c delete mode 100644 src/gallium/winsys/g3dvl/nouveau/nouveau_context_vl.h delete mode 100644 src/gallium/winsys/g3dvl/nouveau/nouveau_screen_vl.c delete mode 100644 src/gallium/winsys/g3dvl/nouveau/nouveau_screen_vl.h delete mode 100644 src/gallium/winsys/g3dvl/nouveau/nouveau_swapbuffers.c delete mode 100644 src/gallium/winsys/g3dvl/nouveau/nouveau_swapbuffers.h diff --git a/src/gallium/winsys/Makefile b/src/gallium/winsys/Makefile index bce5b3f9e0d..e7cb154b84b 100644 --- a/src/gallium/winsys/Makefile +++ b/src/gallium/winsys/Makefile @@ -2,7 +2,7 @@ TOP = ../../.. include $(TOP)/configs/current -SUBDIRS = $(GALLIUM_WINSYS_DIRS) +SUBDIRS = $(GALLIUM_WINSYS_DIRS) g3dvl default install clean: @for dir in $(SUBDIRS) ; do \ diff --git a/src/gallium/winsys/g3dvl/Makefile b/src/gallium/winsys/g3dvl/Makefile index 424ddea87ad..6c793e0f15b 100644 --- a/src/gallium/winsys/g3dvl/Makefile +++ b/src/gallium/winsys/g3dvl/Makefile @@ -1,7 +1,8 @@ +# src/gallium/winsys/Makefile TOP = ../../../.. include $(TOP)/configs/current -SUBDIRS = $(GALLIUM_WINSYS_DIRS) +SUBDIRS = $(GALLIUM_STATE_TRACKERS_DIRS) $(GALLIUM_WINSYS_DIRS) default install clean: @for dir in $(SUBDIRS) ; do \ diff --git a/src/gallium/winsys/g3dvl/dri/Makefile b/src/gallium/winsys/g3dvl/dri/Makefile new file mode 100644 index 00000000000..dcd58ef6d2e --- /dev/null +++ b/src/gallium/winsys/g3dvl/dri/Makefile @@ -0,0 +1,14 @@ +TOP = ../../../../.. +include $(TOP)/configs/current + +LIBNAME = vldri + +LIBRARY_INCLUDES = -I$(TOP)/src/gallium/winsys/g3dvl \ + $(shell pkg-config libdrm --cflags-only-I) + +C_SOURCES = \ + driclient.c \ + XF86dri.c \ + dri_winsys.c + +include ../../../Makefile.template diff --git a/src/driclient/src/XF86dri.c b/src/gallium/winsys/g3dvl/dri/XF86dri.c similarity index 100% rename from src/driclient/src/XF86dri.c rename to src/gallium/winsys/g3dvl/dri/XF86dri.c diff --git a/src/gallium/winsys/g3dvl/nouveau/drm_nouveau_winsys.c b/src/gallium/winsys/g3dvl/dri/dri_winsys.c similarity index 100% rename from src/gallium/winsys/g3dvl/nouveau/drm_nouveau_winsys.c rename to src/gallium/winsys/g3dvl/dri/dri_winsys.c diff --git a/src/driclient/src/driclient.c b/src/gallium/winsys/g3dvl/dri/driclient.c similarity index 100% rename from src/driclient/src/driclient.c rename to src/gallium/winsys/g3dvl/dri/driclient.c diff --git a/src/driclient/include/driclient.h b/src/gallium/winsys/g3dvl/dri/driclient.h similarity index 100% rename from src/driclient/include/driclient.h rename to src/gallium/winsys/g3dvl/dri/driclient.h diff --git a/src/driclient/include/xf86dri.h b/src/gallium/winsys/g3dvl/dri/xf86dri.h similarity index 100% rename from src/driclient/include/xf86dri.h rename to src/gallium/winsys/g3dvl/dri/xf86dri.h diff --git a/src/driclient/src/xf86dristr.h b/src/gallium/winsys/g3dvl/dri/xf86dristr.h similarity index 100% rename from src/driclient/src/xf86dristr.h rename to src/gallium/winsys/g3dvl/dri/xf86dristr.h diff --git a/src/gallium/winsys/g3dvl/drm/Makefile b/src/gallium/winsys/g3dvl/drm/Makefile new file mode 100644 index 00000000000..0711f44d8e3 --- /dev/null +++ b/src/gallium/winsys/g3dvl/drm/Makefile @@ -0,0 +1,12 @@ +# src/gallium/winsys/Makefile +TOP = ../../../../.. +include $(TOP)/configs/current + +SUBDIRS = $(GALLIUM_WINSYS_DRM_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/drm/Makefile.template similarity index 65% rename from src/gallium/winsys/g3dvl/nouveau/Makefile rename to src/gallium/winsys/g3dvl/drm/Makefile.template index 4eba18a0d5c..a33d95677c5 100644 --- a/src/gallium/winsys/g3dvl/nouveau/Makefile +++ b/src/gallium/winsys/g3dvl/drm/Makefile.template @@ -1,34 +1,9 @@ -# This makefile produces a libXvMCg3dvl.so which is -# based on DRM/DRI - -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 -SOURCES = drm_nouveau_winsys.c - -DRIVER_INCLUDES = $(shell pkg-config libdrm libdrm_nouveau --cflags-only-I) \ - -I$(TOP)/src/gallium/winsys/drm/nouveau \ - -I$(TOP)/src/driclient/include -DRIVER_DEFINES = $(shell pkg-config libdrm libdrm_nouveau --cflags-only-other) - -PIPE_DRIVERS = \ - $(TOP)/src/gallium/winsys/drm/nouveau/drm/libnouveaudrm.a \ - $(TOP)/src/gallium/drivers/nv04/libnv04.a \ - $(TOP)/src/gallium/drivers/nv10/libnv10.a \ - $(TOP)/src/gallium/drivers/nv20/libnv20.a \ - $(TOP)/src/gallium/drivers/nv30/libnv30.a \ - $(TOP)/src/gallium/drivers/nv40/libnv40.a \ - $(TOP)/src/gallium/drivers/nv50/libnv50.a \ - $(TOP)/src/gallium/drivers/nouveau/libnouveau.a - -DRI_LIB_DEPS += $(shell pkg-config libdrm_nouveau --libs) - ############################################################### INCLUDES = $(DRIVER_INCLUDES) \ @@ -36,7 +11,7 @@ INCLUDES = $(DRIVER_INCLUDES) \ -I$(TOP)/src/gallium/auxiliary \ -I$(TOP)/src/gallium/drivers \ -I$(TOP)/src/gallium/winsys/g3dvl \ - -I$(TOP)/src/driclient/include + -I$(TOP)/src/gallium/winsys/g3dvl/dri DEFINES += $(DRIVER_DEFINES) \ -DGALLIUM_SOFTPIPE \ @@ -44,11 +19,10 @@ DEFINES += $(DRIVER_DEFINES) \ # 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 +OBJECTS = $(C_SOURCES:.c=.o) $(TOP)/src/gallium/state_trackers/xorg/xvmc/*.o -LIBS = $(PIPE_DRIVERS) \ - $(TOP)/src/driclient/lib/libdriclient.a \ - $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \ +LIBS = $(TOP)/src/gallium/winsys/g3dvl/dri/libvldri.a \ + $(PIPE_DRIVERS) \ $(TOP)/src/gallium/auxiliary/vl/libvl.a \ $(TOP)/src/gallium/auxiliary/draw/libdraw.a \ $(TOP)/src/gallium/auxiliary/tgsi/libtgsi.a \ @@ -75,7 +49,7 @@ $(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) $(DRI_LIB_DEPS) $(OBJECTS) $(LIBS) + $(XVMC_LIB_DEPS) $(DRIVER_LIB_DEPS) $(OBJECTS) $(LIBS) depend: $(SOURCES) Makefile $(RM) depend diff --git a/src/gallium/winsys/g3dvl/drm/nouveau/Makefile b/src/gallium/winsys/g3dvl/drm/nouveau/Makefile new file mode 100644 index 00000000000..7ff448421a6 --- /dev/null +++ b/src/gallium/winsys/g3dvl/drm/nouveau/Makefile @@ -0,0 +1,26 @@ +# This makefile produces a libXvMCg3dvl.so which is +# based on DRM/DRI + +TOP = ../../../../../.. +include $(TOP)/configs/current + +C_SOURCES = + +DRIVER_INCLUDES = $(shell pkg-config libdrm libdrm_nouveau --cflags-only-I) \ + -I$(TOP)/src/gallium/winsys/drm/nouveau \ +DRIVER_DEFINES = $(shell pkg-config libdrm libdrm_nouveau --cflags-only-other) + +PIPE_DRIVERS = \ + $(TOP)/src/gallium/winsys/drm/nouveau/drm/libnouveaudrm.a \ + $(TOP)/src/gallium/drivers/nv04/libnv04.a \ + $(TOP)/src/gallium/drivers/nv10/libnv10.a \ + $(TOP)/src/gallium/drivers/nv20/libnv20.a \ + $(TOP)/src/gallium/drivers/nv30/libnv30.a \ + $(TOP)/src/gallium/drivers/nv40/libnv40.a \ + $(TOP)/src/gallium/drivers/nv50/libnv50.a \ + $(TOP)/src/gallium/drivers/nouveau/libnouveau.a \ + $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a + +DRIVER_LIB_DEPS += $(shell pkg-config libdrm_nouveau --libs) + +include ../Makefile.template 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 dfc4905bc03..00000000000 --- a/src/gallium/winsys/g3dvl/nouveau/nouveau_context_vl.c +++ /dev/null @@ -1,172 +0,0 @@ -#include "nouveau_context_vl.h" -#include -#include -#include -#include -#include -#include -#include -#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 1115c3130cb..00000000000 --- 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 -#include -#include - -/*#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 b7c74f8299b..00000000000 --- a/src/gallium/winsys/g3dvl/nouveau/nouveau_screen_vl.c +++ /dev/null @@ -1,88 +0,0 @@ -#include "nouveau_screen_vl.h" -#include -#include -#include -#include - -#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 0c1ceca6dee..00000000000 --- 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 -#include - -/* 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 77e46a2054b..00000000000 --- a/src/gallium/winsys/g3dvl/nouveau/nouveau_swapbuffers.c +++ /dev/null @@ -1,94 +0,0 @@ -#include -#include -#include -#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 35e934adba8..00000000000 --- 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 -- 2.30.2