aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/nouveau/nouveau_context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.c')
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_context.c39
1 files changed, 17 insertions, 22 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c
index eff1016c070..d3e2c0df6c4 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_context.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c
@@ -62,7 +62,6 @@ static const struct dri_extension nouveau_extensions[] = {
{ "GL_EXT_texture_lod_bias", NULL },
{ "GL_NV_blend_square", NULL },
{ "GL_NV_texture_env_combine4", NULL },
- { "GL_SGIS_generate_mipmap", NULL },
{ NULL, NULL }
};
@@ -70,7 +69,7 @@ static void
nouveau_channel_flush_notify(struct nouveau_channel *chan)
{
struct nouveau_context *nctx = chan->user_private;
- GLcontext *ctx = &nctx->base;
+ struct gl_context *ctx = &nctx->base;
if (nctx->fallback < SWRAST)
nouveau_bo_state_emit(ctx);
@@ -78,13 +77,13 @@ nouveau_channel_flush_notify(struct nouveau_channel *chan)
GLboolean
nouveau_context_create(gl_api api,
- const __GLcontextModes *visual, __DRIcontext *dri_ctx,
+ const struct gl_config *visual, __DRIcontext *dri_ctx,
void *share_ctx)
{
__DRIscreen *dri_screen = dri_ctx->driScreenPriv;
struct nouveau_screen *screen = dri_screen->private;
struct nouveau_context *nctx;
- GLcontext *ctx;
+ struct gl_context *ctx;
ctx = screen->driver->context_create(screen, visual, share_ctx);
if (!ctx)
@@ -98,8 +97,8 @@ nouveau_context_create(gl_api api,
}
GLboolean
-nouveau_context_init(GLcontext *ctx, struct nouveau_screen *screen,
- const GLvisual *visual, GLcontext *share_ctx)
+nouveau_context_init(struct gl_context *ctx, struct nouveau_screen *screen,
+ const struct gl_config *visual, struct gl_context *share_ctx)
{
struct nouveau_context *nctx = to_nouveau_context(ctx);
struct dd_function_table functions;
@@ -129,7 +128,7 @@ nouveau_context_init(GLcontext *ctx, struct nouveau_screen *screen,
/* Allocate a hardware channel. */
ret = nouveau_channel_alloc(context_dev(ctx), 0xbeef0201, 0xbeef0202,
- &nctx->hw.chan);
+ 512*1024, &nctx->hw.chan);
if (ret) {
nouveau_error("Error initializing the FIFO.\n");
return GL_FALSE;
@@ -145,7 +144,7 @@ nouveau_context_init(GLcontext *ctx, struct nouveau_screen *screen,
}
void
-nouveau_context_deinit(GLcontext *ctx)
+nouveau_context_deinit(struct gl_context *ctx)
{
struct nouveau_context *nctx = to_nouveau_context(ctx);
@@ -172,7 +171,7 @@ void
nouveau_context_destroy(__DRIcontext *dri_ctx)
{
struct nouveau_context *nctx = dri_ctx->driverPrivate;
- GLcontext *ctx = &nctx->base;
+ struct gl_context *ctx = &nctx->base;
context_drv(ctx)->context_destroy(ctx);
}
@@ -180,7 +179,7 @@ nouveau_context_destroy(__DRIcontext *dri_ctx)
void
nouveau_update_renderbuffers(__DRIcontext *dri_ctx, __DRIdrawable *draw)
{
- GLcontext *ctx = dri_ctx->driverPrivate;
+ struct gl_context *ctx = dri_ctx->driverPrivate;
__DRIscreen *screen = dri_ctx->driScreenPriv;
struct gl_framebuffer *fb = draw->driverPrivate;
struct nouveau_framebuffer *nfb = to_nouveau_framebuffer(fb);
@@ -254,7 +253,7 @@ static void
update_framebuffer(__DRIcontext *dri_ctx, __DRIdrawable *draw,
int *stamp)
{
- GLcontext *ctx = dri_ctx->driverPrivate;
+ struct gl_context *ctx = dri_ctx->driverPrivate;
struct gl_framebuffer *fb = draw->driverPrivate;
*stamp = *draw->pStamp;
@@ -262,7 +261,10 @@ update_framebuffer(__DRIcontext *dri_ctx, __DRIdrawable *draw,
nouveau_update_renderbuffers(dri_ctx, draw);
_mesa_resize_framebuffer(ctx, fb, draw->w, draw->h);
+ /* Clean up references to the old framebuffer objects. */
context_dirty(ctx, FRAMEBUFFER);
+ context_bctx(ctx, FRAMEBUFFER);
+ FIRE_RING(context_chan(ctx));
}
GLboolean
@@ -271,7 +273,7 @@ nouveau_context_make_current(__DRIcontext *dri_ctx, __DRIdrawable *dri_draw,
{
if (dri_ctx) {
struct nouveau_context *nctx = dri_ctx->driverPrivate;
- GLcontext *ctx = &nctx->base;
+ struct gl_context *ctx = &nctx->base;
/* Ask the X server for new renderbuffers. */
if (dri_draw->driverPrivate != ctx->WinSysDrawBuffer)
@@ -283,10 +285,6 @@ nouveau_context_make_current(__DRIcontext *dri_ctx, __DRIdrawable *dri_draw,
update_framebuffer(dri_ctx, dri_read,
&dri_ctx->dri2.read_stamp);
- /* Clean up references to the old framebuffer objects. */
- context_bctx(ctx, FRAMEBUFFER);
- FIRE_RING(context_chan(ctx));
-
/* Pass it down to mesa. */
_mesa_make_current(ctx, dri_draw->driverPrivate,
dri_read->driverPrivate);
@@ -309,7 +307,7 @@ nouveau_context_unbind(__DRIcontext *dri_ctx)
}
void
-nouveau_fallback(GLcontext *ctx, enum nouveau_fallback mode)
+nouveau_fallback(struct gl_context *ctx, enum nouveau_fallback mode)
{
struct nouveau_context *nctx = to_nouveau_context(ctx);
@@ -341,7 +339,7 @@ validate_framebuffer(__DRIcontext *dri_ctx, __DRIdrawable *draw,
}
void
-nouveau_validate_framebuffer(GLcontext *ctx)
+nouveau_validate_framebuffer(struct gl_context *ctx)
{
__DRIcontext *dri_ctx = to_nouveau_context(ctx)->dri_context;
__DRIdrawable *dri_draw = dri_ctx->driDrawablePriv;
@@ -355,8 +353,5 @@ nouveau_validate_framebuffer(GLcontext *ctx)
validate_framebuffer(dri_ctx, dri_read,
&dri_ctx->dri2.read_stamp);
- if (nouveau_next_dirty_state(ctx) >= 0) {
- nouveau_state_emit(ctx);
- FIRE_RING(context_chan(ctx));
- }
+ nouveau_state_emit(ctx);
}