summaryrefslogtreecommitdiff
path: root/src/gallium/winsys/drm/nouveau/drm
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/winsys/drm/nouveau/drm')
-rw-r--r--src/gallium/winsys/drm/nouveau/drm/Makefile4
-rw-r--r--src/gallium/winsys/drm/nouveau/drm/nouveau_dri.h28
-rw-r--r--src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c167
-rw-r--r--src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.h29
-rw-r--r--src/gallium/winsys/drm/nouveau/drm/nouveau_winsys.c94
-rw-r--r--src/gallium/winsys/drm/nouveau/drm/nouveau_winsys_pipe.c204
-rw-r--r--src/gallium/winsys/drm/nouveau/drm/nouveau_winsys_pipe.h52
7 files changed, 183 insertions, 395 deletions
diff --git a/src/gallium/winsys/drm/nouveau/drm/Makefile b/src/gallium/winsys/drm/nouveau/drm/Makefile
index 2da78d8690..54c3b26c75 100644
--- a/src/gallium/winsys/drm/nouveau/drm/Makefile
+++ b/src/gallium/winsys/drm/nouveau/drm/Makefile
@@ -3,9 +3,7 @@ include $(TOP)/configs/current
LIBNAME = nouveaudrm
-C_SOURCES = nouveau_drm_api.c \
- nouveau_winsys_pipe.c \
- nouveau_winsys.c
+C_SOURCES = nouveau_drm_api.c
LIBRARY_INCLUDES = $(shell pkg-config libdrm libdrm_nouveau --cflags-only-I)
LIBRARY_DEFINES = $(shell pkg-config libdrm libdrm_nouveau --cflags-only-other)
diff --git a/src/gallium/winsys/drm/nouveau/drm/nouveau_dri.h b/src/gallium/winsys/drm/nouveau/drm/nouveau_dri.h
new file mode 100644
index 0000000000..1207c2d609
--- /dev/null
+++ b/src/gallium/winsys/drm/nouveau/drm/nouveau_dri.h
@@ -0,0 +1,28 @@
+#ifndef _NOUVEAU_DRI_
+#define _NOUVEAU_DRI_
+
+#include "xf86drm.h"
+#include "drm.h"
+#include "nouveau_drm.h"
+
+struct nouveau_dri {
+ uint32_t device_id; /**< \brief PCI device ID */
+ uint32_t width; /**< \brief width in pixels of display */
+ uint32_t height; /**< \brief height in scanlines of display */
+ uint32_t depth; /**< \brief depth of display (8, 15, 16, 24) */
+ uint32_t bpp; /**< \brief bit depth of display (8, 16, 24, 32) */
+
+ uint32_t bus_type; /**< \brief ths bus type */
+ uint32_t bus_mode; /**< \brief bus mode (used for AGP, maybe also for PCI-E ?) */
+
+ uint32_t front_offset; /**< \brief front buffer offset */
+ uint32_t front_pitch; /**< \brief front buffer pitch */
+ uint32_t back_offset; /**< \brief private back buffer offset */
+ uint32_t back_pitch; /**< \brief private back buffer pitch */
+ uint32_t depth_offset; /**< \brief private depth buffer offset */
+ uint32_t depth_pitch; /**< \brief private depth buffer pitch */
+
+};
+
+#endif
+
diff --git a/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c b/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c
index a558fda140..395b21ec7a 100644
--- a/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c
+++ b/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c
@@ -1,20 +1,83 @@
+#include "pipe/p_context.h"
+#include "pipe/p_state.h"
#include "util/u_memory.h"
#include "nouveau_drm_api.h"
-#include "nouveau_winsys_pipe.h"
#include "nouveau_drmif.h"
#include "nouveau_channel.h"
#include "nouveau_bo.h"
+#include "nouveau/nouveau_winsys.h"
+#include "nouveau/nouveau_screen.h"
+
+static struct pipe_surface *
+dri_surface_from_handle(struct pipe_screen *screen,
+ unsigned handle,
+ enum pipe_format format,
+ unsigned width,
+ unsigned height,
+ unsigned pitch)
+{
+ struct pipe_surface *surface = NULL;
+ struct pipe_texture *texture = NULL;
+ struct pipe_texture templat;
+ struct pipe_buffer *buf = NULL;
+
+ buf = drm_api_hooks.buffer_from_handle(screen, "front buffer", handle);
+ if (!buf)
+ return NULL;
+
+ memset(&templat, 0, sizeof(templat));
+ templat.tex_usage = PIPE_TEXTURE_USAGE_PRIMARY |
+ NOUVEAU_TEXTURE_USAGE_LINEAR;
+ templat.target = PIPE_TEXTURE_2D;
+ templat.last_level = 0;
+ templat.depth[0] = 1;
+ templat.format = format;
+ templat.width[0] = width;
+ templat.height[0] = height;
+ pf_get_block(templat.format, &templat.block);
+
+ texture = screen->texture_blanket(screen,
+ &templat,
+ &pitch,
+ buf);
+
+ /* we don't need the buffer from this point on */
+ pipe_buffer_reference(&buf, NULL);
+
+ if (!texture)
+ return NULL;
+
+ surface = screen->get_tex_surface(screen, texture, 0, 0, 0,
+ PIPE_BUFFER_USAGE_GPU_READ |
+ PIPE_BUFFER_USAGE_GPU_WRITE);
+
+ /* we don't need the texture from this point on */
+ pipe_texture_reference(&texture, NULL);
+ return surface;
+}
+
+static struct pipe_surface *
+nouveau_dri1_front_surface(struct pipe_context *pipe)
+{
+ return nouveau_winsys_screen(pipe->screen)->front;
+}
+
+static struct dri1_api nouveau_dri1_api = {
+ nouveau_dri1_front_surface,
+};
+
static struct pipe_screen *
nouveau_drm_create_screen(int fd, struct drm_create_screen_arg *arg)
{
- struct pipe_winsys *ws;
+ struct dri1_create_screen_arg *dri1 = (void *)arg;
struct nouveau_winsys *nvws;
+ struct pipe_winsys *ws;
struct nouveau_device *dev = NULL;
struct pipe_screen *(*init)(struct pipe_winsys *,
- struct nouveau_winsys *);
+ struct nouveau_device *);
int ret;
ret = nouveau_device_open_existing(&dev, 0, fd, 0);
@@ -49,33 +112,54 @@ nouveau_drm_create_screen(int fd, struct drm_create_screen_arg *arg)
return NULL;
}
- ws = nouveau_pipe_winsys_new(dev);
- if (!ws) {
+ nvws = CALLOC_STRUCT(nouveau_winsys);
+ if (!nvws) {
nouveau_device_close(&dev);
return NULL;
}
+ ws = &nvws->base;
- nvws = nouveau_winsys_new(ws);
- if (!nvws) {
+ nvws->pscreen = init(ws, dev);
+ if (!nvws->pscreen) {
ws->destroy(ws);
return NULL;
}
- nouveau_pipe_winsys(ws)->pscreen = init(ws, nvws);
- if (!nouveau_pipe_winsys(ws)->pscreen) {
- ws->destroy(ws);
- return NULL;
+ if (arg->mode == DRM_CREATE_DRI1) {
+ struct nouveau_dri *nvdri = dri1->ddx_info;
+ enum pipe_format format;
+
+ if (nvdri->bpp == 16)
+ format = PIPE_FORMAT_R5G6B5_UNORM;
+ else
+ format = PIPE_FORMAT_A8R8G8B8_UNORM;
+
+ nvws->front = dri_surface_from_handle(nvws->pscreen,
+ nvdri->front_offset,
+ format,
+ nvdri->width,
+ nvdri->height,
+ nvdri->front_pitch *
+ (nvdri->bpp / 8));
+ if (!nvws->front) {
+ debug_printf("%s: error referencing front buffer\n",
+ __func__);
+ ws->destroy(ws);
+ return NULL;
+ }
+
+ dri1->api = &nouveau_dri1_api;
}
- return nouveau_pipe_winsys(ws)->pscreen;
+ return nvws->pscreen;
}
static struct pipe_context *
nouveau_drm_create_context(struct pipe_screen *pscreen)
{
- struct nouveau_pipe_winsys *nvpws = nouveau_screen(pscreen);
+ struct nouveau_winsys *nvws = nouveau_winsys_screen(pscreen);
struct pipe_context *(*init)(struct pipe_screen *, unsigned);
- unsigned chipset = nvpws->channel->device->chipset;
+ unsigned chipset = nouveau_screen(pscreen)->device->chipset;
int i;
switch (chipset & 0xf0) {
@@ -106,19 +190,19 @@ nouveau_drm_create_context(struct pipe_screen *pscreen)
}
/* Find a free slot for a pipe context, allocate a new one if needed */
- for (i = 0; i < nvpws->nr_pctx; i++) {
- if (nvpws->pctx[i] == NULL)
+ for (i = 0; i < nvws->nr_pctx; i++) {
+ if (nvws->pctx[i] == NULL)
break;
}
- if (i == nvpws->nr_pctx) {
- nvpws->nr_pctx++;
- nvpws->pctx = realloc(nvpws->pctx,
- sizeof(*nvpws->pctx) * nvpws->nr_pctx);
+ if (i == nvws->nr_pctx) {
+ nvws->nr_pctx++;
+ nvws->pctx = realloc(nvws->pctx,
+ sizeof(*nvws->pctx) * nvws->nr_pctx);
}
- nvpws->pctx[i] = init(pscreen, i);
- return nvpws->pctx[i];
+ nvws->pctx[i] = init(pscreen, i);
+ return nvws->pctx[i];
}
static boolean
@@ -132,42 +216,41 @@ static struct pipe_buffer *
nouveau_drm_pb_from_handle(struct pipe_screen *pscreen, const char *name,
unsigned handle)
{
- struct nouveau_pipe_winsys *nvpws = nouveau_screen(pscreen);
- struct nouveau_device *dev = nvpws->channel->device;
- struct nouveau_pipe_buffer *nvpb;
+ struct nouveau_device *dev = nouveau_screen(pscreen)->device;
+ struct pipe_buffer *pb;
int ret;
- nvpb = CALLOC_STRUCT(nouveau_pipe_buffer);
- if (!nvpb)
+ pb = CALLOC(1, sizeof(struct pipe_buffer) + sizeof(struct nouveau_bo*));
+ if (!pb)
return NULL;
- ret = nouveau_bo_handle_ref(dev, handle, &nvpb->bo);
+ ret = nouveau_bo_handle_ref(dev, handle, (struct nouveau_bo**)(pb+1));
if (ret) {
debug_printf("%s: ref name 0x%08x failed with %d\n",
__func__, handle, ret);
- FREE(nvpb);
+ FREE(pb);
return NULL;
}
- pipe_reference_init(&nvpb->base.reference, 1);
- nvpb->base.screen = pscreen;
- nvpb->base.alignment = 0;
- nvpb->base.usage = PIPE_BUFFER_USAGE_GPU_READ_WRITE |
- PIPE_BUFFER_USAGE_CPU_READ_WRITE;
- nvpb->base.size = nvpb->bo->size;
- return &nvpb->base;
+ pipe_reference_init(&pb->reference, 1);
+ pb->screen = pscreen;
+ pb->alignment = 0;
+ pb->usage = PIPE_BUFFER_USAGE_GPU_READ_WRITE |
+ PIPE_BUFFER_USAGE_CPU_READ_WRITE;
+ pb->size = nouveau_bo(pb)->size;
+ return pb;
}
static boolean
nouveau_drm_handle_from_pb(struct pipe_screen *pscreen, struct pipe_buffer *pb,
unsigned *handle)
{
- struct nouveau_pipe_buffer *nvpb = nouveau_pipe_buffer(pb);
+ struct nouveau_bo *bo = nouveau_bo(pb);
- if (!nvpb)
+ if (!bo)
return FALSE;
- *handle = nvpb->bo->handle;
+ *handle = bo->handle;
return TRUE;
}
@@ -175,12 +258,12 @@ static boolean
nouveau_drm_name_from_pb(struct pipe_screen *pscreen, struct pipe_buffer *pb,
unsigned *handle)
{
- struct nouveau_pipe_buffer *nvpb = nouveau_pipe_buffer(pb);
+ struct nouveau_bo *bo = nouveau_bo(pb);
- if (!nvpb)
+ if (!bo)
return FALSE;
- return nouveau_bo_handle_get(nvpb->bo, handle) == 0;
+ return nouveau_bo_handle_get(bo, handle) == 0;
}
struct drm_api drm_api_hooks = {
diff --git a/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.h b/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.h
index 2782c83c0e..e61e0e0957 100644
--- a/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.h
+++ b/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.h
@@ -1,5 +1,34 @@
#ifndef __NOUVEAU_DRM_API_H__
#define __NOUVEAU_DRM_API_H__
+
#include "state_tracker/drm_api.h"
+#include "state_tracker/dri1_api.h"
+
+#include "pipe/internal/p_winsys_screen.h"
+
+#include "nouveau_dri.h"
+
+struct nouveau_winsys {
+ struct pipe_winsys base;
+
+ struct pipe_screen *pscreen;
+
+ unsigned nr_pctx;
+ struct pipe_context **pctx;
+
+ struct pipe_surface *front;
+};
+
+static INLINE struct nouveau_winsys *
+nouveau_winsys(struct pipe_winsys *ws)
+{
+ return (struct nouveau_winsys *)ws;
+}
+
+static INLINE struct nouveau_winsys *
+nouveau_winsys_screen(struct pipe_screen *pscreen)
+{
+ return nouveau_winsys(pscreen->winsys);
+}
#endif
diff --git a/src/gallium/winsys/drm/nouveau/drm/nouveau_winsys.c b/src/gallium/winsys/drm/nouveau/drm/nouveau_winsys.c
deleted file mode 100644
index e3175fd775..0000000000
--- a/src/gallium/winsys/drm/nouveau/drm/nouveau_winsys.c
+++ /dev/null
@@ -1,94 +0,0 @@
-#include "util/u_memory.h"
-
-#include "nouveau_winsys_pipe.h"
-
-static int
-nouveau_pipe_notifier_alloc(struct nouveau_winsys *nvws, int count,
- struct nouveau_notifier **notify)
-{
- struct nouveau_pipe_winsys *nvpws = nouveau_pipe_winsys(nvws->ws);
-
- return nouveau_notifier_alloc(nvpws->channel, nvpws->next_handle++,
- count, notify);
-}
-
-static int
-nouveau_pipe_grobj_alloc(struct nouveau_winsys *nvws, int grclass,
- struct nouveau_grobj **grobj)
-{
- struct nouveau_pipe_winsys *nvpws = nouveau_pipe_winsys(nvws->ws);
- struct nouveau_channel *chan = nvpws->channel;
- int ret;
-
- ret = nouveau_grobj_alloc(chan, nvpws->next_handle++, grclass, grobj);
- if (ret)
- return ret;
-
- BEGIN_RING(chan, *grobj, 0x0000, 1);
- OUT_RING (chan, (*grobj)->handle);
- (*grobj)->bound = NOUVEAU_GROBJ_BOUND_EXPLICIT;
- return 0;
-}
-
-static int
-nouveau_pipe_push_reloc(struct nouveau_winsys *nvws, void *ptr,
- struct pipe_buffer *buf, uint32_t data,
- uint32_t flags, uint32_t vor, uint32_t tor)
-{
- struct nouveau_bo *bo = nouveau_pipe_buffer(buf)->bo;
-
- return nouveau_pushbuf_emit_reloc(nvws->channel, ptr, bo,
- data, flags, vor, tor);
-}
-
-static int
-nouveau_pipe_push_flush(struct nouveau_winsys *nvws, unsigned size,
- struct pipe_fence_handle **fence)
-{
- if (fence)
- *fence = NULL;
-
- return nouveau_pushbuf_flush(nvws->channel, size);
-}
-
-static struct nouveau_bo *
-nouveau_pipe_get_bo(struct pipe_buffer *pb)
-{
- return nouveau_pipe_buffer(pb)->bo;
-}
-
-struct nouveau_winsys *
-nouveau_winsys_new(struct pipe_winsys *ws)
-{
- struct nouveau_pipe_winsys *nvpws = nouveau_pipe_winsys(ws);
- struct nouveau_winsys *nvws;
-
- nvws = CALLOC_STRUCT(nouveau_winsys);
- if (!nvws)
- return NULL;
-
- nvws->ws = ws;
- nvws->channel = nvpws->channel;
-
- nvws->res_init = nouveau_resource_init;
- nvws->res_alloc = nouveau_resource_alloc;
- nvws->res_free = nouveau_resource_free;
-
- nvws->push_reloc = nouveau_pipe_push_reloc;
- nvws->push_flush = nouveau_pipe_push_flush;
-
- nvws->grobj_alloc = nouveau_pipe_grobj_alloc;
- nvws->grobj_free = nouveau_grobj_free;
-
- nvws->notifier_alloc = nouveau_pipe_notifier_alloc;
- nvws->notifier_free = nouveau_notifier_free;
- nvws->notifier_reset = nouveau_notifier_reset;
- nvws->notifier_status = nouveau_notifier_status;
- nvws->notifier_retval = nouveau_notifier_return_val;
- nvws->notifier_wait = nouveau_notifier_wait_status;
-
- nvws->get_bo = nouveau_pipe_get_bo;
-
- return nvws;
-}
-
diff --git a/src/gallium/winsys/drm/nouveau/drm/nouveau_winsys_pipe.c b/src/gallium/winsys/drm/nouveau/drm/nouveau_winsys_pipe.c
deleted file mode 100644
index 9e03a9f5db..0000000000
--- a/src/gallium/winsys/drm/nouveau/drm/nouveau_winsys_pipe.c
+++ /dev/null
@@ -1,204 +0,0 @@
-#include "pipe/internal/p_winsys_screen.h"
-#include <pipe/p_defines.h>
-#include <pipe/p_inlines.h>
-#include <util/u_memory.h>
-
-#include "nouveau_winsys_pipe.h"
-
-#include "nouveau_drmif.h"
-#include "nouveau_bo.h"
-
-static const char *
-nouveau_get_name(struct pipe_winsys *pws)
-{
- return "Nouveau/DRI";
-}
-
-static uint32_t
-nouveau_flags_from_usage(struct pipe_winsys *ws, unsigned usage)
-{
- struct nouveau_pipe_winsys *nvpws = nouveau_pipe_winsys(ws);
- struct pipe_screen *pscreen = nvpws->pscreen;
- uint32_t flags = NOUVEAU_BO_LOCAL;
-
- if (usage & NOUVEAU_BUFFER_USAGE_TRANSFER)
- flags |= NOUVEAU_BO_GART;
-
- if (usage & PIPE_BUFFER_USAGE_PIXEL) {
- if (usage & NOUVEAU_BUFFER_USAGE_TEXTURE)
- flags |= NOUVEAU_BO_GART;
- if (!(usage & PIPE_BUFFER_USAGE_CPU_READ_WRITE))
- flags |= NOUVEAU_BO_VRAM;
-
- switch (nvpws->channel->device->chipset & 0xf0) {
- case 0x50:
- case 0x80:
- case 0x90:
- flags |= NOUVEAU_BO_TILED;
- if (usage & NOUVEAU_BUFFER_USAGE_ZETA)
- flags |= NOUVEAU_BO_ZTILE;
- break;
- default:
- break;
- }
- }
-
- if (usage & PIPE_BUFFER_USAGE_VERTEX) {
- if (pscreen->get_param(pscreen, NOUVEAU_CAP_HW_VTXBUF))
- flags |= NOUVEAU_BO_GART;
- }
-
- if (usage & PIPE_BUFFER_USAGE_INDEX) {
- if (pscreen->get_param(pscreen, NOUVEAU_CAP_HW_IDXBUF))
- flags |= NOUVEAU_BO_GART;
- }
-
- return flags;
-}
-
-static struct pipe_buffer *
-nouveau_pipe_bo_create(struct pipe_winsys *ws, unsigned alignment,
- unsigned usage, unsigned size)
-{
- struct nouveau_pipe_winsys *nvpws = nouveau_pipe_winsys(ws);
- struct nouveau_device *dev = nvpws->channel->device;
- struct nouveau_pipe_buffer *nvbuf;
- uint32_t flags;
-
- nvbuf = CALLOC_STRUCT(nouveau_pipe_buffer);
- if (!nvbuf)
- return NULL;
- pipe_reference_init(&nvbuf->base.reference, 1);
- nvbuf->base.alignment = alignment;
- nvbuf->base.usage = usage;
- nvbuf->base.size = size;
-
- flags = nouveau_flags_from_usage(ws, usage);
- if (nouveau_bo_new(dev, flags, alignment, size, &nvbuf->bo)) {
- FREE(nvbuf);
- return NULL;
- }
-
- return &nvbuf->base;
-}
-
-static struct pipe_buffer *
-nouveau_pipe_bo_user_create(struct pipe_winsys *ws, void *ptr, unsigned bytes)
-{
- struct nouveau_pipe_winsys *nvpws = nouveau_pipe_winsys(ws);
- struct nouveau_device *dev = nvpws->channel->device;
- struct nouveau_pipe_buffer *nvbuf;
-
- nvbuf = CALLOC_STRUCT(nouveau_pipe_buffer);
- if (!nvbuf)
- return NULL;
- pipe_reference_init(&nvbuf->base.reference, 1);
- nvbuf->base.size = bytes;
-
- if (nouveau_bo_user(dev, ptr, bytes, &nvbuf->bo)) {
- FREE(nvbuf);
- return NULL;
- }
-
- return &nvbuf->base;
-}
-
-static void
-nouveau_pipe_bo_del(struct pipe_buffer *buf)
-{
- struct nouveau_pipe_buffer *nvbuf = nouveau_pipe_buffer(buf);
-
- nouveau_bo_ref(NULL, &nvbuf->bo);
- FREE(nvbuf);
-}
-
-static void *
-nouveau_pipe_bo_map(struct pipe_winsys *pws, struct pipe_buffer *buf,
- unsigned flags)
-{
- struct nouveau_pipe_buffer *nvbuf = nouveau_pipe_buffer(buf);
- uint32_t map_flags = 0;
-
- if (flags & PIPE_BUFFER_USAGE_CPU_READ)
- map_flags |= NOUVEAU_BO_RD;
- if (flags & PIPE_BUFFER_USAGE_CPU_WRITE)
- map_flags |= NOUVEAU_BO_WR;
-
- if (nouveau_bo_map(nvbuf->bo, map_flags))
- return NULL;
- return nvbuf->bo->map;
-}
-
-static void
-nouveau_pipe_bo_unmap(struct pipe_winsys *pws, struct pipe_buffer *buf)
-{
- struct nouveau_pipe_buffer *nvbuf = nouveau_pipe_buffer(buf);
-
- nouveau_bo_unmap(nvbuf->bo);
-}
-
-static void
-nouveau_pipe_fence_reference(struct pipe_winsys *ws,
- struct pipe_fence_handle **ptr,
- struct pipe_fence_handle *pfence)
-{
- *ptr = pfence;
-}
-
-static int
-nouveau_pipe_fence_signalled(struct pipe_winsys *ws,
- struct pipe_fence_handle *pfence, unsigned flag)
-{
- return 0;
-}
-
-static int
-nouveau_pipe_fence_finish(struct pipe_winsys *ws,
- struct pipe_fence_handle *pfence, unsigned flag)
-{
- return 0;
-}
-
-static void
-nouveau_destroy(struct pipe_winsys *ws)
-{
- struct nouveau_pipe_winsys *nvpws = nouveau_pipe_winsys(ws);
-
- nouveau_device_close(&nvpws->channel->device);
- FREE(nvpws);
-}
-
-struct pipe_winsys *
-nouveau_pipe_winsys_new(struct nouveau_device *dev)
-{
- struct nouveau_pipe_winsys *nvpws;
- int ret;
-
- nvpws = CALLOC_STRUCT(nouveau_pipe_winsys);
- if (!nvpws)
- return NULL;
-
- ret = nouveau_channel_alloc(dev, 0xbeef0201, 0xbeef0202,
- &nvpws->channel);
- if (ret) {
- debug_printf("%s: error opening GPU channel: %d\n",
- __func__, ret);
- FREE(nvpws);
- return NULL;
- }
- nvpws->next_handle = 0x77000000;
-
- nvpws->base.buffer_create = nouveau_pipe_bo_create;
- nvpws->base.buffer_destroy = nouveau_pipe_bo_del;
- nvpws->base.user_buffer_create = nouveau_pipe_bo_user_create;
- nvpws->base.buffer_map = nouveau_pipe_bo_map;
- nvpws->base.buffer_unmap = nouveau_pipe_bo_unmap;
-
- nvpws->base.fence_reference = nouveau_pipe_fence_reference;
- nvpws->base.fence_signalled = nouveau_pipe_fence_signalled;
- nvpws->base.fence_finish = nouveau_pipe_fence_finish;
-
- nvpws->base.get_name = nouveau_get_name;
- nvpws->base.destroy = nouveau_destroy;
- return &nvpws->base;
-}
diff --git a/src/gallium/winsys/drm/nouveau/drm/nouveau_winsys_pipe.h b/src/gallium/winsys/drm/nouveau/drm/nouveau_winsys_pipe.h
deleted file mode 100644
index 10e1e269e8..0000000000
--- a/src/gallium/winsys/drm/nouveau/drm/nouveau_winsys_pipe.h
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef NOUVEAU_PIPE_WINSYS_H
-#define NOUVEAU_PIPE_WINSYS_H
-
-#include "pipe/internal/p_winsys_screen.h"
-#include "pipe/p_context.h"
-
-#include "nouveau/nouveau_winsys.h"
-
-#include "nouveau_device.h"
-
-struct nouveau_pipe_buffer {
- struct pipe_buffer base;
- struct nouveau_bo *bo;
-};
-
-static INLINE struct nouveau_pipe_buffer *
-nouveau_pipe_buffer(struct pipe_buffer *buf)
-{
- return (struct nouveau_pipe_buffer *)buf;
-}
-
-struct nouveau_pipe_winsys {
- struct pipe_winsys base;
-
- struct pipe_screen *pscreen;
-
- struct nouveau_channel *channel;
- uint32_t next_handle;
-
- unsigned nr_pctx;
- struct pipe_context **pctx;
-};
-
-static INLINE struct nouveau_pipe_winsys *
-nouveau_pipe_winsys(struct pipe_winsys *ws)
-{
- return (struct nouveau_pipe_winsys *)ws;
-}
-
-static INLINE struct nouveau_pipe_winsys *
-nouveau_screen(struct pipe_screen *pscreen)
-{
- return nouveau_pipe_winsys(pscreen->winsys);
-}
-
-struct pipe_winsys *
-nouveau_pipe_winsys_new(struct nouveau_device *);
-
-struct nouveau_winsys *
-nouveau_winsys_new(struct pipe_winsys *ws);
-
-#endif