nv30, nv40: add is_nv4x member to context and screen structs
authorLuca Barbieri <luca@luca-barbieri.com>
Sun, 21 Feb 2010 12:40:49 +0000 (13:40 +0100)
committerYounes Manton <younes.m@gmail.com>
Mon, 15 Mar 2010 04:03:01 +0000 (00:03 -0400)
This will make it faster to check for nv40.

src/gallium/drivers/nv30/nv30_context.c
src/gallium/drivers/nv40/nv40_context.c
src/gallium/drivers/nv40/nv40_screen.c
src/gallium/drivers/nvfx/nvfx_context.h
src/gallium/drivers/nvfx/nvfx_screen.h

index 628b50d..afed8bb 100644 (file)
@@ -71,6 +71,8 @@ nv30_create(struct pipe_screen *pscreen, void *priv)
        screen->base.channel->user_private = nvfx;
        screen->base.channel->flush_notify = nv30_state_flush_notify;
 
+       nvfx->is_nv4x = screen->is_nv4x;
+
        nv30_init_query_functions(nvfx);
        nv30_init_surface_functions(nvfx);
        nv30_init_state_functions(nvfx);
index 721b513..6cc3a33 100644 (file)
@@ -71,6 +71,8 @@ nv40_create(struct pipe_screen *pscreen, void *priv)
        screen->base.channel->user_private = nvfx;
        screen->base.channel->flush_notify = nv40_state_flush_notify;
 
+       nvfx->is_nv4x = screen->is_nv4x;
+
        nv40_init_query_functions(nvfx);
        nv40_init_surface_functions(nvfx);
        nv40_init_state_functions(nvfx);
index 0fc8e18..c64864d 100644 (file)
@@ -184,6 +184,9 @@ nv40_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
 
        if (!screen)
                return NULL;
+
+       screen->is_nv4x = ~0;
+
        pscreen = &screen->base.base;
 
        ret = nouveau_screen_init(&screen->base, dev);
index 9e89d84..87bad54 100644 (file)
@@ -118,6 +118,8 @@ struct nvfx_context {
        struct nouveau_winsys *nvws;
        struct nvfx_screen *screen;
 
+       unsigned is_nv4x; /* either 0 or ~0 */
+
        struct draw_context *draw;
 
        /* HW state derived from pipe states */
index b56f2d4..e076b87 100644 (file)
@@ -11,6 +11,8 @@ struct nvfx_screen {
 
        struct nvfx_context *cur_ctx;
 
+       unsigned is_nv4x; /* either 0 or ~0 */
+
        /* HW graphics objects */
        struct nv04_surface_2d *eng2d;
        struct nouveau_grobj *eng3d;