gallium: Remove some little-used fields from struct pipe_surface.
authorMichel Dänzer <daenzer@vmware.com>
Thu, 26 Mar 2009 09:53:47 +0000 (10:53 +0100)
committerMichel Dänzer <daenzer@vmware.com>
Thu, 26 Mar 2009 09:53:47 +0000 (10:53 +0100)
28 files changed:
src/gallium/drivers/cell/ppu/cell_clear.c
src/gallium/drivers/i915simple/i915_clear.c
src/gallium/drivers/i915simple/i915_texture.c
src/gallium/drivers/i965simple/brw_tex_layout.c
src/gallium/drivers/nv04/nv04_miptree.c
src/gallium/drivers/nv10/nv10_miptree.c
src/gallium/drivers/nv20/nv20_clear.c
src/gallium/drivers/nv20/nv20_miptree.c
src/gallium/drivers/nv30/nv30_clear.c
src/gallium/drivers/nv30/nv30_miptree.c
src/gallium/drivers/nv30/nv30_state_emit.c
src/gallium/drivers/nv40/nv40_clear.c
src/gallium/drivers/nv40/nv40_miptree.c
src/gallium/drivers/nv40/nv40_state_emit.c
src/gallium/drivers/nv50/nv50_clear.c
src/gallium/drivers/nv50/nv50_miptree.c
src/gallium/drivers/nv50/nv50_state_validate.c
src/gallium/drivers/r300/r300_clear.c
src/gallium/drivers/r300/r300_texture.c
src/gallium/drivers/softpipe/sp_clear.c
src/gallium/drivers/softpipe/sp_setup.c
src/gallium/drivers/trace/tr_state.c
src/gallium/include/pipe/p_defines.h
src/gallium/include/pipe/p_state.h
src/gallium/state_trackers/egl/egl_surface.c
src/mesa/state_tracker/st_cb_clear.c
src/mesa/state_tracker/st_framebuffer.c
src/mesa/state_tracker/st_public.h

index edc06747ac1a45d2d117efef8d13054c6b65d917..34be5f3dc7d97b60e50b49cbab0e705e8180c2c6 100644 (file)
@@ -101,17 +101,4 @@ cell_clear_surface(struct pipe_context *pipe, struct pipe_surface *ps,
       clr->surface = surfIndex;
       clr->value = clearValue;
    }
-
-   /* Technically, the surface's contents are now known and cleared,
-    * so we could set the status to PIPE_SURFACE_STATUS_CLEAR.  But
-    * it turns out it's quite painful to recognize when any particular
-    * surface goes from PIPE_SURFACE_STATUS_CLEAR to 
-    * PIPE_SURFACE_STATUS_DEFINED (i.e. with known contents), because
-    * the drawing commands could be operating on numerous draw buffers,
-    * which we'd have to iterate through to set all their stati...
-    * For now, we cheat a bit and set the surface's status to DEFINED
-    * right here.  Later we should revisit this and set the status to
-    * CLEAR here, and find a better place to set the status to DEFINED.
-    */
-   ps->status = PIPE_SURFACE_STATUS_DEFINED;
 }
index 8a2d3ca43f17f4286d116b2202d1539c7eeb7a12..cde69daacc08ddd8447e21e7c7fbd8167accd8d3 100644 (file)
@@ -44,5 +44,4 @@ i915_clear(struct pipe_context *pipe, struct pipe_surface *ps,
           unsigned clearValue)
 {
    pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, clearValue);
-   ps->status = PIPE_SURFACE_STATUS_DEFINED;
 }
index 39aca9f8173f8e4d457908247f114f6c67ccdcab..ca8e87af8d1b3f85dfbaa3130b80b22c1330028f 100644 (file)
@@ -677,7 +677,6 @@ i915_get_tex_surface(struct pipe_screen *screen,
       ps->height = pt->height[level];
       ps->offset = offset;
       ps->usage = flags;
-      ps->status = PIPE_SURFACE_STATUS_DEFINED;
    }
    return ps;
 }
@@ -725,14 +724,6 @@ i915_init_texture_functions(struct i915_context *i915)
 static void
 i915_tex_surface_destroy(struct pipe_surface *surf)
 {
-   /* This really should not be possible, but it's actually
-    * happening quite a bit...  Will fix.
-    */
-   if (surf->status == PIPE_SURFACE_STATUS_CLEAR) {
-      debug_printf("XXX destroying a surface with pending clears...\n");
-      assert(0);
-   }
-
    pipe_texture_reference(&surf->texture, NULL);
    FREE(surf);
 }
