diff options
Diffstat (limited to 'src/mesa/drivers/dri/nouveau')
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_context.c | 3 | ||||
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_driver.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_driver.h | 3 | ||||
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_fbo.c | 1 | ||||
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_texture.c | 6 | ||||
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nv04_state_raster.c | 12 | ||||
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nv10_state_raster.c | 6 | ||||
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nv10_state_tnl.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nv20_state_tnl.c | 2 |
9 files changed, 22 insertions, 15 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index 53a121420d3..71dde413873 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -115,7 +115,8 @@ nouveau_context_init(struct gl_context *ctx, struct nouveau_screen *screen, nouveau_fbo_functions_init(&functions); /* Initialize the mesa context. */ - _mesa_initialize_context(ctx, visual, share_ctx, &functions, NULL); + _mesa_initialize_context(ctx, API_OPENGL, visual, + share_ctx, &functions, NULL); nouveau_state_init(ctx); nouveau_bo_state_init(ctx); diff --git a/src/mesa/drivers/dri/nouveau/nouveau_driver.c b/src/mesa/drivers/dri/nouveau/nouveau_driver.c index 27e2892f711..45630be7f6e 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_driver.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_driver.c @@ -24,6 +24,8 @@ * */ +#include "main/mfeatures.h" + #include "nouveau_driver.h" #include "nouveau_context.h" #include "nouveau_fbo.h" diff --git a/src/mesa/drivers/dri/nouveau/nouveau_driver.h b/src/mesa/drivers/dri/nouveau/nouveau_driver.h index 8036b18edc0..158aec820aa 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_driver.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_driver.h @@ -31,6 +31,7 @@ #include "main/mtypes.h" #include "main/macros.h" #include "main/formats.h" +#include "main/state.h" #include "utils.h" #include "dri_util.h" @@ -38,7 +39,6 @@ #include <assert.h> #include "nouveau_device.h" -#include "nouveau_pushbuf.h" #include "nouveau_grobj.h" #include "nouveau_channel.h" #include "nouveau_bo.h" @@ -46,6 +46,7 @@ #include "nouveau_screen.h" #include "nouveau_state.h" #include "nouveau_surface.h" +#include "nv04_pushbuf.h" #define DRIVER_DATE "20091015" #define DRIVER_AUTHOR "Nouveau" diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c index 079b5d63e4c..b36b5788781 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c @@ -32,6 +32,7 @@ #include "main/framebuffer.h" #include "main/renderbuffer.h" #include "main/fbobject.h" +#include "main/mfeatures.h" static GLboolean set_renderbuffer_format(struct gl_renderbuffer *rb, GLenum internalFormat) diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c b/src/mesa/drivers/dri/nouveau/nouveau_texture.c index 2480b1ea500..988208ff56e 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c @@ -113,8 +113,10 @@ nouveau_teximage_map(struct gl_context *ctx, struct gl_texture_image *ti, if (access & GL_MAP_WRITE_BIT) flags |= NOUVEAU_BO_WR; - ret = nouveau_bo_map(s->bo, flags); - assert(!ret); + if (!s->bo->map) { + ret = nouveau_bo_map(s->bo, flags); + assert(!ret); + } ti->Data = s->bo->map + y * s->pitch + x * s->cpp; } diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_raster.c b/src/mesa/drivers/dri/nouveau/nv04_state_raster.c index 98f2f98f1d0..78d29fc485b 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_state_raster.c +++ b/src/mesa/drivers/dri/nouveau/nv04_state_raster.c @@ -264,8 +264,8 @@ nv04_emit_blend(struct gl_context *ctx, int emit) NV04_MULTITEX_TRIANGLE_BLEND_TEXTURE_PERSPECTIVE_ENABLE; /* Alpha blending. */ - blend |= get_blend_func(ctx->Color.BlendDstRGB) << 28 | - get_blend_func(ctx->Color.BlendSrcRGB) << 24; + blend |= get_blend_func(ctx->Color.Blend[0].DstRGB) << 28 | + get_blend_func(ctx->Color.Blend[0].SrcRGB) << 24; if (ctx->Color.BlendEnabled) blend |= NV04_MULTITEX_TRIANGLE_BLEND_BLEND_ENABLE; @@ -277,7 +277,7 @@ nv04_emit_blend(struct gl_context *ctx, int emit) blend |= NV04_MULTITEX_TRIANGLE_BLEND_SHADE_MODE_FLAT; /* Secondary color */ - if (NEED_SECONDARY_COLOR(ctx)) + if (_mesa_need_secondary_color(ctx)) blend |= NV04_MULTITEX_TRIANGLE_BLEND_SPECULAR_ENABLE; /* Fog. */ @@ -296,8 +296,8 @@ nv04_emit_blend(struct gl_context *ctx, int emit) NV04_TEXTURED_TRIANGLE_BLEND_TEXTURE_PERSPECTIVE_ENABLE; /* Alpha blending. */ - blend |= get_blend_func(ctx->Color.BlendDstRGB) << 28 | - get_blend_func(ctx->Color.BlendSrcRGB) << 24; + blend |= get_blend_func(ctx->Color.Blend[0].DstRGB) << 28 | + get_blend_func(ctx->Color.Blend[0].SrcRGB) << 24; if (ctx->Color.BlendEnabled) blend |= NV04_TEXTURED_TRIANGLE_BLEND_BLEND_ENABLE; @@ -315,7 +315,7 @@ nv04_emit_blend(struct gl_context *ctx, int emit) blend |= get_texenv_mode(GL_MODULATE); /* Secondary color */ - if (NEED_SECONDARY_COLOR(ctx)) + if (_mesa_need_secondary_color(ctx)) blend |= NV04_TEXTURED_TRIANGLE_BLEND_SPECULAR_ENABLE; /* Fog. */ diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_raster.c b/src/mesa/drivers/dri/nouveau/nv10_state_raster.c index bb1084ed11b..50021b0a7bf 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state_raster.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state_raster.c @@ -68,7 +68,7 @@ nv10_emit_blend_equation(struct gl_context *ctx, int emit) OUT_RINGb(chan, ctx->Color.BlendEnabled); BEGIN_RING(chan, celsius, NV10_3D_BLEND_EQUATION, 1); - OUT_RING(chan, nvgl_blend_eqn(ctx->Color.BlendEquationRGB)); + OUT_RING(chan, nvgl_blend_eqn(ctx->Color.Blend[0].EquationRGB)); } void @@ -78,8 +78,8 @@ nv10_emit_blend_func(struct gl_context *ctx, int emit) struct nouveau_grobj *celsius = context_eng3d(ctx); BEGIN_RING(chan, celsius, NV10_3D_BLEND_FUNC_SRC, 2); - OUT_RING(chan, nvgl_blend_func(ctx->Color.BlendSrcRGB)); - OUT_RING(chan, nvgl_blend_func(ctx->Color.BlendDstRGB)); + OUT_RING(chan, nvgl_blend_func(ctx->Color.Blend[0].SrcRGB)); + OUT_RING(chan, nvgl_blend_func(ctx->Color.Blend[0].DstRGB)); } void diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_tnl.c b/src/mesa/drivers/dri/nouveau/nv10_state_tnl.c index e8bd12e6e01..96d1b320d86 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state_tnl.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state_tnl.c @@ -199,7 +199,7 @@ nv10_emit_light_model(struct gl_context *ctx, int emit) BEGIN_RING(chan, celsius, NV10_3D_LIGHT_MODEL, 1); OUT_RING(chan, ((m->LocalViewer ? NV10_3D_LIGHT_MODEL_LOCAL_VIEWER : 0) | - (NEED_SECONDARY_COLOR(ctx) ? + (_mesa_need_secondary_color(ctx) ? NV10_3D_LIGHT_MODEL_SEPARATE_SPECULAR : 0) | (!ctx->Light.Enabled && ctx->Fog.ColorSumEnabled ? NV10_3D_LIGHT_MODEL_VERTEX_SPECULAR : 0))); diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c b/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c index 4677198dd02..4f7ddd8e49f 100644 --- a/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c +++ b/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c @@ -178,7 +178,7 @@ nv20_emit_light_model(struct gl_context *ctx, int emit) OUT_RING(chan, ((m->LocalViewer ? NV20_3D_LIGHT_MODEL_VIEWER_LOCAL : NV20_3D_LIGHT_MODEL_VIEWER_NONLOCAL) | - (NEED_SECONDARY_COLOR(ctx) ? + (_mesa_need_secondary_color(ctx) ? NV20_3D_LIGHT_MODEL_SEPARATE_SPECULAR : 0))); |