From 6518a1c853e82a42b28027b1304babd4f02f98ef Mon Sep 17 00:00:00 2001 From: Luca Barbieri Date: Sun, 21 Feb 2010 13:40:49 +0100 Subject: [PATCH] nv30, nv40: add is_nv4x member to context and screen structs This will make it faster to check for nv40. --- src/gallium/drivers/nv30/nv30_context.c | 2 ++ src/gallium/drivers/nv40/nv40_context.c | 2 ++ src/gallium/drivers/nv40/nv40_screen.c | 3 +++ src/gallium/drivers/nvfx/nvfx_context.h | 2 ++ src/gallium/drivers/nvfx/nvfx_screen.h | 2 ++ 5 files changed, 11 insertions(+) diff --git a/src/gallium/drivers/nv30/nv30_context.c b/src/gallium/drivers/nv30/nv30_context.c index 628b50d8dc3..afed8bb952a 100644 --- a/src/gallium/drivers/nv30/nv30_context.c +++ b/src/gallium/drivers/nv30/nv30_context.c @@ -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); diff --git a/src/gallium/drivers/nv40/nv40_context.c b/src/gallium/drivers/nv40/nv40_context.c index 721b5134388..6cc3a339e67 100644 --- a/src/gallium/drivers/nv40/nv40_context.c +++ b/src/gallium/drivers/nv40/nv40_context.c @@ -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); diff --git a/src/gallium/drivers/nv40/nv40_screen.c b/src/gallium/drivers/nv40/nv40_screen.c index 0fc8e187504..c64864d58db 100644 --- a/src/gallium/drivers/nv40/nv40_screen.c +++ b/src/gallium/drivers/nv40/nv40_screen.c @@ -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); diff --git a/src/gallium/drivers/nvfx/nvfx_context.h b/src/gallium/drivers/nvfx/nvfx_context.h index 9e89d8409ff..87bad54e630 100644 --- a/src/gallium/drivers/nvfx/nvfx_context.h +++ b/src/gallium/drivers/nvfx/nvfx_context.h @@ -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 */ diff --git a/src/gallium/drivers/nvfx/nvfx_screen.h b/src/gallium/drivers/nvfx/nvfx_screen.h index b56f2d4b3f3..e076b876b02 100644 --- a/src/gallium/drivers/nvfx/nvfx_screen.h +++ b/src/gallium/drivers/nvfx/nvfx_screen.h @@ -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; -- 2.30.2