index c921c0d38bedac1beaa6c3752f649a2b01d4c5cb..f44bd17451b4813f89b8748cdf2c7d588a6b0da5 100644 (file)
@@ -363,7 +363,6 @@ brw_get_tex_surface_screen(struct pipe_screen *screen,
       ps->nblocksy = pt->nblocksy[level];
       ps->stride = tex->stride;
       ps->offset = offset;
-      ps->status = PIPE_SURFACE_STATUS_DEFINED;
    }
    return ps;
 }
index 85dc017fbc4260b4aeaf6186811743e002319266..4da833c25e82335da2ef3ec7eebbe50f2fc159e4 100644 (file)
@@ -122,7 +122,6 @@ nv04_miptree_surface_new(struct pipe_screen *pscreen, struct pipe_texture *pt,
        ns->base.width = pt->width[level];
        ns->base.height = pt->height[level];
        ns->base.usage = flags;
-       ns->base.status = PIPE_SURFACE_STATUS_DEFINED;
        pipe_reference_init(&ns->base.reference, 1);
        ns->base.face = face;
        ns->base.level = level;
index bb3a1c0f19e83ba74e065813bdd5dc17fcb10f10..34e3c2ebd770e86d2456049a2e34e6f32b3f19fe 100644 (file)
@@ -136,7 +136,6 @@ nv10_miptree_surface_get(struct pipe_screen *screen, struct pipe_texture *pt,
        ns->base.width = pt->width[level];
        ns->base.height = pt->height[level];
        ns->base.usage = flags;
-       ns->base.status = PIPE_SURFACE_STATUS_DEFINED;
        pipe_reference_init(&ns->base.reference, 1);
        ns->base.face = face;
        ns->base.level = level;
index 29f4afd87c9487c39a660f0c2c9e83a4e51ddceb..81b6f3e78ac4690ea7f3fda1981f826ecfece170 100644 (file)
@@ -9,5 +9,4 @@ nv20_clear(struct pipe_context *pipe, struct pipe_surface *ps,
           unsigned clearValue)
 {
        pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, clearValue);
-       ps->status = PIPE_SURFACE_STATUS_CLEAR;
 }
index b2f29aff8d28a5d54231ec322f87f4d798d3e383..185fbf53e0f8fb7419fc9bd0939c0fbe9b2433b1 100644 (file)
@@ -170,7 +170,6 @@ nv20_miptree_surface_get(struct pipe_screen *screen, struct pipe_texture *pt,
        ns->base.width = pt->width[level];
        ns->base.height = pt->height[level];
        ns->base.usage = flags;
-       ns->base.status = PIPE_SURFACE_STATUS_DEFINED;
        pipe_reference_init(&ns->base.reference, 1);
        ns->base.face = face;
        ns->base.level = level;
index 8c3ca204d586912aa2ce86735a00bdcd6186e0b0..71f413588ee86edd934dc97305c7be70574643e7 100644 (file)
@@ -9,5 +9,4 @@ nv30_clear(struct pipe_context *pipe, struct pipe_surface *ps,
           unsigned clearValue)
 {
        pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, clearValue);
-       ps->status = PIPE_SURFACE_STATUS_CLEAR;
 }
index d6dc621c9eea4972bc6111039d51255065a8c99c..7f8054de733400588a61df830b6063db2115164a 100644 (file)
@@ -177,7 +177,6 @@ nv30_miptree_surface_new(struct pipe_screen *pscreen, struct pipe_texture *pt,
        ns->base.width = pt->width[level];
        ns->base.height = pt->height[level];
        ns->base.usage = flags;
-       ns->base.status = PIPE_SURFACE_STATUS_DEFINED;
        pipe_reference_init(&ns->base.reference, 1);
        ns->base.face = face;
        ns->base.level = level;
index f77b08ff6959096a3a514a02eba90f1928d8ec25..c18be20a32779d7e848047702745175b70e00060 100644 (file)
@@ -21,14 +21,6 @@ static void
 nv30_state_do_validate(struct nv30_context *nv30,
                       struct nv30_state_entry **states)
 {
-       const struct pipe_framebuffer_state *fb = &nv30->framebuffer;
-       unsigned i;
-
-       for (i = 0; i < fb->nr_cbufs; i++)
-               fb->cbufs[i]->status = PIPE_SURFACE_STATUS_DEFINED;
-       if (fb->zsbuf)
-               fb->zsbuf->status = PIPE_SURFACE_STATUS_DEFINED;
-
        while (*states) {
                struct nv30_state_entry *e = *states;
 
index 59efd620e3257a1218d8c430faa0bc9c996c4697..2c4e8f01fdac7ff4406784dc888eb62864713925 100644 (file)
@@ -9,5 +9,4 @@ nv40_clear(struct pipe_context *pipe, struct pipe_surface *ps,
           unsigned clearValue)
 {
        pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, clearValue);
-       ps->status = PIPE_SURFACE_STATUS_CLEAR;
 }
index abadca8c933d53e0b464e0d84b945d33e0eeb588..5a201ccf458041c1d0fc56d56ed0d19c0716f81b 100644 (file)
@@ -176,7 +176,6 @@ nv40_miptree_surface_new(struct pipe_screen *pscreen, struct pipe_texture *pt,
        ns->base.width = pt->width[level];
        ns->base.height = pt->height[level];
        ns->base.usage = flags;
-       ns->base.status = PIPE_SURFACE_STATUS_DEFINED;
        pipe_reference_init(&ns->base.reference, 1);
        ns->base.face = face;
        ns->base.level = level;
index ce859def1086f7e85878d91848a38dcc50f6d2af..10aae298328ef48e84b5e81b4637581622bfbd6f 100644 (file)
@@ -38,14 +38,6 @@ static void
 nv40_state_do_validate(struct nv40_context *nv40,
                       struct nv40_state_entry **states)
 {
-       const struct pipe_framebuffer_state *fb = &nv40->framebuffer;
-       unsigned i;
-
-       for (i = 0; i < fb->nr_cbufs; i++)
-               fb->cbufs[i]->status = PIPE_SURFACE_STATUS_DEFINED;
-       if (fb->zsbuf)
-               fb->zsbuf->status = PIPE_SURFACE_STATUS_DEFINED;
-
        while (*states) {
                struct nv40_state_entry *e = *states;
 
index f9bc3b53caa9775e5effd3f53124a9ae8a9fad18..db44a9da0e35bc39f276c62ced3a54bb03410721 100644 (file)
@@ -86,7 +86,5 @@ nv50_clear(struct pipe_context *pipe, struct pipe_surface *ps,
        pipe->set_framebuffer_state(pipe, &s_fb);
        pipe->set_scissor_state(pipe, &s_sc);
        nv50->dirty |= dirty;
-
-       ps->status = PIPE_SURFACE_STATUS_CLEAR;
 }
 
index dc4688ccdc46bdc645be0b326bfb6a7a9528fbac..f79a7ca86c9d96a85c07e9bea7ef12e6a1e541b8 100644 (file)
@@ -163,7 +163,6 @@ nv50_miptree_surface_new(struct pipe_screen *pscreen, struct pipe_texture *pt,
        ps->width = pt->width[level];
        ps->height = pt->height[level];
        ps->usage = flags;
-       ps->status = PIPE_SURFACE_STATUS_DEFINED;
        pipe_reference_init(&ps->reference, 1);
        ps->face = face;
        ps->level = level;
index 85098a78a25711045543d90427a34b8197e65a60..fc6157dbd09ba9f281eae04ac13f837a497c70eb 100644 (file)
@@ -178,17 +178,10 @@ nv50_state_emit(struct nv50_context *nv50)
 boolean
 nv50_state_validate(struct nv50_context *nv50)
 {
-       const struct pipe_framebuffer_state *fb = &nv50->framebuffer;
        struct nouveau_grobj *tesla = nv50->screen->tesla;
        struct nouveau_stateobj *so;
        unsigned i;
 
-       for (i = 0; i < fb->nr_cbufs; i++)
-               fb->cbufs[i]->status = PIPE_SURFACE_STATUS_DEFINED;
-
-       if (fb->zsbuf)
-               fb->zsbuf->status = PIPE_SURFACE_STATUS_DEFINED;
-
        if (nv50->dirty & NV50_NEW_FRAMEBUFFER)
                nv50_state_validate_fb(nv50);
 
index fd28437aaa4ff9a0f9d6f279746c6e25844a7ced..8506ed2942420814793e413159ccaf2f3ca41310 100644 (file)
@@ -29,5 +29,4 @@ void r300_clear(struct pipe_context* pipe,
                 unsigned color)
 {
     pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, color);
-    ps->status = PIPE_SURFACE_STATUS_DEFINED;
-}
\ No newline at end of file
+}
index 6cdea3d2854ff357f593021c487e346660f5f6b0..fe91f4e18449399d96b79ed25e5af75ce4675b93 100644 (file)
@@ -147,7 +147,6 @@ static struct pipe_surface* r300_get_tex_surface(struct pipe_screen* screen,
         surface->height = texture->height[level];
         surface->offset = offset;
         surface->usage = flags;
-        surface->status = PIPE_SURFACE_STATUS_DEFINED;
     }
 
     return surface;
index ad108ec446de75ecff7e25bd5d0a4885e912686b..a60c6c4c16fc9c66577d8ed18180cade0d6d74bd 100644 (file)
@@ -79,7 +79,6 @@ softpipe_clear(struct pipe_context *pipe, struct pipe_surface *ps,
 
    if (ps == sp_tile_cache_get_surface(softpipe->zsbuf_cache)) {
       sp_tile_cache_clear(softpipe->zsbuf_cache, clearValue);
-      softpipe->framebuffer.zsbuf->status = PIPE_SURFACE_STATUS_CLEAR;
 #if TILE_CLEAR_OPTIMIZATION
       return;
 #endif
@@ -96,7 +95,6 @@ softpipe_clear(struct pipe_context *pipe, struct pipe_surface *ps,
             cv = clearValue;
          }
          sp_tile_cache_clear(softpipe->cbuf_cache[i], cv);
-         softpipe->framebuffer.cbufs[i]->status = PIPE_SURFACE_STATUS_CLEAR;
       }
    }
 
index 96cb09b9051e674235239b7fc6fb0589010b5129..711343abe673e667e76577568600841bc1c84887 100644 (file)
@@ -1489,16 +1489,6 @@ void setup_prepare( struct setup_context *setup )
       softpipe_update_derived(sp);
    }
 
-   /* Mark surfaces as defined now */
-   for (i = 0; i < sp->framebuffer.nr_cbufs; i++){
-      if (sp->framebuffer.cbufs[i]) {
-         sp->framebuffer.cbufs[i]->status = PIPE_SURFACE_STATUS_DEFINED;
-      }
-   }
-   if (sp->framebuffer.zsbuf) {
-      sp->framebuffer.zsbuf->status = PIPE_SURFACE_STATUS_DEFINED;
-   }
-
    /* Note: nr_attrs is only used for debugging (vertex printing) */
    setup->quad.nr_attrs = draw_num_vs_outputs(sp->draw);
 
index f9fbe9aee79099c8d5e6551232f70fe82e145807..a9570c1aebdc7b690f69d924a3e6051e1fb4e67c 100644 (file)
@@ -406,8 +406,6 @@ void trace_dump_surface(const struct pipe_surface *state)
    trace_dump_reference(&state->reference);
 
    trace_dump_member(format, state, format);
-   trace_dump_member(uint, state, status);
-   trace_dump_member(uint, state, clear_value);
    trace_dump_member(uint, state, width);
    trace_dump_member(uint, state, height);
 
index 52d443970b034e961a05128e4d2c429f593d04ac..8e4f253359af0fbb3dc93d73fe08246d2698dd8c 100644 (file)
@@ -185,14 +185,6 @@ enum pipe_texture_target {
 #define PIPE_SURFACE_LAYOUT_LINEAR  0
 
 
-/**
- * Surface status
- */
-#define PIPE_SURFACE_STATUS_UNDEFINED  0
-#define PIPE_SURFACE_STATUS_DEFINED    1
-#define PIPE_SURFACE_STATUS_CLEAR      2
-
-
 /**
  * Transfer object usage flags
  */
index 9c7baa3d92e2331001df4a0d35be4feec0478fd0..705ae68ec659b318163e667f0b34f74df55e6535 100644 (file)
@@ -281,8 +281,6 @@ struct pipe_surface
 {
    struct pipe_reference reference;
    enum pipe_format format;      /**< PIPE_FORMAT_x */
-   unsigned status;              /**< PIPE_SURFACE_STATUS_x */
-   unsigned clear_value;         /**< XXX may be temporary */
    unsigned width;               /**< logical width in pixels */
    unsigned height;              /**< logical height in pixels */
    unsigned layout;              /**< PIPE_SURFACE_LAYOUT_x */
index ca545b12e6858e658ce3f55158e9968b4f3131f7..489aa8d9af5eb10774684dcb5df6bda848ebe126 100644 (file)
@@ -406,8 +406,6 @@ drm_swap_buffers(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw)
                        surf->user->pipe->flush(surf->user->pipe, PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_TEXTURE_CACHE, NULL);
                        /* TODO stuff here */
                }
-
-               st_notify_swapbuffers_complete(surf->stfb);
        }
 
        return EGL_TRUE;
index dd9ba2881f94a5a69f9d3ab1ae7dfed2990c985f..020684b4e141dbab5796ddb74823228bc083e35e 100644 (file)
@@ -291,11 +291,6 @@ clear_with_quad(GLcontext *ctx,
 static INLINE GLboolean
 check_clear_color_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb)
 {
-   const struct st_renderbuffer *strb = st_renderbuffer(rb);
-
-   if (strb->surface->status == PIPE_SURFACE_STATUS_UNDEFINED)
-      return FALSE;
-
    if (ctx->Scissor.Enabled)
       return TRUE;
 
@@ -312,14 +307,10 @@ check_clear_color_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb)
 static INLINE GLboolean
 check_clear_depth_stencil_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb)
 {
-   const struct st_renderbuffer *strb = st_renderbuffer(rb);
    const GLuint stencilMax = (1 << rb->StencilBits) - 1;
    GLboolean maskStencil
       = (ctx->Stencil.WriteMask[0] & stencilMax) != stencilMax;
 
-   if (strb->surface->status == PIPE_SURFACE_STATUS_UNDEFINED)
-      return FALSE;
-
    if (ctx->Scissor.Enabled)
       return TRUE;
 
@@ -339,14 +330,10 @@ check_clear_depth_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb)
    const struct st_renderbuffer *strb = st_renderbuffer(rb);
    const GLboolean isDS = is_depth_stencil_format(strb->surface->format);
 
-   if (strb->surface->status == PIPE_SURFACE_STATUS_UNDEFINED)
-      return FALSE;
-
    if (ctx->Scissor.Enabled)
       return TRUE;
 
    if (isDS && 
-       strb->surface->status == PIPE_SURFACE_STATUS_DEFINED &&
        ctx->DrawBuffer->Visual.stencilBits > 0)
       return TRUE;
 
@@ -366,9 +353,6 @@ check_clear_stencil_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb)
    const GLboolean maskStencil
       = (ctx->Stencil.WriteMask[0] & stencilMax) != stencilMax;
 
-   if (strb->surface->status == PIPE_SURFACE_STATUS_UNDEFINED)
-      return FALSE;
-
    if (maskStencil) 
       return TRUE;
 
@@ -381,7 +365,6 @@ check_clear_stencil_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb)
     * current state.
     */
    if (isDS && 
-       strb->surface->status == PIPE_SURFACE_STATUS_DEFINED &&
        ctx->DrawBuffer->Visual.depthBits > 0)
       return TRUE;
 
index 06fec20eeec62c467a23d5f34a9d9d6dde394fef..daaad65ccafdbf5f3e9aa6c5891021af4be2e8df 100644 (file)
@@ -293,32 +293,6 @@ st_notify_swapbuffers(struct st_framebuffer *stfb)
 }
 
 
-/** 
- * Quick hack - allows the winsys to inform the driver that surface
- * states are now undefined after a glXSwapBuffers or similar.
- */
-void
-st_notify_swapbuffers_complete(struct st_framebuffer *stfb)
-{
-   GET_CURRENT_CONTEXT(ctx);
-
-   if (ctx && ctx->DrawBuffer == &stfb->Base) {
-      struct st_renderbuffer *strb;
-
-      /* Mark back color buffers as undefined */
-      strb = st_renderbuffer(stfb->Base.Attachment[BUFFER_BACK_LEFT].
-                             Renderbuffer);
-      if (strb && strb->surface)
-         strb->surface->status = PIPE_SURFACE_STATUS_UNDEFINED;
-
-      strb = st_renderbuffer(stfb->Base.Attachment[BUFFER_BACK_RIGHT].
-                             Renderbuffer);
-      if (strb && strb->surface)
-         strb->surface->status = PIPE_SURFACE_STATUS_UNDEFINED;
-   }
-}
-
-
 void *st_framebuffer_private( struct st_framebuffer *stfb )
 {
    return stfb->Private;
index 414218bb589705e312d6d2a85517f0cc95f3e86f..030314372f95b5970fb38d96ee7e7309e001ad53 100644 (file)
@@ -100,7 +100,6 @@ void st_flush( struct st_context *st, uint pipeFlushFlags,
 void st_finish( struct st_context *st );
 
 void st_notify_swapbuffers(struct st_framebuffer *stfb);
-void st_notify_swapbuffers_complete(struct st_framebuffer *stfb);
 
 int st_set_teximage(struct pipe_texture *pt, int target);