nv10: remove u_simple_screen usage
authorBen Skeggs <bskeggs@redhat.com>
Thu, 4 Jun 2009 11:53:57 +0000 (21:53 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 5 Jun 2009 04:37:02 +0000 (14:37 +1000)
src/gallium/drivers/nv10/nv10_prim_vbuf.c
src/gallium/drivers/nv10/nv10_screen.c
src/gallium/drivers/nv10/nv10_screen.h

index 089c236302a5c02d637581b823a8132cce028248..f16e343fa64027c48f460fbefa6c58f777b585d4 100644 (file)
@@ -203,7 +203,7 @@ nv10_vbuf_render_release_vertices( struct vbuf_render *render )
 {
        struct nv10_vbuf_render *nv10_render = nv10_vbuf_render(render);
        struct nv10_context *nv10 = nv10_render->nv10;
-       struct pipe_screen *pscreen = &nv10->screen->pipe;
+       struct pipe_screen *pscreen = &nv10->screen->base.base;
 
        assert(nv10_render->buffer);
        pipe_buffer_reference(&nv10_render->buffer, NULL);
index 6532a93c7ba10de5860fc390813b5d54483a8649..5c36bee6e2b6191c0e1b7f664453305eecc733e3 100644 (file)
@@ -1,26 +1,8 @@
 #include "pipe/p_screen.h"
-#include "util/u_simple_screen.h"
 
 #include "nv10_context.h"
 #include "nv10_screen.h"
 
-static const char *
-nv10_screen_get_name(struct pipe_screen *screen)
-{
-       struct nv10_screen *nv10screen = nv10_screen(screen);
-       struct nouveau_device *dev = nv10screen->nvws->channel->device;
-       static char buffer[128];
-
-       snprintf(buffer, sizeof(buffer), "NV%02X", dev->chipset);
-       return buffer;
-}
-
-static const char *
-nv10_screen_get_vendor(struct pipe_screen *screen)
-{
-       return "nouveau";
-}
-
 static int
 nv10_screen_get_param(struct pipe_screen *screen, int param)
 {
@@ -140,30 +122,43 @@ struct pipe_screen *
 nv10_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
 {
        struct nv10_screen *screen = CALLOC_STRUCT(nv10_screen);
+       struct nouveau_device *dev = nvws->channel->device;
+       struct pipe_screen *pscreen;
        unsigned celsius_class;
-       unsigned chipset = nvws->channel->device->chipset;
        int ret;
 
        if (!screen)
                return NULL;
+       pscreen = &screen->base.base;
+
        screen->nvws = nvws;
 
+       pscreen->winsys = ws;
+       pscreen->destroy = nv10_screen_destroy;
+       pscreen->get_param = nv10_screen_get_param;
+       pscreen->get_paramf = nv10_screen_get_paramf;
+       pscreen->is_format_supported = nv10_screen_is_format_supported;
+
+       nv10_screen_init_miptree_functions(pscreen);
+       nv10_screen_init_transfer_functions(pscreen);
+       nouveau_screen_init(&screen->base, dev);
+
        /* 2D engine setup */
        screen->eng2d = nv04_surface_2d_init(nvws);
        screen->eng2d->buf = nv10_surface_buffer;
 
        /* 3D object */
-       if (chipset>=0x20)
-               celsius_class=NV11TCL;
-       else if (chipset>=0x17)
-               celsius_class=NV17TCL;
-       else if (chipset>=0x11)
-               celsius_class=NV11TCL;
+       if (dev->chipset >= 0x20)
+               celsius_class = NV11TCL;
+       else if (dev->chipset >= 0x17)
+               celsius_class = NV17TCL;
+       else if (dev->chipset >= 0x11)
+               celsius_class = NV11TCL;
        else
-               celsius_class=NV10TCL;
+               celsius_class = NV10TCL;
 
        if (!celsius_class) {
-               NOUVEAU_ERR("Unknown nv1x chipset: nv%02x\n", chipset);
+               NOUVEAU_ERR("Unknown nv1x chipset: nv%02x\n", dev->chipset);
                return NULL;
        }
 
@@ -177,24 +172,10 @@ nv10_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
        ret = nvws->notifier_alloc(nvws, 1, &screen->sync);
        if (ret) {
                NOUVEAU_ERR("Error creating notifier object: %d\n", ret);
-               nv10_screen_destroy(&screen->pipe);
+               nv10_screen_destroy(pscreen);
                return NULL;
        }
 
-       screen->pipe.winsys = ws;
-       screen->pipe.destroy = nv10_screen_destroy;
-
-       screen->pipe.get_name = nv10_screen_get_name;
-       screen->pipe.get_vendor = nv10_screen_get_vendor;
-       screen->pipe.get_param = nv10_screen_get_param;
-       screen->pipe.get_paramf = nv10_screen_get_paramf;
-
-       screen->pipe.is_format_supported = nv10_screen_is_format_supported;
-
-       nv10_screen_init_miptree_functions(&screen->pipe);
-       nv10_screen_init_transfer_functions(&screen->pipe);
-       u_simple_screen_init(&screen->pipe);
-
-       return &screen->pipe;
+       return pscreen;
 }
 
index ad829ee3fd4d9b68a81eb1e905aceb75c4c67f84..86b6d8def54c5bd27f9daf520d30866ab16a9507 100644 (file)
@@ -1,11 +1,11 @@
 #ifndef __NV10_SCREEN_H__
 #define __NV10_SCREEN_H__
 
-#include "pipe/p_screen.h"
+#include "nouveau/nouveau_screen.h"
 #include "nv04/nv04_surface_2d.h"
 
 struct nv10_screen {
-       struct pipe_screen pipe;
+       struct nouveau_screen base;
 
        struct nouveau_winsys *nvws;