Mesa (master): r300g: remove useless code

Marek Olšák mareko at kemper.freedesktop.org
Fri Oct 28 10:45:14 PDT 2011


Module: Mesa
Branch: master
Commit: 671af44b1962a7a138185a4cfb992f6b349de10a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=671af44b1962a7a138185a4cfb992f6b349de10a

Author: Marek Olšák <maraeo at gmail.com>
Date:   Fri Oct 28 17:44:02 2011 +0200

r300g: remove useless code

---

 src/gallium/drivers/r300/r300_context.c |    9 ---------
 src/gallium/drivers/r300/r300_context.h |    6 ------
 src/gallium/drivers/r300/r300_emit.c    |    4 ++--
 src/gallium/drivers/r300/r300_query.c   |    6 +-----
 4 files changed, 3 insertions(+), 22 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
index cacad9f..fb9f34a 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -62,7 +62,6 @@ static void r300_release_referenced_objects(struct r300_context *r300)
             (struct pipe_framebuffer_state*)r300->fb_state.state;
     struct r300_textures_state *textures =
             (struct r300_textures_state*)r300->textures_state.state;
-    struct r300_query *query, *temp;
     unsigned i;
 
     /* Framebuffer state. */
@@ -84,12 +83,6 @@ static void r300_release_referenced_objects(struct r300_context *r300)
     pipe_resource_reference(&r300->dummy_vb, NULL);
     pipe_resource_reference(&r300->vbo, NULL);
 
-    /* If there are any queries pending or not destroyed, remove them now. */
-    foreach_s(query, temp, &r300->query_list) {
-        remove_from_list(query);
-        FREE(query);
-    }
-
     r300->context.delete_depth_stencil_alpha_state(&r300->context,
                                                    r300->dsa_decompress_zmask);
 }
@@ -408,8 +401,6 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
 
     r300->context.destroy = r300_destroy_context;
 
-    make_empty_list(&r300->query_list);
-
     util_slab_create(&r300->pool_transfers,
                      sizeof(struct pipe_transfer), 64,
                      UTIL_SLAB_SINGLETHREADED);
diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h
index b89d6ec..0835356 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -293,12 +293,6 @@ struct r300_query {
     /* The buffer where query results are stored. */
     struct pb_buffer *buf;
     struct radeon_winsys_cs_handle *cs_buf;
-    /* The size of the buffer. */
-    unsigned buffer_size;
-
-    /* Linked list members. */
-    struct r300_query* prev;
-    struct r300_query* next;
 };
 
 struct r300_surface {
diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
index 2fb448a..d93a578 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -675,8 +675,8 @@ void r300_emit_query_end(struct r300_context* r300)
     query->num_results += query->num_pipes;
 
     /* XXX grab all the results and reset the counter. */
-    if (query->num_results >= query->buffer_size / 4 - 4) {
-        query->num_results = (query->buffer_size / 4) / 2;
+    if (query->num_results >= query->buf->size / 4 - 4) {
+        query->num_results = (query->buf->size / 4) / 2;
         fprintf(stderr, "r300: Rewinding OQBO...\n");
     }
 }
diff --git a/src/gallium/drivers/r300/r300_query.c b/src/gallium/drivers/r300/r300_query.c
index 3177ce6..9e784b5 100644
--- a/src/gallium/drivers/r300/r300_query.c
+++ b/src/gallium/drivers/r300/r300_query.c
@@ -45,17 +45,14 @@ static struct pipe_query *r300_create_query(struct pipe_context *pipe,
         return NULL;
 
     q->type = query_type;
-    q->buffer_size = 4096;
 
     if (r300screen->caps.family == CHIP_FAMILY_RV530)
         q->num_pipes = r300screen->info.r300_num_z_pipes;
     else
         q->num_pipes = r300screen->info.r300_num_gb_pipes;
 
-    insert_at_tail(&r300->query_list, q);
-
     /* Open up the occlusion query buffer. */
-    q->buf = r300->rws->buffer_create(r300->rws, q->buffer_size, 4096,
+    q->buf = r300->rws->buffer_create(r300->rws, 4096, 4096,
                                          PIPE_BIND_CUSTOM, PIPE_USAGE_STAGING);
     q->cs_buf = r300->rws->buffer_get_cs_handle(q->buf);
 
@@ -68,7 +65,6 @@ static void r300_destroy_query(struct pipe_context* pipe,
     struct r300_query* q = r300_query(query);
 
     pb_reference(&q->buf, NULL);
-    remove_from_list(q);
     FREE(query);
 }
 



More information about the mesa-commit mailing list