From ae7dcae81bc54bc16f16127f2fa1d01d9aa2332c Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Wed, 30 Jan 2008 00:05:50 +1100 Subject: [PATCH] nouveau: support nv67 --- .../dri/nouveau_winsys/nouveau_winsys.c | 1 + src/mesa/pipe/nv40/nv40_context.c | 34 ++++++++++++------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/mesa/drivers/dri/nouveau_winsys/nouveau_winsys.c b/src/mesa/drivers/dri/nouveau_winsys/nouveau_winsys.c index ddf3cba5f02..8ffe89feecb 100644 --- a/src/mesa/drivers/dri/nouveau_winsys/nouveau_winsys.c +++ b/src/mesa/drivers/dri/nouveau_winsys/nouveau_winsys.c @@ -81,6 +81,7 @@ nouveau_pipe_create(struct nouveau_context *nv) switch (nv->chipset & 0xf0) { case 0x40: + case 0x60: hw_create = nv40_create; break; case 0x50: diff --git a/src/mesa/pipe/nv40/nv40_context.c b/src/mesa/pipe/nv40/nv40_context.c index f6fdd6b4376..d0d9583e32e 100644 --- a/src/mesa/pipe/nv40/nv40_context.c +++ b/src/mesa/pipe/nv40/nv40_context.c @@ -188,26 +188,34 @@ nv40_init_hwctx(struct nv40_context *nv40, int curie_class) return TRUE; } -#define GRCLASS4097_CHIPSETS 0x00000baf -#define GRCLASS4497_CHIPSETS 0x00005450 +#define NV4X_GRCLASS4097_CHIPSETS 0x00000baf +#define NV4X_GRCLASS4497_CHIPSETS 0x00005450 +#define NV6X_GRCLASS4497_CHIPSETS 0x00000080 + struct pipe_context * nv40_create(struct pipe_winsys *pipe_winsys, struct nouveau_winsys *nvws, unsigned chipset) { struct nv40_context *nv40; - int curie_class, ret; - - if ((chipset & 0xf0) != 0x40) { - NOUVEAU_ERR("Not a NV4X chipset\n"); - return NULL; + int curie_class = 0, ret; + + switch (chipset & 0xf0) { + case 0x40: + if (NV4X_GRCLASS4097_CHIPSETS & (1 << (chipset & 0x0f))) + curie_class = NV40TCL; + else + if (NV4X_GRCLASS4497_CHIPSETS & (1 << (chipset & 0x0f))) + curie_class = NV44TCL; + break; + case 0x60: + if (NV6X_GRCLASS4497_CHIPSETS & (1 << (chipset & 0x0f))) + curie_class = NV44TCL; + break; + default: + break; } - if (GRCLASS4097_CHIPSETS & (1 << (chipset & 0x0f))) { - curie_class = NV40TCL; - } else - if (GRCLASS4497_CHIPSETS & (1 << (chipset & 0x0f))) { - curie_class = NV44TCL; - } else { + if (!curie_class) { NOUVEAU_ERR("Unknown NV4x chipset: NV%02x\n", chipset); return NULL; } -- 2.30.2