summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorMarcin Slusarz <[email protected]>2011-12-02 22:02:51 +0100
committerMarcin Slusarz <[email protected]>2011-12-13 21:06:29 +0100
commit10e931219f0619c01456dd13fea65b8c21f3b87b (patch)
tree8da9e29e0a91bc829cd370d8f933f72033f8e4e4 /src/gallium/drivers
parent642d11da207e9becfa26a9e038db1c7520ec2aee (diff)
nouveau: get rid of winsys object
Its only purpose was to destroy itself.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/nouveau/Android.mk4
-rw-r--r--src/gallium/drivers/nouveau/Makefile3
-rw-r--r--src/gallium/drivers/nouveau/nouveau_screen.c7
-rw-r--r--src/gallium/drivers/nouveau/nouveau_winsys.h6
-rw-r--r--src/gallium/drivers/nv50/nv50_context.c2
-rw-r--r--src/gallium/drivers/nv50/nv50_screen.c3
-rw-r--r--src/gallium/drivers/nv50/nv50_screen.h1
-rw-r--r--src/gallium/drivers/nvc0/nvc0_context.c2
-rw-r--r--src/gallium/drivers/nvc0/nvc0_screen.c3
-rw-r--r--src/gallium/drivers/nvc0/nvc0_screen.h1
-rw-r--r--src/gallium/drivers/nvfx/nvfx_context.c5
-rw-r--r--src/gallium/drivers/nvfx/nvfx_context.h1
-rw-r--r--src/gallium/drivers/nvfx/nvfx_screen.c3
-rw-r--r--src/gallium/drivers/nvfx/nvfx_screen.h1
14 files changed, 15 insertions, 27 deletions
diff --git a/src/gallium/drivers/nouveau/Android.mk b/src/gallium/drivers/nouveau/Android.mk
index 1094497f36f..782b7cec188 100644
--- a/src/gallium/drivers/nouveau/Android.mk
+++ b/src/gallium/drivers/nouveau/Android.mk
@@ -29,7 +29,9 @@ include $(LOCAL_PATH)/Makefile.sources
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(C_SOURCES)
-LOCAL_C_INCLUDES := $(DRM_TOP)
+LOCAL_C_INCLUDES := $(DRM_TOP) \
+ $(DRM_TOP)/include/drm \
+ $(DRM_TOP)/nouveau
LOCAL_MODULE := libmesa_pipe_nouveau
diff --git a/src/gallium/drivers/nouveau/Makefile b/src/gallium/drivers/nouveau/Makefile
index eb35c1f1d4e..d583324b021 100644
--- a/src/gallium/drivers/nouveau/Makefile
+++ b/src/gallium/drivers/nouveau/Makefile
@@ -7,6 +7,9 @@ LIBRARY_INCLUDES = \
$(LIBDRM_CFLAGS) \
-I$(TOP)/src/gallium/drivers/nouveau/include
+LIBRARY_INCLUDES += $(shell $(PKG_CONFIG) libdrm libdrm_nouveau --cflags-only-I)
+LIBRARY_DEFINES += $(shell $(PKG_CONFIG) libdrm libdrm_nouveau --cflags-only-other)
+
# get C_SOURCES
include Makefile.sources
diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c
index cdc2bffee81..99546a21319 100644
--- a/src/gallium/drivers/nouveau/nouveau_screen.c
+++ b/src/gallium/drivers/nouveau/nouveau_screen.c
@@ -22,6 +22,8 @@
#include "state_tracker/drm_driver.h"
#include "util/u_simple_screen.h"
+#include "nouveau_drmif.h"
+
int nouveau_mesa_debug = 0;
static const char *
@@ -234,14 +236,11 @@ nouveau_screen_init(struct nouveau_screen *screen, struct nouveau_device *dev)
void
nouveau_screen_fini(struct nouveau_screen *screen)
{
- struct pipe_winsys *ws = screen->base.winsys;
-
nouveau_mm_destroy(screen->mm_GART);
nouveau_mm_destroy(screen->mm_VRAM);
nouveau_channel_free(&screen->channel);
- if (ws)
- ws->destroy(ws);
+ nouveau_device_close(&screen->device);
}
diff --git a/src/gallium/drivers/nouveau/nouveau_winsys.h b/src/gallium/drivers/nouveau/nouveau_winsys.h
index 524e63652f6..1abfa790072 100644
--- a/src/gallium/drivers/nouveau/nouveau_winsys.h
+++ b/src/gallium/drivers/nouveau/nouveau_winsys.h
@@ -42,12 +42,12 @@ nouveau_screen_transfer_flags(unsigned pipe)
}
extern struct pipe_screen *
-nvfx_screen_create(struct pipe_winsys *ws, struct nouveau_device *);
+nvfx_screen_create(struct nouveau_device *);
extern struct pipe_screen *
-nv50_screen_create(struct pipe_winsys *ws, struct nouveau_device *);
+nv50_screen_create(struct nouveau_device *);
extern struct pipe_screen *
-nvc0_screen_create(struct pipe_winsys *ws, struct nouveau_device *);
+nvc0_screen_create(struct nouveau_device *);
#endif
diff --git a/src/gallium/drivers/nv50/nv50_context.c b/src/gallium/drivers/nv50/nv50_context.c
index a48b86474d1..3b0f8f07d1c 100644
--- a/src/gallium/drivers/nv50/nv50_context.c
+++ b/src/gallium/drivers/nv50/nv50_context.c
@@ -109,7 +109,6 @@ nv50_destroy(struct pipe_context *pipe)
struct pipe_context *
nv50_create(struct pipe_screen *pscreen, void *priv)
{
- struct pipe_winsys *pipe_winsys = pscreen->winsys;
struct nv50_screen *screen = nv50_screen(pscreen);
struct nv50_context *nv50;
struct pipe_context *pipe;
@@ -124,7 +123,6 @@ nv50_create(struct pipe_screen *pscreen, void *priv)
nv50->base.copy_data = nv50_m2mf_copy_linear;
nv50->base.push_data = nv50_sifc_linear_u8;
- pipe->winsys = pipe_winsys;
pipe->screen = pscreen;
pipe->priv = priv;
diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c
index 3cd5fdfedf3..f1dec3527d2 100644
--- a/src/gallium/drivers/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nv50/nv50_screen.c
@@ -298,7 +298,7 @@ nv50_screen_fence_update(struct pipe_screen *pscreen)
} while(0)
struct pipe_screen *
-nv50_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
+nv50_screen_create(struct nouveau_device *dev)
{
struct nv50_screen *screen;
struct nouveau_channel *chan;
@@ -323,7 +323,6 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
chan = screen->base.channel;
chan->user_private = screen;
- pscreen->winsys = ws;
pscreen->destroy = nv50_screen_destroy;
pscreen->context_create = nv50_create;
pscreen->is_format_supported = nv50_screen_is_format_supported;
diff --git a/src/gallium/drivers/nv50/nv50_screen.h b/src/gallium/drivers/nv50/nv50_screen.h
index 315ca80c0d2..cb7e956cd84 100644
--- a/src/gallium/drivers/nv50/nv50_screen.h
+++ b/src/gallium/drivers/nv50/nv50_screen.h
@@ -25,7 +25,6 @@ struct nv50_blitctx;
struct nv50_screen {
struct nouveau_screen base;
- struct nouveau_winsys *nvws;
struct nv50_context *cur_ctx;
diff --git a/src/gallium/drivers/nvc0/nvc0_context.c b/src/gallium/drivers/nvc0/nvc0_context.c
index 2927a0905bd..1bb90a38725 100644
--- a/src/gallium/drivers/nvc0/nvc0_context.c
+++ b/src/gallium/drivers/nvc0/nvc0_context.c
@@ -110,7 +110,6 @@ nvc0_default_flush_notify(struct nouveau_channel *chan)
struct pipe_context *
nvc0_create(struct pipe_screen *pscreen, void *priv)
{
- struct pipe_winsys *pipe_winsys = pscreen->winsys;
struct nvc0_screen *screen = nvc0_screen(pscreen);
struct nvc0_context *nvc0;
struct pipe_context *pipe;
@@ -126,7 +125,6 @@ nvc0_create(struct pipe_screen *pscreen, void *priv)
nvc0->base.push_data = nvc0_m2mf_push_linear;
nvc0->base.push_cb = nvc0_cb_push;
- pipe->winsys = pipe_winsys;
pipe->screen = pscreen;
pipe->priv = priv;
diff --git a/src/gallium/drivers/nvc0/nvc0_screen.c b/src/gallium/drivers/nvc0/nvc0_screen.c
index 79c3e36b8f9..190737e224b 100644
--- a/src/gallium/drivers/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nvc0/nvc0_screen.c
@@ -367,7 +367,7 @@ nvc0_screen_fence_update(struct pipe_screen *pscreen)
} while(0)
struct pipe_screen *
-nvc0_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
+nvc0_screen_create(struct nouveau_device *dev)
{
struct nvc0_screen *screen;
struct nouveau_channel *chan;
@@ -390,7 +390,6 @@ nvc0_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
chan = screen->base.channel;
chan->user_private = screen;
- pscreen->winsys = ws;
pscreen->destroy = nvc0_screen_destroy;
pscreen->context_create = nvc0_create;
pscreen->is_format_supported = nvc0_screen_is_format_supported;
diff --git a/src/gallium/drivers/nvc0/nvc0_screen.h b/src/gallium/drivers/nvc0/nvc0_screen.h
index 98a94c65c5b..be42970ca39 100644
--- a/src/gallium/drivers/nvc0/nvc0_screen.h
+++ b/src/gallium/drivers/nvc0/nvc0_screen.h
@@ -23,7 +23,6 @@ struct nvc0_blitctx;
struct nvc0_screen {
struct nouveau_screen base;
- struct nouveau_winsys *nvws;
struct nvc0_context *cur_ctx;
diff --git a/src/gallium/drivers/nvfx/nvfx_context.c b/src/gallium/drivers/nvfx/nvfx_context.c
index 37425b1fc3c..36209cb1792 100644
--- a/src/gallium/drivers/nvfx/nvfx_context.c
+++ b/src/gallium/drivers/nvfx/nvfx_context.c
@@ -71,18 +71,13 @@ struct pipe_context *
nvfx_create(struct pipe_screen *pscreen, void *priv)
{
struct nvfx_screen *screen = nvfx_screen(pscreen);
- struct pipe_winsys *ws = pscreen->winsys;
struct nvfx_context *nvfx;
- struct nouveau_winsys *nvws = screen->nvws;
nvfx = CALLOC(1, sizeof(struct nvfx_context));
if (!nvfx)
return NULL;
nvfx->screen = screen;
- nvfx->nvws = nvws;
-
- nvfx->pipe.winsys = ws;
nvfx->pipe.screen = pscreen;
nvfx->pipe.priv = priv;
nvfx->pipe.destroy = nvfx_destroy;
diff --git a/src/gallium/drivers/nvfx/nvfx_context.h b/src/gallium/drivers/nvfx/nvfx_context.h
index 3d05ecc7807..09d394bfeef 100644
--- a/src/gallium/drivers/nvfx/nvfx_context.h
+++ b/src/gallium/drivers/nvfx/nvfx_context.h
@@ -138,7 +138,6 @@ struct nvfx_render_target {
struct nvfx_context {
struct pipe_context pipe;
- struct nouveau_winsys *nvws;
struct nvfx_screen *screen;
unsigned is_nv4x; /* either 0 or ~0 */
diff --git a/src/gallium/drivers/nvfx/nvfx_screen.c b/src/gallium/drivers/nvfx/nvfx_screen.c
index ac03199b667..960cd884b8a 100644
--- a/src/gallium/drivers/nvfx/nvfx_screen.c
+++ b/src/gallium/drivers/nvfx/nvfx_screen.c
@@ -464,7 +464,7 @@ static void nvfx_channel_flush_notify(struct nouveau_channel* chan)
}
struct pipe_screen *
-nvfx_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
+nvfx_screen_create(struct nouveau_device *dev)
{
static const unsigned query_sizes[] = {(4096 - 4 * 32) / 32, 3 * 1024 / 32, 2 * 1024 / 32, 1024 / 32};
struct nvfx_screen *screen = CALLOC_STRUCT(nvfx_screen);
@@ -488,7 +488,6 @@ nvfx_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
chan->user_private = screen;
chan->flush_notify = nvfx_channel_flush_notify;
- pscreen->winsys = ws;
pscreen->destroy = nvfx_screen_destroy;
pscreen->get_param = nvfx_screen_get_param;
pscreen->get_shader_param = nvfx_screen_get_shader_param;
diff --git a/src/gallium/drivers/nvfx/nvfx_screen.h b/src/gallium/drivers/nvfx/nvfx_screen.h
index 02e7c5d1cad..35c9d910479 100644
--- a/src/gallium/drivers/nvfx/nvfx_screen.h
+++ b/src/gallium/drivers/nvfx/nvfx_screen.h
@@ -10,7 +10,6 @@ struct pipe_screen;
struct nvfx_screen {
struct nouveau_screen base;
- struct nouveau_winsys *nvws;
struct nouveau_bo *fence;
struct nvfx_context *cur_ctx;