summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv04
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/nv04')
-rw-r--r--src/gallium/drivers/nv04/nv04_screen.c9
-rw-r--r--src/gallium/drivers/nv04/nv04_surface_2d.c13
-rw-r--r--src/gallium/drivers/nv04/nv04_surface_2d.h3
3 files changed, 10 insertions, 15 deletions
diff --git a/src/gallium/drivers/nv04/nv04_screen.c b/src/gallium/drivers/nv04/nv04_screen.c
index 98e2dafcd8..4bbedfb4d6 100644
--- a/src/gallium/drivers/nv04/nv04_screen.c
+++ b/src/gallium/drivers/nv04/nv04_screen.c
@@ -122,10 +122,9 @@ nv04_surface_buffer(struct pipe_surface *surf)
}
struct pipe_screen *
-nv04_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
+nv04_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
{
struct nv04_screen *screen = CALLOC_STRUCT(nv04_screen);
- struct nouveau_device *dev = nvws->channel->device;
struct nouveau_channel *chan;
struct pipe_screen *pscreen;
unsigned fahrenheit_class = 0, sub3d_class = 0;
@@ -140,9 +139,7 @@ nv04_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
nv04_screen_destroy(pscreen);
return NULL;
}
- screen->base.channel = chan = nvws->channel;
-
- screen->nvws = nvws;
+ chan = screen->base.channel;
pscreen->winsys = ws;
pscreen->destroy = nv04_screen_destroy;
@@ -188,7 +185,7 @@ nv04_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
BIND_RING(chan, screen->context_surfaces_3d, 6);
/* 2D engine setup */
- screen->eng2d = nv04_surface_2d_init(nvws);
+ screen->eng2d = nv04_surface_2d_init(&screen->base);
screen->eng2d->buf = nv04_surface_buffer;
/* Notifier for sync purposes */
diff --git a/src/gallium/drivers/nv04/nv04_surface_2d.c b/src/gallium/drivers/nv04/nv04_surface_2d.c
index fcb6501411..5afd028ddd 100644
--- a/src/gallium/drivers/nv04/nv04_surface_2d.c
+++ b/src/gallium/drivers/nv04/nv04_surface_2d.c
@@ -97,7 +97,7 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx,
struct pipe_surface *src, int sx, int sy,
int w, int h)
{
- struct nouveau_channel *chan = ctx->nvws->channel;
+ struct nouveau_channel *chan = ctx->swzsurf->channel;
struct nouveau_grobj *swzsurf = ctx->swzsurf;
struct nouveau_grobj *sifm = ctx->sifm;
struct nouveau_bo *src_bo = nouveau_bo(ctx->buf(src));
@@ -168,7 +168,7 @@ nv04_surface_copy_m2mf(struct nv04_surface_2d *ctx,
struct pipe_surface *dst, int dx, int dy,
struct pipe_surface *src, int sx, int sy, int w, int h)
{
- struct nouveau_channel *chan = ctx->nvws->channel;
+ struct nouveau_channel *chan = ctx->m2mf->channel;
struct nouveau_grobj *m2mf = ctx->m2mf;
struct nouveau_bo *src_bo = nouveau_bo(ctx->buf(src));
struct nouveau_bo *dst_bo = nouveau_bo(ctx->buf(dst));
@@ -214,7 +214,7 @@ nv04_surface_copy_blit(struct nv04_surface_2d *ctx, struct pipe_surface *dst,
int dx, int dy, struct pipe_surface *src, int sx, int sy,
int w, int h)
{
- struct nouveau_channel *chan = ctx->nvws->channel;
+ struct nouveau_channel *chan = ctx->surf2d->channel;
struct nouveau_grobj *surf2d = ctx->surf2d;
struct nouveau_grobj *blit = ctx->blit;
struct nouveau_bo *src_bo = nouveau_bo(ctx->buf(src));
@@ -280,7 +280,7 @@ static void
nv04_surface_fill(struct nv04_surface_2d *ctx, struct pipe_surface *dst,
int dx, int dy, int w, int h, unsigned value)
{
- struct nouveau_channel *chan = ctx->nvws->channel;
+ struct nouveau_channel *chan = ctx->surf2d->channel;
struct nouveau_grobj *surf2d = ctx->surf2d;
struct nouveau_grobj *rect = ctx->rect;
struct nouveau_bo *dst_bo = nouveau_bo(ctx->buf(dst));
@@ -335,10 +335,10 @@ nv04_surface_2d_takedown(struct nv04_surface_2d **pctx)
}
struct nv04_surface_2d *
-nv04_surface_2d_init(struct nouveau_winsys *nvws)
+nv04_surface_2d_init(struct nouveau_screen *screen)
{
struct nv04_surface_2d *ctx = CALLOC_STRUCT(nv04_surface_2d);
- struct nouveau_channel *chan = nvws->channel;
+ struct nouveau_channel *chan = screen->channel;
unsigned handle = 0x88000000, class;
int ret;
@@ -461,7 +461,6 @@ nv04_surface_2d_init(struct nouveau_winsys *nvws)
return NULL;
}
- ctx->nvws = nvws;
ctx->copy = nv04_surface_copy;
ctx->fill = nv04_surface_fill;
return ctx;
diff --git a/src/gallium/drivers/nv04/nv04_surface_2d.h b/src/gallium/drivers/nv04/nv04_surface_2d.h
index 82ce7189c8..02b3f56ba8 100644
--- a/src/gallium/drivers/nv04/nv04_surface_2d.h
+++ b/src/gallium/drivers/nv04/nv04_surface_2d.h
@@ -7,7 +7,6 @@ struct nv04_surface {
};
struct nv04_surface_2d {
- struct nouveau_winsys *nvws;
struct nouveau_notifier *ntfy;
struct nouveau_grobj *surf2d;
struct nouveau_grobj *swzsurf;
@@ -26,7 +25,7 @@ struct nv04_surface_2d {
};
struct nv04_surface_2d *
-nv04_surface_2d_init(struct nouveau_winsys *nvws);
+nv04_surface_2d_init(struct nouveau_screen *screen);
void
nv04_surface_2d_takedown(struct nv04_surface_2d **);