fix resize bugs (fb size updated too late), fix typos, cleanups...
authorRoland Scheidegger <sroland@tungstengraphics.com>
Mon, 16 Jul 2007 18:53:33 +0000 (20:53 +0200)
committerRoland Scheidegger <sroland@tungstengraphics.com>
Mon, 16 Jul 2007 18:53:33 +0000 (20:53 +0200)
src/mesa/drivers/dri/i915tex/i915_state.c
src/mesa/drivers/dri/i915tex/intel_buffers.c
src/mesa/drivers/dri/i915tex/intel_pixel_copy.c
src/mesa/drivers/dri/i915tex/intel_pixel_draw.c
src/mesa/drivers/dri/i915tex/intel_screen.c

index e5d8d279936e9c57702a0b7c85d32f0437c85d5b..f523206befc755d20c48b9f734ca7f0515bd0c4d 100644 (file)
@@ -904,6 +904,7 @@ i915_init_packets(struct i915_context *i915)
 
    {
       I915_STATECHANGE(i915, I915_UPLOAD_BUFFERS);
+#if 0
       /* color buffer offset/stride */
       i915->state.Buffer[I915_DESTREG_CBUFADDR0] = _3DSTATE_BUF_INFO_CMD;
       /* XXX FBO: remove this?  Also get set in i915_set_draw_region() */
@@ -914,6 +915,7 @@ i915_init_packets(struct i915_context *i915)
       /* XXX FBO: remove this?  Also get set in i915_set_draw_region() */
       i915->state.Buffer[I915_DESTREG_DBUFADDR1] = (BUF_3D_ID_DEPTH | BUF_3D_PITCH(screen->depth.pitch) |       /* pitch in bytes */
                                                     BUF_3D_USE_FENCE);
+#endif
 
       i915->state.Buffer[I915_DESTREG_DV0] = _3DSTATE_DST_BUF_VARS_CMD;
 
index d3d97f8df0a2a5ae8d786a858fa0c0cbeb0187b8..74e2bfd769c291fdb379b944ed28fbe8f8ee45ba 100644 (file)
@@ -160,6 +160,9 @@ intelWindowMoved(struct intel_context *intel)
       intel->numClipRects = 0;
    }
 
+   /* Update Mesa's notion of window size */
+   driUpdateFramebufferSize(ctx, dPriv);
+   intel_fb->Base.Initialized = GL_TRUE; /* XXX remove someday */
 
    if (intel->intelScreen->driScrnPriv->ddxMinor >= 7) {
       drmI830Sarea *sarea = intel->sarea;
@@ -277,10 +280,6 @@ intelWindowMoved(struct intel_context *intel)
       intel_fb->vblank_flags &= ~VBLANK_FLAG_SECONDARY;
    }
 
-   /* Update Mesa's notion of window size */
-   driUpdateFramebufferSize(ctx, dPriv);
-   intel_fb->Base.Initialized = GL_TRUE; /* XXX remove someday */
-
    /* Update hardware scissor */
    ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y,
                        ctx->Scissor.Width, ctx->Scissor.Height);
@@ -707,6 +706,9 @@ intelPageFlip(const __DRIdrawablePrivate * dPriv)
    intel_flip_renderbuffers(intel_fb);
    intel_draw_buffer(&intel->ctx, &intel_fb->Base);
 
+   if (INTEL_DEBUG & DEBUG_IOCTL)
+      fprintf(stderr, "%s: success\n", __FUNCTION__);
+
    return GL_TRUE;
 }
 
index 3148a2b0d42f7a70435af0c22e319b6f894b3bab..ad111d4d7216f1c455be25e3008ebb85a966f9cb 100644 (file)
@@ -263,7 +263,7 @@ do_blit_copypixels(GLcontext * ctx,
         || !(irbread->region->cpp == 2))
         return GL_FALSE;
    }
-   else if (GL_DEPTH_STENCIL_EXT) {
+   else if (type == GL_DEPTH_STENCIL_EXT) {
       /* Does it matter whether it is stencil/depth or depth/stencil?
        */
       irbread = intel_renderbuffer(ctx->ReadBuffer->_DepthBuffer->Wrapped);
@@ -271,7 +271,7 @@ do_blit_copypixels(GLcontext * ctx,
       if (!irbread || !irbread->region || !irbdraw || !irbdraw->region)
         return GL_FALSE;
    }
-   else if (GL_STENCIL) {
+   else if (type == GL_STENCIL) {
       /* Don't think this is really possible. 
        */
       return GL_FALSE;
index 1c83028d8abb83880dddc6e09053c74f455fd30b..eebd63ec014b9475f64c6c8f219e289e21bf64bb 100644 (file)
@@ -237,14 +237,14 @@ do_blit_drawpixels(GLcontext * ctx,
       if (!irbdraw || !irbdraw->region || !(irbdraw->region->cpp == 2))
         return GL_FALSE;
    }
-   else if (GL_DEPTH_STENCIL_EXT) {
+   else if (type == GL_DEPTH_STENCIL_EXT) {
       /* Does it matter whether it is stencil/depth or depth/stencil?
        */
       irbdraw = intel_renderbuffer(ctx->DrawBuffer->_DepthBuffer->Wrapped);
       if (!irbdraw || !irbdraw->region)
         return GL_FALSE;
    }
-   else if (GL_STENCIL) {
+   else if (type == GL_STENCIL) {
       /* Don't think this is really possible. 
        */
       return GL_FALSE;
index dcc29923834044b668dc72ffc3cece509460a4c9..f0d1439dd70ebec03a4d00fc951c11d984e1142b 100644 (file)
@@ -355,6 +355,7 @@ intelUpdateScreenFromSAREA(intelScreenPrivate * intelScreen,
    intelScreen->front.handle = sarea->front_handle;
    intelScreen->front.size = sarea->front_size;
 
+#if 0
    intelScreen->back.offset = sarea->back_offset;
    intelScreen->back.pitch = sarea->pitch * intelScreen->cpp;
    intelScreen->back.handle = sarea->back_handle;
@@ -376,6 +377,7 @@ intelUpdateScreenFromSAREA(intelScreenPrivate * intelScreen,
    intelScreen->logTextureGranularity = sarea->log_tex_granularity;
    intelScreen->tex.handle = sarea->tex_handle;
    intelScreen->tex.size = sarea->tex_size;
+#endif
 
    intelScreen->rotated.offset = sarea->rotated_offset;
    intelScreen->rotated.pitch = sarea->rotated_pitch * intelScreen->cpp;