diff options
author | Marek Olšák <maraeo@gmail.com> | 2010-12-23 19:40:54 +1000 |
---|---|---|
committer | Marek Olšák <maraeo@gmail.com> | 2011-02-11 01:07:25 +0100 |
commit | 6ccab620a0e7364ab6c0d902b3ddf58ee988f7fa (patch) | |
tree | 6228427e261efd6187915ab651b78f99d3ff7dd1 /src/gallium/drivers/r300/r300_query.c | |
parent | c0beaf6e6d5764531a4cb21d0d0a9a1fd09affee (diff) |
r300g: import the last bits of libdrm and cleanup the whole thing
Based on Dave's branch.
The majority of this commit is a cleanup, mainly renaming things.
There wasn't much code to import, just ioctl calls.
Also done:
- implemented unsynchronized bo_map (important optimization!)
- radeon_bo_is_referenced_by_cs is no longer a refcount hack
- dropped the libdrm_radeon dependency
I'm surprised that this has resulted in less code in the end.
Diffstat (limited to 'src/gallium/drivers/r300/r300_query.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_query.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gallium/drivers/r300/r300_query.c b/src/gallium/drivers/r300/r300_query.c index 62dee8db59..da871dc3a8 100644 --- a/src/gallium/drivers/r300/r300_query.c +++ b/src/gallium/drivers/r300/r300_query.c @@ -60,7 +60,7 @@ static struct pipe_query *r300_create_query(struct pipe_context *pipe, q->buf = r300->rws->buffer_create(r300->rws, q->buffer_size, 4096, PIPE_BIND_CUSTOM, PIPE_USAGE_STREAM, q->domain); - q->cs_buf = r300->rws->buffer_get_cs_handle(r300->rws, q->buf); + q->cs_buf = r300->rws->buffer_get_cs_handle(q->buf); return (struct pipe_query*)q; } @@ -68,10 +68,9 @@ static struct pipe_query *r300_create_query(struct pipe_context *pipe, static void r300_destroy_query(struct pipe_context* pipe, struct pipe_query* query) { - struct r300_context *r300 = r300_context(pipe); struct r300_query* q = r300_query(query); - r300->rws->buffer_reference(r300->rws, &q->buf, NULL); + r300_winsys_bo_reference(&q->buf, NULL); remove_from_list(q); FREE(query); } @@ -137,7 +136,7 @@ static boolean r300_get_query_result(struct pipe_context* pipe, flags = PIPE_TRANSFER_READ | (!wait ? PIPE_TRANSFER_DONTBLOCK : 0); - map = r300->rws->buffer_map(r300->rws, q->buf, r300->cs, flags); + map = r300->rws->buffer_map(q->buf, r300->cs, flags); if (!map) return FALSE; @@ -148,7 +147,7 @@ static boolean r300_get_query_result(struct pipe_context* pipe, map++; } - r300->rws->buffer_unmap(r300->rws, q->buf); + r300->rws->buffer_unmap(q->buf); *result = temp; return TRUE; |