summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2011-05-31 15:48:21 +0300
committerAlon Levy <alevy@redhat.com>2011-08-26 16:22:12 +0300
commit9d1213a011076df5acb9e53e9dcad47e1e1316f0 (patch)
tree4d53a2fab7744db9707f0eaa8dcb91773a337b55 /src
parent36291600df2b8148164f91fb40662508140ad9a0 (diff)
g/d/r: use debug_printf instead of printf
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/remote/remote_debug.h3
-rw-r--r--src/gallium/drivers/remote/remote_util.h2
-rw-r--r--src/gallium/drivers/remote/tr_context.c22
-rw-r--r--src/gallium/drivers/remote/tr_screen.c28
4 files changed, 25 insertions, 30 deletions
diff --git a/src/gallium/drivers/remote/remote_debug.h b/src/gallium/drivers/remote/remote_debug.h
index 092ddb00f2..b05377fbd5 100644
--- a/src/gallium/drivers/remote/remote_debug.h
+++ b/src/gallium/drivers/remote/remote_debug.h
@@ -3,8 +3,7 @@
#define REMOTE_DEBUG_H
#ifdef CS_DEBUG
-#include <stdio.h>
-#define DBG(format, args...) printf(format, ## args)
+#define DBG(format, args...) debug_printf(format, ## args)
char* optotext(unsigned);
diff --git a/src/gallium/drivers/remote/remote_util.h b/src/gallium/drivers/remote/remote_util.h
index f5c6182b3d..35b1a4b866 100644
--- a/src/gallium/drivers/remote/remote_util.h
+++ b/src/gallium/drivers/remote/remote_util.h
@@ -1,7 +1,7 @@
#include "remote_state.h"
-#define PANIC_IF_NULL(ptr) if(!ptr) { printf("Unexpected null pointer; exiting.\n"); exit(1); }
+#define PANIC_IF_NULL(ptr) if(!ptr) { debug_printf("Unexpected null pointer; exiting.\n"); exit(1); }
#define SCREEN_HANDLE(screen) (screen ? ((struct remote_screen*)screen)->remote_handle : 0)
diff --git a/src/gallium/drivers/remote/tr_context.c b/src/gallium/drivers/remote/tr_context.c
index 6cc909fb9e..6aab497a01 100644
--- a/src/gallium/drivers/remote/tr_context.c
+++ b/src/gallium/drivers/remote/tr_context.c
@@ -39,9 +39,6 @@
#include "remote_messages.h"
#include "remote_debug.h"
-// TODO - remove printf in favor of ___, remove this include (here for olden vgallium)
-#include <stdio.h>
-
static INLINE void
remote_context_set_edgeflags(struct pipe_context *_pipe,
const unsigned *bitfield)
@@ -75,7 +72,7 @@ static INLINE void mark_surface_dirty(struct pipe_surface* surf) {
struct remote_texture* rtex = (struct remote_texture*)surf->texture;
if(!rtex) {
- printf("!!! Surface with no texture encountered\n");
+ debug_printf("!!! Surface with no texture encountered\n");
}
else {
struct remote_buffer* rbuf = (struct remote_buffer*)rtex->backing_buffer;
@@ -326,7 +323,7 @@ remote_context_get_query_result(struct pipe_context *_pipe,
return done;
}
else {
- printf("!!! Got a null reply to get_query_result\n");
+ debug_printf("!!! Got a null reply to get_query_result\n");
exit(1);
}
@@ -773,31 +770,30 @@ remote_context_set_clip_state(struct pipe_context *_pipe,
static INLINE void
remote_context_set_constant_buffer(struct pipe_context *_pipe,
uint shader, uint index,
- const struct pipe_constant_buffer *buffer)
+ struct pipe_resource *buffer)
{
DBG("Set constant buffer for shader %u, index %u\n", shader, index);
ALLOC_OUT_MESSAGE(set_constant_buffer, message);
-
+
message->base.opcode = REMREQ_SET_CONSTANT_BUFFER;
message->pipe = PIPE_HANDLE(_pipe);
message->shader = shader;
message->index = index;
- message->buffer_size = buffer->size;
- message->buffer = BUFFER_HANDLE(buffer->buffer);
+ message->buffer = BUFFER_HANDLE(buffer);
/*
char* mapped = (char*)pipe_buffer_map(_pipe->screen, buffer->buffer, PIPE_BUFFER_USAGE_CPU_READ);
- printf("On setting, constant buffer goes like this:\n");
+ debug_printf("On setting, constant buffer goes like this:\n");
int i;
for(i = 0; i < buffer->size; i++) {
- printf("%4d ", (int)mapped[i]);
+ debug_printf("%4d ", (int)mapped[i]);
if(i % 8 == 7)
- printf("\n");
+ debug_printf("\n");
}
- printf("\n");
+ debug_printf("\n");
pipe_buffer_unmap(_pipe->screen, buffer->buffer);
*/
diff --git a/src/gallium/drivers/remote/tr_screen.c b/src/gallium/drivers/remote/tr_screen.c
index 6f453b3435..ab9b7a482c 100644
--- a/src/gallium/drivers/remote/tr_screen.c
+++ b/src/gallium/drivers/remote/tr_screen.c
@@ -100,7 +100,7 @@ remote_screen_get_param(struct pipe_screen *_screen,
message->param = param;
if(analyse_waits)
- printf("WAIT: get_param\n");
+ debug_printf("WAIT: get_param\n");
QUEUE_AND_WAIT(message, get_param, reply);
DBG("Get integer parameter %d: value is %d\n", param, reply->response);
@@ -131,7 +131,7 @@ remote_screen_get_paramf(struct pipe_screen *_screen,
message->param = param;
if(analyse_waits)
- printf("WAIT: float param\n");
+ debug_printf("WAIT: float param\n");
QUEUE_AND_WAIT(message, get_paramf, reply);
DBG("Get FP parameter %d: value is %f\n", param, reply->response);
@@ -164,7 +164,7 @@ remote_screen_is_format_supported(struct pipe_screen *_screen,
message->geom_flags = geom_flags;
if(analyse_waits)
- printf("WAIT: format_supported\n");
+ debug_printf("WAIT: format_supported\n");
QUEUE_AND_WAIT(message, is_format_supported, reply);
if(reply->response)
@@ -334,7 +334,7 @@ remote_screen_texture_release(struct pipe_screen *_screen,
pipe_buffer_reference(_screen, &rtex->backing_buffer, NULL);
}
else {
- printf("!!! Freeing a texture with no backing buffer\n");
+ debug_printf("!!! Freeing a texture with no backing buffer\n");
}
FREE(*ptexture);
@@ -471,7 +471,7 @@ remote_screen_tex_surface_release(struct pipe_screen *_screen,
pipe_buffer_reference(_screen, &((*psurface)->buffer), NULL);
}
else {
- printf("!!! tex_surface_release with no buffer\n");
+ debug_printf("!!! tex_surface_release with no buffer\n");
}
ALLOC_OUT_MESSAGE(tex_surface_release, message);
@@ -579,7 +579,7 @@ remote_screen_create(struct pipe_winsys* winsys)
char* analyse_waits_env = getenv("VG_ANALYSE_WAITS");
if(analyse_waits_env) {
if(analyse_waits_env[0] == '1') {
- printf("Enabled wait analysis\n");
+ debug_printf("Enabled wait analysis\n");
analyse_waits = 1;
}
}
@@ -595,14 +595,14 @@ remote_screen_create(struct pipe_winsys* winsys)
DBG("Socket fd is %d\n", tr_scr->socketfd);
if(tr_scr->socketfd == -1) {
- printf("socket() failed creating a new screen\n");
+ debug_printf("socket() failed creating a new screen\n");
exit(1);
}
if(connect(tr_scr->socketfd,
&sun,
sizeof(sun.sun_family) + strlen(sun.sun_path)) < 0) {
- printf("Couldn't connect to /var/run/xen3dd-socket\n");
+ debug_printf("Couldn't connect to /var/run/xen3dd-socket\n");
exit(1);
}
@@ -634,7 +634,7 @@ remote_screen_create(struct pipe_winsys* winsys)
DBG("Opened /dev/gntmem; got fd %d\n", fd);
if(fd == -1) {
- printf("Failed to open /dev/gntmem\n");
+ debug_printf("Failed to open /dev/gntmem\n");
exit(1);
}
@@ -643,7 +643,7 @@ remote_screen_create(struct pipe_winsys* winsys)
DBG("set-domain 0 returned %d\n", ret);
if(ret == -1) {
- printf("Failed to set gntmem's target domain\n");
+ debug_printf("Failed to set gntmem's target domain\n");
exit(1);
}
@@ -652,7 +652,7 @@ remote_screen_create(struct pipe_winsys* winsys)
DBG("set-size 4 returned %d\n", ret);
if(ret == -1) {
- printf("Failed to create a shareable section of 4 pages\n");
+ debug_printf("Failed to create a shareable section of 4 pages\n");
exit(1);
}
@@ -670,7 +670,7 @@ remote_screen_create(struct pipe_winsys* winsys)
}
if(ret == -1) {
- printf("Failed to get grants for shared section\n");
+ debug_printf("Failed to get grants for shared section\n");
exit(1);
}
@@ -680,7 +680,7 @@ remote_screen_create(struct pipe_winsys* winsys)
DBG("Mapped as a shared section: got address %p\n", *(togrant[i].map));
if(*(togrant[i].map) == (void*)-1) {
- printf("Couldn't mmap our shared section\n");
+ debug_printf("Couldn't mmap our shared section\n");
exit(1);
}
@@ -727,7 +727,7 @@ remote_screen_create(struct pipe_winsys* winsys)
DBG("Just sent %d bytes\n", sent);
if(sent <= 0) {
- printf("Failed to send init message to xen3dd: return %d with errno %d\n", sent, errno);
+ debug_printf("Failed to send init message to xen3dd: return %d with errno %d\n", sent, errno);
exit(1);
}
else {