summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv10/nv10_screen.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2009-06-04 21:53:57 +1000
committerBen Skeggs <bskeggs@redhat.com>2009-06-05 14:37:02 +1000
commit251c47117b6268e03f7dd033b3f98033272916f3 (patch)
tree3784ccad753785d6ff2c037252ea9faa9c89b194 /src/gallium/drivers/nv10/nv10_screen.c
parent74c45add474862e9c4e5063d2c5173546366bfe6 (diff)
nv10: remove u_simple_screen usage
Diffstat (limited to 'src/gallium/drivers/nv10/nv10_screen.c')
-rw-r--r--src/gallium/drivers/nv10/nv10_screen.c67
1 files changed, 24 insertions, 43 deletions
diff --git a/src/gallium/drivers/nv10/nv10_screen.c b/src/gallium/drivers/nv10/nv10_screen.c
index 6532a93c7b..5c36bee6e2 100644
--- a/src/gallium/drivers/nv10/nv10_screen.c
+++ b/src/gallium/drivers/nv10/nv10_screen.c
@@ -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;
}