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 628b50d8dc3477755e13bc7c462cf8315fd252e0..afed8bb952affc04a4a7c7cf2c4c5bfd87bbb79d 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 721b5134388c55e8acb95ea711da85d255f6581a..6cc3a339e67d264a09fa517b2b19937578960099 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 0fc8e187504ce0c5393986f958f6ef9509d39b0e..c64864d58db3133699f47131e7900081c3a06d47 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 9e89d8409ffbd3729d02adbc1d30240a7eaab5fd..87bad54e630ae3ccf16497a9c0f4e387b552f864 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 b56f2d4b3f3ac791b80c9ab589804fc6a13aa804..e076b876b02df2192533a03357af262c067a3f05 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;