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);
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);
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);
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);
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);
/*
* 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