nouveau: nv10 and nv11,15 are different
authorPatrice Mandin <pmandin@caramail.com>
Sat, 14 Jul 2007 16:54:22 +0000 (18:54 +0200)
committerPatrice Mandin <pmandin@caramail.com>
Sat, 14 Jul 2007 16:54:22 +0000 (18:54 +0200)
src/mesa/drivers/dri/nouveau/nouveau_context.c
src/mesa/drivers/dri/nouveau/nouveau_object.c
src/mesa/drivers/dri/nouveau/nouveau_state.c
src/mesa/drivers/dri/nouveau/nv10_state.c
src/mesa/drivers/dri/nouveau/nv10_swtcl.c

index 3b2bd21a46cfc4614585660177254bb6b647cbe7..44392c0267cd25d2415102e13a942efa208547b2 100644 (file)
@@ -224,6 +224,7 @@ GLboolean nouveauCreateContext( const __GLcontextModes *glVisual,
                        nv04TriInitFunctions( ctx );
                        break;
                case NV_10:
+               case NV_11:
                case NV_17:
                case NV_20:
                case NV_30:
index ec517f8b16a21979367b6582db3d44f8423fc5d9..a143488e8d5913e66197a9b4baad3dc5dcee4033 100644 (file)
@@ -34,10 +34,13 @@ void nouveauObjectInit(nouveauContextPtr nmesa)
        nouveauCreateContextObject(nmesa, Nv3D, nmesa->screen->card->class_3d);
        if (nmesa->screen->card->type>=NV_10) {
                nouveauCreateContextObject(nmesa, NvCtxSurf2D, NV10_CONTEXT_SURFACES_2D);
-               nouveauCreateContextObject(nmesa, NvImageBlit, NV10_IMAGE_BLIT);
        } else {
                nouveauCreateContextObject(nmesa, NvCtxSurf2D, NV04_CONTEXT_SURFACES_2D);
                nouveauCreateContextObject(nmesa, NvCtxSurf3D, NV04_CONTEXT_SURFACES_3D);
+       }
+       if (nmesa->screen->card->type>=NV_11) {
+               nouveauCreateContextObject(nmesa, NvImageBlit, NV10_IMAGE_BLIT);
+       } else {
                nouveauCreateContextObject(nmesa, NvImageBlit, NV_IMAGE_BLIT);
        }
        nouveauCreateContextObject(nmesa, NvMemFormat, NV_MEMORY_TO_MEMORY_FORMAT);
index 41fdd2d377a9a3f7be0d134b7dc67905f3619a20..f618dcfc99b5b5f079c5551c8cd72bade8d6c045 100644 (file)
@@ -162,6 +162,7 @@ void nouveauDDInitState(nouveauContextPtr nmesa)
             nv04InitStateFuncs(nmesa->glCtx, &nmesa->glCtx->Driver);
             break;
         case NV_10:
+        case NV_11:
         case NV_17:
             nv10InitStateFuncs(nmesa->glCtx, &nmesa->glCtx->Driver);
             break;
index 4db8296f04a0b23e7de711d47dd3a77ff418f210..47c4b14ba6b68fc4dc4ea5205d2b53e7ca39e795 100644 (file)
@@ -697,8 +697,7 @@ static GLboolean nv10InitCard(nouveauContextPtr nmesa)
        BEGIN_RING_SIZE(NvSub3D, 0x03f4, 1);
        OUT_RING(0);
 
-       /* not for nv10, only for >= nv11 */
-       if ((nmesa->screen->card->id>>4) >= 0x11) {
+       if (nmesa->screen->card->type >= NV_11) {
                BEGIN_RING_SIZE(NvSub3D, 0x120, 3);
                OUT_RING(0);
                OUT_RING(1);
index 586e0b9d594e2f59d972b3322c65aa68b47fe017..611469b6e413c2f01b81141ba86a395643c45421 100644 (file)
@@ -58,7 +58,7 @@ static void nv10ResetLineStipple( GLcontext *ctx );
 
 static inline void nv10StartPrimitive(struct nouveau_context* nmesa,uint32_t primitive,uint32_t size)
 {
-       if ((nmesa->screen->card->type==NV_10) || (nmesa->screen->card->type==NV_17))
+       if ((nmesa->screen->card->type>=NV_10) && (nmesa->screen->card->type<=NV_17))
                BEGIN_RING_SIZE(NvSub3D,NV10_TCL_PRIMITIVE_3D_BEGIN_END,1);
        else if (nmesa->screen->card->type==NV_20)
                BEGIN_RING_SIZE(NvSub3D,NV20_TCL_PRIMITIVE_3D_BEGIN_END,1);
@@ -66,7 +66,7 @@ static inline void nv10StartPrimitive(struct nouveau_context* nmesa,uint32_t pri
                BEGIN_RING_SIZE(NvSub3D,NV30_TCL_PRIMITIVE_3D_BEGIN_END,1);
        OUT_RING(primitive);
 
-       if ((nmesa->screen->card->type==NV_10) || (nmesa->screen->card->type==NV_17))
+       if ((nmesa->screen->card->type>=NV_10) && (nmesa->screen->card->type<=NV_17))
                BEGIN_RING_SIZE(NvSub3D,NV10_TCL_PRIMITIVE_3D_VERTEX_ARRAY_DATA|NONINC_METHOD,size);
        else if (nmesa->screen->card->type==NV_20)
                BEGIN_RING_SIZE(NvSub3D,NV20_TCL_PRIMITIVE_3D_VERTEX_DATA|NONINC_METHOD,size);
@@ -76,7 +76,7 @@ static inline void nv10StartPrimitive(struct nouveau_context* nmesa,uint32_t pri
 
 inline void nv10FinishPrimitive(struct nouveau_context *nmesa)
 {
-       if ((nmesa->screen->card->type==NV_10) || (nmesa->screen->card->type==NV_17))
+       if ((nmesa->screen->card->type>=NV_10) && (nmesa->screen->card->type<=NV_17))
                BEGIN_RING_SIZE(NvSub3D,NV10_TCL_PRIMITIVE_3D_BEGIN_END,1);
        else if (nmesa->screen->card->type==NV_20)
                BEGIN_RING_SIZE(NvSub3D,NV20_TCL_PRIMITIVE_3D_BEGIN_END,1);
@@ -454,7 +454,7 @@ static inline void nv10OutputVertexFormat(struct nouveau_context* nmesa)
        /* 
         * Tell the hardware about the vertex format
         */
-       if ((nmesa->screen->card->type==NV_10) || (nmesa->screen->card->type==NV_17)) {
+       if ((nmesa->screen->card->type>=NV_10) && (nmesa->screen->card->type<=NV_17)) {
                int size;
 
 #define NV_VERTEX_ATTRIBUTE_TYPE_FLOAT 2