Merge branch 'upstream-gallium-0.1' into nouveau-gallium-0.1
[mesa.git] / src / mesa / drivers / dri / nouveau_winsys / nouveau_context.c
index 9c524fa0017f391152d5e21b0f074c50cda6022e..01fada5b89b282851e79c247d90343171e479a58 100644 (file)
@@ -73,6 +73,7 @@ nouveau_context_create(const __GLcontextModes *glVis,
         */
        {
                struct pipe_surface *fb_surf;
+               struct nouveau_pipe_buffer *fb_buf;
                struct nouveau_bo_priv *fb_bo;
 
                fb_bo = calloc(1, sizeof(struct nouveau_bo_priv));
@@ -87,12 +88,15 @@ nouveau_context_create(const __GLcontextModes *glVis,
                fb_bo->base.size = fb_bo->drm.size;
                fb_bo->base.device = nv_screen->device;
 
+               fb_buf = calloc(1, sizeof(struct nouveau_pipe_buffer));
+               fb_buf->bo = &fb_bo->base;
+
                fb_surf = calloc(1, sizeof(struct pipe_surface));
                fb_surf->cpp = nv_screen->front_cpp;
                fb_surf->pitch = nv_screen->front_pitch / fb_surf->cpp;
                fb_surf->height = nv_screen->front_height;
                fb_surf->refcount = 1;
-               fb_surf->buffer = (void *)fb_bo;
+               fb_surf->buffer = &fb_buf->base;
 
                nv->frontbuffer = fb_surf;
        }