summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv40/nv40_screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/nv40/nv40_screen.c')
-rw-r--r--src/gallium/drivers/nv40/nv40_screen.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/drivers/nv40/nv40_screen.c b/src/gallium/drivers/nv40/nv40_screen.c
index 41d342d27d..a2b124d228 100644
--- a/src/gallium/drivers/nv40/nv40_screen.c
+++ b/src/gallium/drivers/nv40/nv40_screen.c
@@ -230,6 +230,14 @@ nv40_screen_destroy(struct pipe_screen *pscreen)
FREE(pscreen);
}
+static struct pipe_buffer *
+nv40_surface_buffer(struct pipe_surface *surf)
+{
+ struct nv40_miptree *mt = (struct nv40_miptree *)surf->texture;
+
+ return mt->buffer;
+}
+
struct pipe_screen *
nv40_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
{
@@ -243,6 +251,10 @@ nv40_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
return NULL;
screen->nvws = nvws;
+ /* 2D engine setup */
+ screen->eng2d = nv04_surface_2d_init(nvws);
+ screen->eng2d->buf = nv40_surface_buffer;
+
/* 3D object */
switch (chipset & 0xf0) {
case 0x40: