summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2018-03-01 13:18:33 +0100
committerThierry Reding <treding@nvidia.com>2018-04-04 16:25:38 +0200
commit92b24a571cf6cb2992788fa118209fcd043cbed1 (patch)
tree877ec7ebdab5bc14260408c6b0849e0fe81c2c3d
parentc755e7be689e89ecfe72ec1965098820247b51c7 (diff)
remove debug messages
-rw-r--r--src/gallium/drivers/nouveau/nouveau_fence.c5
-rw-r--r--src/gallium/drivers/nouveau/nouveau_screen.c52
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_miptree.c21
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_context.c10
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c26
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_resource.c20
-rw-r--r--src/gallium/drivers/tegra/tegra_context.c624
-rw-r--r--src/gallium/drivers/tegra/tegra_screen.c320
-rw-r--r--src/gallium/winsys/tegra/drm/tegra_drm_winsys.c10
9 files changed, 87 insertions, 1001 deletions
diff --git a/src/gallium/drivers/nouveau/nouveau_fence.c b/src/gallium/drivers/nouveau/nouveau_fence.c
index 5380aff885d..b508b9b7163 100644
--- a/src/gallium/drivers/nouveau/nouveau_fence.c
+++ b/src/gallium/drivers/nouveau/nouveau_fence.c
@@ -174,8 +174,6 @@ nouveau_fence_kick(struct nouveau_fence *fence)
{
struct nouveau_screen *screen = fence->screen;
- debug_printf("> %s(fence=%p)\n", __func__, fence);
-
/* wtf, someone is waiting on a fence in flush_notify handler? */
assert(fence->state != NOUVEAU_FENCE_STATE_EMITTING);
@@ -191,8 +189,6 @@ nouveau_fence_kick(struct nouveau_fence *fence)
if (fence->state < NOUVEAU_FENCE_STATE_FLUSHED) {
if (nouveau_pushbuf_kick_fence(screen->pushbuf, screen->pushbuf->channel, &fence->fd))
return false;
-
- debug_printf(" fd: %d\n", fence->fd);
}
if (fence == screen->fence.current)
@@ -200,7 +196,6 @@ nouveau_fence_kick(struct nouveau_fence *fence)
nouveau_fence_update(screen, false);
- debug_printf("< %s() = true\n", __func__);
return true;
}
diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c
index c68d8b483fb..d2c01d98ecc 100644
--- a/src/gallium/drivers/nouveau/nouveau_screen.c
+++ b/src/gallium/drivers/nouveau/nouveau_screen.c
@@ -93,15 +93,8 @@ nouveau_screen_fence_get_fd(struct pipe_screen *screen,
struct pipe_fence_handle *pfence)
{
struct nouveau_fence *fence = nouveau_fence(pfence);
- int ret;
-
- debug_printf("> %s(screen=%p, pfence=%p)\n", __func__, screen, pfence);
- debug_printf(" fd: %d\n", fence->fd);
-
- ret = dup(fence->fd);
- debug_printf("< %s() = %d\n", __func__, ret);
- return ret;
+ return dup(fence->fd);
}
struct nouveau_bo *
@@ -148,42 +141,18 @@ nouveau_screen_bo_get_handle(struct pipe_screen *pscreen,
unsigned stride,
struct winsys_handle *whandle)
{
- struct nouveau_device *dev = bo->device;
- bool ret = false;
-
- debug_printf("> %s(pscreen=%p, bo=%p, stride=%u, whandle=%p)\n", __func__, pscreen, bo, stride, whandle);
- debug_printf(" handle: %u\n", whandle->handle);
- debug_printf(" type: %u\n", whandle->type);
-
- if (dev->chipset >= 0xc0) {
- debug_printf(" config: nvc0\n");
- debug_printf(" memtype: %08x\n", bo->config.nvc0.memtype);
- debug_printf(" tile_mode: %08x\n", bo->config.nvc0.tile_mode);
- } else if (dev->chipset >= 0x50) {
- debug_printf(" config: nv50\n");
- debug_printf(" memtype: %08x\n", bo->config.nv50.memtype);
- debug_printf(" tile_mode: %08x\n", bo->config.nv50.tile_mode);
- } else {
- debug_printf(" config: nv04\n");
- debug_printf(" surf_flags: %08x\n", bo->config.nv04.surf_flags);
- debug_printf(" surf_pitch: %08x\n", bo->config.nv04.surf_pitch);
- }
-
whandle->stride = stride;
if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {
- ret = nouveau_bo_name_get(bo, &whandle->handle) == 0;
+ return nouveau_bo_name_get(bo, &whandle->handle) == 0;
} else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) {
whandle->handle = bo->handle;
- ret = true;
+ return true;
} else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {
- ret = nouveau_bo_set_prime(bo, (int *)&whandle->handle) == 0;
+ return nouveau_bo_set_prime(bo, (int *)&whandle->handle) == 0;
+ } else {
+ return false;
}
-
- debug_printf(" whandle: %x\n", whandle->handle);
- debug_printf(" modifier: %" PRIx64 "\n", whandle->modifier);
- debug_printf("< %s() = %s\n", __func__, ret ? "true" : "false");
- return ret;
}
static void
@@ -345,13 +314,8 @@ nouveau_create_fence_fd(struct pipe_context *pipe,
{
struct nouveau_screen *screen = nouveau_screen(pipe->screen);
- debug_printf("> %s(pipe=%p, pfence=%p, fd=%d, type=%d)\n", __func__, pipe,
- pfence, fd, type);
-
assert(type == PIPE_FD_TYPE_NATIVE_SYNC);
nouveau_fence_fd(screen, (struct nouveau_fence **)pfence, fd);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -361,11 +325,7 @@ nouveau_fence_server_sync(struct pipe_context *pipe,
struct nouveau_context *context = nouveau_context(pipe);
struct nouveau_fence *fence = nouveau_fence(pfence);
- debug_printf("> %s(pipe=%p, pfence=%p)\n", __func__, pipe, pfence);
-
sync_accumulate("nouveau", &context->in_fence_fd, fence->fd);
-
- debug_printf("< %s()\n", __func__);
}
void
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_miptree.c b/src/gallium/drivers/nouveau/nv50/nv50_miptree.c
index e3399aa76d4..f2e304fde62 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_miptree.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_miptree.c
@@ -185,25 +185,16 @@ nv50_miptree_get_handle(struct pipe_screen *pscreen,
{
struct nv50_miptree *mt = nv50_miptree(pt);
unsigned stride;
- bool ret;
- debug_printf("> %s(pscreen=%p, pt=%p, whandle=%p)\n", __func__, pscreen, pt, whandle);
-
- if (!mt || !mt->base.bo) {
- ret = false;
- goto out;
- }
+ if (!mt || !mt->base.bo)
+ return false;
stride = mt->level[0].pitch;
- ret = nouveau_screen_bo_get_handle(pscreen,
- mt->base.bo,
- stride,
- whandle);
-
-out:
- debug_printf("< %s() = %d\n", __func__, ret);
- return ret;
+ return nouveau_screen_bo_get_handle(pscreen,
+ mt->base.bo,
+ stride,
+ whandle);
}
const struct u_resource_vtbl nv50_miptree_vtbl =
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c
index 170a18d6560..609a5abbef8 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c
@@ -36,11 +36,6 @@ nvc0_flush(struct pipe_context *pipe,
struct nvc0_context *nvc0 = nvc0_context(pipe);
struct nouveau_screen *screen = &nvc0->screen->base;
- debug_printf("> %s(pipe=%p, pfence=%p, flags=%x)\n", __func__, pipe, pfence, flags);
-#ifdef DEBUG
- debug_print_flush_flags(" flags", flags);
-#endif
-
if (pfence)
nouveau_fence_ref(screen->fence.current, (struct nouveau_fence **)pfence);
@@ -50,10 +45,7 @@ nvc0_flush(struct pipe_context *pipe,
struct nouveau_object *channel = pushbuf->channel;
int fd = nvc0->base.in_fence_fd;
- debug_printf(" fd < %d\n", fd);
nouveau_pushbuf_kick_fence(pushbuf, channel, &fd);
- debug_printf(" current: %p\n", fence);
- debug_printf(" fd > %d\n", fd);
nvc0->base.in_fence_fd = -1;
fence->fd = fd;
} else {
@@ -61,8 +53,6 @@ nvc0_flush(struct pipe_context *pipe,
}
nouveau_context_update_frame_stats(&nvc0->base);
-
- debug_printf("< %s()\n", __func__);
}
static void
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c b/src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c
index e05f1e2b2cd..7983c403087 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c
@@ -41,18 +41,13 @@ static uint32_t
nvc0_mt_choose_storage_type(struct nv50_miptree *mt, bool compressed)
{
const unsigned ms = util_logbase2(mt->base.base.nr_samples);
- uint32_t tile_flags;
- debug_printf("> %s(mt=%p, compressed=%d)\n", __func__, mt, compressed);
+ uint32_t tile_flags;
- if (unlikely(mt->base.base.bind & PIPE_BIND_CURSOR)) {
- tile_flags = 0;
- goto out;
- }
- if (unlikely(mt->base.base.flags & NOUVEAU_RESOURCE_FLAG_LINEAR)) {
- tile_flags = 0;
- goto out;
- }
+ if (unlikely(mt->base.base.bind & PIPE_BIND_CURSOR))
+ return 0;
+ if (unlikely(mt->base.base.flags & NOUVEAU_RESOURCE_FLAG_LINEAR))
+ return 0;
switch (mt->base.base.format) {
case PIPE_FORMAT_Z16_UNORM:
@@ -106,8 +101,7 @@ nvc0_mt_choose_storage_type(struct nv50_miptree *mt, bool compressed)
case 2: tile_flags = 0xed; break;
case 3: tile_flags = 0xf2; break;
default:
- tile_flags = 0;
- goto out;
+ return 0;
}
} else {
tile_flags = 0xfe;
@@ -123,8 +117,7 @@ nvc0_mt_choose_storage_type(struct nv50_miptree *mt, bool compressed)
case 2: tile_flags = 0xdf; break;
case 3: tile_flags = 0xe4; break;
default:
- tile_flags = 0;
- goto out;
+ return 0;
}
} else {
tile_flags = 0xfe;
@@ -135,14 +128,11 @@ nvc0_mt_choose_storage_type(struct nv50_miptree *mt, bool compressed)
tile_flags = 0xfe;
break;
default:
- tile_flags = 0;
- goto out;
+ return 0;
}
break;
}
-out:
- debug_printf("< %s() = %x\n", __func__, tile_flags);
return tile_flags;
}
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c b/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c
index edc85b1c5db..ec6257a8963 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c
@@ -4,7 +4,6 @@
#include "nvc0/nvc0_resource.h"
#include "nouveau_screen.h"
-#include "util/u_modifier.h"
static struct pipe_resource *
nvc0_resource_create(struct pipe_screen *screen,
@@ -25,27 +24,12 @@ nvc0_resource_create_with_modifiers(struct pipe_screen *screen,
const struct pipe_resource *templ,
const uint64_t *modifiers, int count)
{
- struct pipe_resource *resource;
- int i;
-
- debug_printf("> %s(screen=%p, templ=%p, modifiers=%p, count=%d)\n",
- __func__, screen, templ, modifiers, count);
- debug_printf(" modifiers: %d\n", count);
- for (i = 0; i < count; i++)
- debug_printf(" %d: %" PRIu64 " (%s)\n", i, modifiers[i],
- util_modifier_name(modifiers[i]));
-
switch (templ->target) {
case PIPE_BUFFER:
- resource = nouveau_buffer_create(screen, templ);
- break;
+ return nouveau_buffer_create(screen, templ);
default:
- resource = nvc0_miptree_create(screen, templ, modifiers, count);
- break;
+ return nvc0_miptree_create(screen, templ, modifiers, count);
}
-
- debug_printf("< %s() = %p\n", __func__, resource);
- return resource;
}
static void
diff --git a/src/gallium/drivers/tegra/tegra_context.c b/src/gallium/drivers/tegra/tegra_context.c
index 4dfd40eae13..bbc03628336 100644
--- a/src/gallium/drivers/tegra/tegra_context.c
+++ b/src/gallium/drivers/tegra/tegra_context.c
@@ -37,15 +37,11 @@ tegra_destroy(struct pipe_context *pcontext)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p)\n", __func__, pcontext);
-
if (context->base.stream_uploader)
u_upload_destroy(context->base.stream_uploader);
context->gpu->destroy(context->gpu);
free(context);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -56,37 +52,22 @@ tegra_draw_vbo(struct pipe_context *pcontext,
struct pipe_draw_indirect_info indirect;
struct pipe_draw_info info;
- debug_printf("> %s(pcontext=%p, pinfo=%p)\n", __func__, pcontext, pinfo);
- debug_printf(" pinfo:\n");
- debug_printf(" index_size: %u\n", pinfo->index_size);
- debug_printf(" mode: %x\n", pinfo->mode);
- debug_printf(" start: %u\n", pinfo->start);
- debug_printf(" count: %u\n", pinfo->count);
-
if (pinfo && (pinfo->indirect || pinfo->index_size)) {
- debug_printf(" unwrapping pipe_draw_info\n");
-
memcpy(&info, pinfo, sizeof(info));
if (pinfo->indirect) {
- debug_printf(" unwrapping pipe_draw_indirect_info\n");
-
memcpy(&indirect, pinfo->indirect, sizeof(indirect));
indirect.buffer = tegra_resource_unwrap(info.indirect->buffer);
info.indirect = &indirect;
}
- if (pinfo->index_size && !pinfo->has_user_indices) {
- debug_printf(" unwrapping index buffer\n");
+ if (pinfo->index_size && !pinfo->has_user_indices)
info.index.resource = tegra_resource_unwrap(info.index.resource);
- }
pinfo = &info;
}
context->gpu->draw_vbo(context->gpu, pinfo);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -97,12 +78,7 @@ tegra_render_condition(struct pipe_context *pcontext,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, query=%p, condition=%d, mode=%u)\n",
- __func__, pcontext, query, condition, mode);
-
context->gpu->render_condition(context->gpu, query, condition, mode);
-
- debug_printf("< %s()\n", __func__);
}
static struct pipe_query *
@@ -110,15 +86,8 @@ tegra_create_query(struct pipe_context *pcontext, unsigned int query_type,
unsigned int index)
{
struct tegra_context *context = to_tegra_context(pcontext);
- struct pipe_query *query;
-
- debug_printf("> %s(pcontext=%p, query_type=%u, index=%u)\n", __func__,
- pcontext, query_type, index);
-
- query = context->gpu->create_query(context->gpu, query_type, index);
- debug_printf("< %s() = %p\n", __func__, query);
- return query;
+ return context->gpu->create_query(context->gpu, query_type, index);
}
static struct pipe_query *
@@ -127,16 +96,9 @@ tegra_create_batch_query(struct pipe_context *pcontext,
unsigned int *queries)
{
struct tegra_context *context = to_tegra_context(pcontext);
- struct pipe_query *query;
- debug_printf("> %s(pcontext=%p, num_queries=%u, queries=%p)\n", __func__,
- pcontext, num_queries, queries);
-
- query = context->gpu->create_batch_query(context->gpu, num_queries,
- queries);
-
- debug_printf("< %s() = %p\n", __func__, query);
- return query;
+ return context->gpu->create_batch_query(context->gpu, num_queries,
+ queries);
}
static void
@@ -144,39 +106,23 @@ tegra_destroy_query(struct pipe_context *pcontext, struct pipe_query *query)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, query=%p)\n", __func__, pcontext, query);
-
context->gpu->destroy_query(context->gpu, query);
-
- debug_printf("< %s()\n", __func__);
}
static boolean
tegra_begin_query(struct pipe_context *pcontext, struct pipe_query *query)
{
struct tegra_context *context = to_tegra_context(pcontext);
- boolean ret;
-
- debug_printf("> %s(pcontext=%p, query=%p)\n", __func__, pcontext, query);
- ret = context->gpu->begin_query(context->gpu, query);
-
- debug_printf("< %s() = %d\n", __func__, ret);
- return ret;
+ return context->gpu->begin_query(context->gpu, query);
}
static bool
tegra_end_query(struct pipe_context *pcontext, struct pipe_query *query)
{
struct tegra_context *context = to_tegra_context(pcontext);
- bool ret;
-
- debug_printf("> %s(pcontext=%p, query=%p)\n", __func__, pcontext, query);
- ret = context->gpu->end_query(context->gpu, query);
-
- debug_printf("< %s()\n", __func__);
- return ret;
+ return context->gpu->end_query(context->gpu, query);
}
static boolean
@@ -186,15 +132,9 @@ tegra_get_query_result(struct pipe_context *pcontext,
union pipe_query_result *result)
{
struct tegra_context *context = to_tegra_context(pcontext);
- boolean ret;
-
- debug_printf("> %s(pcontext=%p, query=%p, wait=%d, result=%p)\n", __func__,
- pcontext, query, wait, result);
-
- ret = context->gpu->get_query_result(context->gpu, query, wait, result);
- debug_printf("< %s() = %d\n", __func__, ret);
- return ret;
+ return context->gpu->get_query_result(context->gpu, query, wait,
+ result);
}
static void
@@ -208,15 +148,9 @@ tegra_get_query_result_resource(struct pipe_context *pcontext,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, query=%p, wait=%d, result_type=%d, index=%d, resource=%p, offset=%u)\n",
- __func__, pcontext, query, wait, result_type, index, resource,
- offset);
-
context->gpu->get_query_result_resource(context->gpu, query, wait,
result_type, index, resource,
offset);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -224,11 +158,7 @@ tegra_set_active_query_state(struct pipe_context *pcontext, boolean enable)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, enable=%d)\n", __func__, pcontext, enable);
-
context->gpu->set_active_query_state(context->gpu, enable);
-
- debug_printf("< %s()\n", __func__);
}
static void *
@@ -236,14 +166,8 @@ tegra_create_blend_state(struct pipe_context *pcontext,
const struct pipe_blend_state *cso)
{
struct tegra_context *context = to_tegra_context(pcontext);
- void *so;
-
- debug_printf("> %s(pcontext=%p, cso=%p)\n", __func__, pcontext, cso);
-
- so = context->gpu->create_blend_state(context->gpu, cso);
- debug_printf("< %s() = %p\n", __func__, so);
- return so;
+ return context->gpu->create_blend_state(context->gpu, cso);
}
static void
@@ -251,11 +175,7 @@ tegra_bind_blend_state(struct pipe_context *pcontext, void *so)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, so=%p)\n", __func__, pcontext, so);
-
context->gpu->bind_blend_state(context->gpu, so);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -263,11 +183,7 @@ tegra_delete_blend_state(struct pipe_context *pcontext, void *so)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, so=%p)\n", __func__, pcontext, so);
-
context->gpu->delete_blend_state(context->gpu, so);
-
- debug_printf("< %s()\n", __func__);
}
static void *
@@ -275,14 +191,8 @@ tegra_create_sampler_state(struct pipe_context *pcontext,
const struct pipe_sampler_state *cso)
{
struct tegra_context *context = to_tegra_context(pcontext);
- void *so;
- debug_printf("> %s(pcontext=%p, cso=%p)\n", __func__, pcontext, cso);
-
- so = context->gpu->create_sampler_state(context->gpu, cso);
-
- debug_printf("< %s() = %p\n", __func__, so);
- return so;
+ return context->gpu->create_sampler_state(context->gpu, cso);
}
static void
@@ -292,14 +202,8 @@ tegra_bind_sampler_states(struct pipe_context *pcontext, unsigned shader,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, shader=%u, start_slot=%u, num_samplers=%u, samplers=%p)\n",
- __func__, pcontext, shader, start_slot, num_samplers,
- samplers);
-
context->gpu->bind_sampler_states(context->gpu, shader, start_slot,
num_samplers, samplers);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -307,11 +211,7 @@ tegra_delete_sampler_state(struct pipe_context *pcontext, void *so)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, so=%p)\n", __func__, pcontext, so);
-
context->gpu->delete_sampler_state(context->gpu, so);
-
- debug_printf("< %s()\n", __func__);
}
static void *
@@ -319,14 +219,8 @@ tegra_create_rasterizer_state(struct pipe_context *pcontext,
const struct pipe_rasterizer_state *cso)
{
struct tegra_context *context = to_tegra_context(pcontext);
- void *so;
-
- debug_printf("> %s(pcontext=%p, cso=%p)\n", __func__, pcontext, cso);
- so = context->gpu->create_rasterizer_state(context->gpu, cso);
-
- debug_printf("< %s() = %p\n", __func__, so);
- return so;
+ return context->gpu->create_rasterizer_state(context->gpu, cso);
}
static void
@@ -334,11 +228,7 @@ tegra_bind_rasterizer_state(struct pipe_context *pcontext, void *so)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, so=%p)\n", __func__, pcontext, so);
-
context->gpu->bind_rasterizer_state(context->gpu, so);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -346,11 +236,7 @@ tegra_delete_rasterizer_state(struct pipe_context *pcontext, void *so)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, so=%p)\n", __func__, pcontext, so);
-
context->gpu->delete_rasterizer_state(context->gpu, so);
-
- debug_printf("< %s()\n", __func__);
}
static void *
@@ -358,14 +244,8 @@ tegra_create_depth_stencil_alpha_state(struct pipe_context *pcontext,
const struct pipe_depth_stencil_alpha_state *cso)
{
struct tegra_context *context = to_tegra_context(pcontext);
- void *so;
-
- debug_printf("> %s(pcontext=%p, cso=%p)\n", __func__, pcontext, cso);
-
- so = context->gpu->create_depth_stencil_alpha_state(context->gpu, cso);
- debug_printf("< %s() = %p\n", __func__, so);
- return so;
+ return context->gpu->create_depth_stencil_alpha_state(context->gpu, cso);
}
static void
@@ -373,11 +253,7 @@ tegra_bind_depth_stencil_alpha_state(struct pipe_context *pcontext, void *so)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, so=%p)\n", __func__, pcontext, so);
-
context->gpu->bind_depth_stencil_alpha_state(context->gpu, so);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -385,11 +261,7 @@ tegra_delete_depth_stencil_alpha_state(struct pipe_context *pcontext, void *so)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, so=%p)\n", __func__, pcontext, so);
-
context->gpu->delete_depth_stencil_alpha_state(context->gpu, so);
-
- debug_printf("< %s()\n", __func__);
}
static void *
@@ -397,14 +269,8 @@ tegra_create_fs_state(struct pipe_context *pcontext,
const struct pipe_shader_state *cso)
{
struct tegra_context *context = to_tegra_context(pcontext);
- void *so;
-
- debug_printf("> %s(pcontext=%p, cso=%p)\n", __func__, pcontext, cso);
-
- so = context->gpu->create_fs_state(context->gpu, cso);
- debug_printf("< %s() = %p\n", __func__, so);
- return so;
+ return context->gpu->create_fs_state(context->gpu, cso);
}
static void
@@ -412,11 +278,7 @@ tegra_bind_fs_state(struct pipe_context *pcontext, void *so)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, so=%p)\n", __func__, pcontext, so);
-
context->gpu->bind_fs_state(context->gpu, so);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -424,11 +286,7 @@ tegra_delete_fs_state(struct pipe_context *pcontext, void *so)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, so=%p)\n", __func__, pcontext, so);
-
context->gpu->delete_fs_state(context->gpu, so);
-
- debug_printf("< %s()\n", __func__);
}
static void *
@@ -436,14 +294,8 @@ tegra_create_vs_state(struct pipe_context *pcontext,
const struct pipe_shader_state *cso)
{
struct tegra_context *context = to_tegra_context(pcontext);
- void *so;
-
- debug_printf("> %s(pcontext=%p, cso=%p)\n", __func__, pcontext, cso);
- so = context->gpu->create_vs_state(context->gpu, cso);
-
- debug_printf("< %s() = %p\n", __func__, so);
- return so;
+ return context->gpu->create_vs_state(context->gpu, cso);
}
static void
@@ -451,11 +303,7 @@ tegra_bind_vs_state(struct pipe_context *pcontext, void *so)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, so=%p)\n", __func__, pcontext, so);
-
context->gpu->bind_vs_state(context->gpu, so);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -463,11 +311,7 @@ tegra_delete_vs_state(struct pipe_context *pcontext, void *so)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, so=%p)\n", __func__, pcontext, so);
-
context->gpu->delete_vs_state(context->gpu, so);
-
- debug_printf("< %s()\n", __func__);
}
static void *
@@ -475,14 +319,8 @@ tegra_create_gs_state(struct pipe_context *pcontext,
const struct pipe_shader_state *cso)
{
struct tegra_context *context = to_tegra_context(pcontext);
- void *so;
- debug_printf("> %s(pcontext=%p, cso=%p)\n", __func__, pcontext, cso);
-
- so = context->gpu->create_gs_state(context->gpu, cso);
-
- debug_printf("< %s() = %p\n", __func__, so);
- return so;
+ return context->gpu->create_gs_state(context->gpu, cso);
}
static void
@@ -490,11 +328,7 @@ tegra_bind_gs_state(struct pipe_context *pcontext, void *so)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, so=%p)\n", __func__, pcontext, so);
-
context->gpu->bind_gs_state(context->gpu, so);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -502,11 +336,7 @@ tegra_delete_gs_state(struct pipe_context *pcontext, void *so)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, so=%p)\n", __func__, pcontext, so);
-
context->gpu->delete_gs_state(context->gpu, so);
-
- debug_printf("< %s()\n", __func__);
}
static void *
@@ -514,14 +344,8 @@ tegra_create_tcs_state(struct pipe_context *pcontext,
const struct pipe_shader_state *cso)
{
struct tegra_context *context = to_tegra_context(pcontext);
- void *so;
-
- debug_printf("> %s(pcontext=%p, cso=%p)\n", __func__, pcontext, cso);
- so = context->gpu->create_tcs_state(context->gpu, cso);
-
- debug_printf("< %s() = %p\n", __func__, so);
- return so;
+ return context->gpu->create_tcs_state(context->gpu, cso);
}
static void
@@ -529,11 +353,7 @@ tegra_bind_tcs_state(struct pipe_context *pcontext, void *so)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, so=%p)\n", __func__, pcontext, so);
-
context->gpu->bind_tcs_state(context->gpu, so);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -541,11 +361,7 @@ tegra_delete_tcs_state(struct pipe_context *pcontext, void *so)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, so=%p)\n", __func__, pcontext, so);
-
context->gpu->delete_tcs_state(context->gpu, so);
-
- debug_printf("< %s()\n", __func__);
}
static void *
@@ -553,14 +369,8 @@ tegra_create_tes_state(struct pipe_context *pcontext,
const struct pipe_shader_state *cso)
{
struct tegra_context *context = to_tegra_context(pcontext);
- void *so;
-
- debug_printf("> %s(pcontext=%p, cso=%p)\n", __func__, pcontext, cso);
-
- so = context->gpu->create_tes_state(context->gpu, cso);
- debug_printf("< %s() = %p\n", __func__, so);
- return so;
+ return context->gpu->create_tes_state(context->gpu, cso);
}
static void
@@ -568,11 +378,7 @@ tegra_bind_tes_state(struct pipe_context *pcontext, void *so)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, so=%p)\n", __func__, pcontext, so);
-
context->gpu->bind_tes_state(context->gpu, so);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -580,11 +386,7 @@ tegra_delete_tes_state(struct pipe_context *pcontext, void *so)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, so=%p)\n", __func__, pcontext, so);
-
context->gpu->delete_tes_state(context->gpu, so);
-
- debug_printf("< %s()\n", __func__);
}
static void *
@@ -593,16 +395,10 @@ tegra_create_vertex_elements_state(struct pipe_context *pcontext,
const struct pipe_vertex_element *elements)
{
struct tegra_context *context = to_tegra_context(pcontext);
- void *so;
-
- debug_printf("> %s(pcontext=%p, num_elements=%u, elements=%p)\n",
- __func__, pcontext, num_elements, elements);
-
- so = context->gpu->create_vertex_elements_state(context->gpu, num_elements,
- elements);
- debug_printf("< %s() = %p\n", __func__, so);
- return so;
+ return context->gpu->create_vertex_elements_state(context->gpu,
+ num_elements,
+ elements);
}
static void
@@ -610,11 +406,7 @@ tegra_bind_vertex_elements_state(struct pipe_context *pcontext, void *so)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, so=%p)\n", __func__, pcontext, so);
-
context->gpu->bind_vertex_elements_state(context->gpu, so);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -622,11 +414,7 @@ tegra_delete_vertex_elements_state(struct pipe_context *pcontext, void *so)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, so=%p)\n", __func__, pcontext, so);
-
context->gpu->delete_vertex_elements_state(context->gpu, so);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -635,11 +423,7 @@ tegra_set_blend_color(struct pipe_context *pcontext,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, color=%p)\n", __func__, pcontext, color);
-
context->gpu->set_blend_color(context->gpu, color);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -648,11 +432,7 @@ tegra_set_stencil_ref(struct pipe_context *pcontext,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, ref=%p)\n", __func__, pcontext, ref);
-
context->gpu->set_stencil_ref(context->gpu, ref);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -660,11 +440,7 @@ tegra_set_sample_mask(struct pipe_context *pcontext, unsigned int mask)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, mask=%x)\n", __func__, pcontext, mask);
-
context->gpu->set_sample_mask(context->gpu, mask);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -672,12 +448,7 @@ tegra_set_min_samples(struct pipe_context *pcontext, unsigned int samples)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, samples=%x)\n", __func__, pcontext,
- samples);
-
context->gpu->set_min_samples(context->gpu, samples);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -686,11 +457,7 @@ tegra_set_clip_state(struct pipe_context *pcontext,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, state=%p)\n", __func__, pcontext, state);
-
context->gpu->set_clip_state(context->gpu, state);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -701,20 +468,13 @@ tegra_set_constant_buffer(struct pipe_context *pcontext, unsigned int shader,
struct tegra_context *context = to_tegra_context(pcontext);
struct pipe_constant_buffer buffer;
- debug_printf("> %s(pcontext=%p, shader=%u, index=%u, buf=%p)\n", __func__,
- pcontext, shader, index, buf);
-
if (buf && buf->buffer) {
memcpy(&buffer, buf, sizeof(buffer));
- debug_printf(" buffer: %p -> %p\n", buffer.buffer,
- tegra_resource_unwrap(buffer.buffer));
buffer.buffer = tegra_resource_unwrap(buffer.buffer);
buf = &buffer;
}
context->gpu->set_constant_buffer(context->gpu, shader, index, buf);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -725,28 +485,21 @@ tegra_set_framebuffer_state(struct pipe_context *pcontext,
struct pipe_framebuffer_state state;
unsigned i;
- debug_printf("> %s(pcontext=%p, fb=%p)\n", __func__, pcontext, fb);
-
if (fb) {
memcpy(&state, fb, sizeof(state));
- for (i = 0; i < fb->nr_cbufs; i++) {
+ for (i = 0; i < fb->nr_cbufs; i++)
state.cbufs[i] = tegra_surface_unwrap(fb->cbufs[i]);
- debug_printf(" %u: %p -> %p\n", i, fb->cbufs[i], state.cbufs[i]);
- }
while (i < PIPE_MAX_COLOR_BUFS)
state.cbufs[i++] = NULL;
state.zsbuf = tegra_surface_unwrap(fb->zsbuf);
- debug_printf(" zsbuf: %p -> %p\n", fb->zsbuf, state.zsbuf);
fb = &state;
}
context->gpu->set_framebuffer_state(context->gpu, fb);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -755,12 +508,7 @@ tegra_set_polygon_stipple(struct pipe_context *pcontext,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, stipple=%p)\n", __func__, pcontext,
- stipple);
-
context->gpu->set_polygon_stipple(context->gpu, stipple);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -770,13 +518,8 @@ tegra_set_scissor_states(struct pipe_context *pcontext, unsigned start_slot,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, start_slot=%u, num_scissors=%u, scissors=%p)\n",
- __func__, pcontext, start_slot, num_scissors, scissors);
-
context->gpu->set_scissor_states(context->gpu, start_slot, num_scissors,
scissors);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -786,13 +529,8 @@ tegra_set_window_rectangles(struct pipe_context *pcontext, boolean include,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, include=%d, num_rectangles=%u, rectangles=%p)\n",
- __func__, pcontext, include, num_rectangles, rectangles);
-
context->gpu->set_window_rectangles(context->gpu, include, num_rectangles,
rectangles);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -802,13 +540,8 @@ tegra_set_viewport_states(struct pipe_context *pcontext, unsigned start_slot,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, start_slot=%u, num_viewports=%u, viewports=%p)\n",
- __func__, pcontext, start_slot, num_viewports, viewports);
-
context->gpu->set_viewport_states(context->gpu, start_slot, num_viewports,
viewports);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -820,16 +553,11 @@ tegra_set_sampler_views(struct pipe_context *pcontext, unsigned shader,
struct tegra_context *context = to_tegra_context(pcontext);
unsigned i;
- debug_printf("> %s(pcontext=%p, shader=%u, start_slot=%u, num_views=%u, pviews=%p)\n",
- __func__, pcontext, shader, start_slot, num_views, pviews);
-
for (i = 0; i < num_views; i++)
views[i] = tegra_sampler_view_unwrap(pviews[i]);
context->gpu->set_sampler_views(context->gpu, shader, start_slot,
num_views, views);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -839,13 +567,8 @@ tegra_set_tess_state(struct pipe_context *pcontext,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, default_outer_level=%p, default_inner_level=%p)\n",
- __func__, pcontext, default_outer_level, default_inner_level);
-
context->gpu->set_tess_state(context->gpu, default_outer_level,
default_inner_level);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -854,12 +577,7 @@ tegra_set_debug_callback(struct pipe_context *pcontext,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, callback=%p)\n", __func__, pcontext,
- callback);
-
context->gpu->set_debug_callback(context->gpu, callback);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -869,13 +587,8 @@ tegra_set_shader_buffers(struct pipe_context *pcontext, unsigned int shader,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, shader=%u, start=%u, count=%u, buffers=%p)\n",
- __func__, pcontext, shader, start, count, buffers);
-
context->gpu->set_shader_buffers(context->gpu, shader, start, count,
buffers);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -885,13 +598,8 @@ tegra_set_shader_images(struct pipe_context *pcontext, unsigned int shader,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, shader=%u, start=%u, count=%u, images=%p)\n",
- __func__, pcontext, shader, start, count, images);
-
context->gpu->set_shader_images(context->gpu, shader, start, count,
images);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -903,24 +611,10 @@ tegra_set_vertex_buffers(struct pipe_context *pcontext, unsigned start_slot,
struct pipe_vertex_buffer buf[PIPE_MAX_SHADER_INPUTS];
unsigned i;
- debug_printf("> %s(pcontext=%p, start_slot=%u, num_buffers=%u, buffers=%p)\n",
- __func__, pcontext, start_slot, num_buffers, buffers);
-
if (num_buffers && buffers) {
- for (i = 0; i < num_buffers; i++) {
- debug_printf(" %u:\n", i);
- debug_printf(" stride: %u\n", buffers[i].stride);
- debug_printf(" is_user_buffer: %d\n", buffers[i].is_user_buffer);
- debug_printf(" offset: %u\n", buffers[i].buffer_offset);
- debug_printf(" buffer: %p\n", buffers[i].buffer.resource);
- debug_printf(" user: %p\n", buffers[i].buffer.user);
- }
-
memcpy(buf, buffers, num_buffers * sizeof(struct pipe_vertex_buffer));
for (i = 0; i < num_buffers; i++) {
- debug_printf(" %u: %p -> %p\n", i, buf[i].buffer.resource,
- tegra_resource_unwrap(buf[i].buffer.resource));
if (!buf[i].is_user_buffer)
buf[i].buffer.resource = tegra_resource_unwrap(buf[i].buffer.resource);
}
@@ -930,8 +624,6 @@ tegra_set_vertex_buffers(struct pipe_context *pcontext, unsigned start_slot,
context->gpu->set_vertex_buffers(context->gpu, start_slot, num_buffers,
buffers);
-
- debug_printf("< %s()\n", __func__);
}
static struct pipe_stream_output_target *
@@ -942,18 +634,11 @@ tegra_create_stream_output_target(struct pipe_context *pcontext,
{
struct tegra_resource *resource = to_tegra_resource(presource);
struct tegra_context *context = to_tegra_context(pcontext);
- struct pipe_stream_output_target *target;
-
- debug_printf("> %s(pcontext=%p, presource=%p, buffer_offset=%u, buffer_size=%u)\n",
- __func__, pcontext, presource, buffer_offset, buffer_size);
-
- target = context->gpu->create_stream_output_target(context->gpu,
- resource->gpu,
- buffer_offset,
- buffer_size);
- debug_printf("< %s() = %p\n", __func__, target);
- return target;
+ return context->gpu->create_stream_output_target(context->gpu,
+ resource->gpu,
+ buffer_offset,
+ buffer_size);
}
static void
@@ -962,12 +647,7 @@ tegra_stream_output_target_destroy(struct pipe_context *pcontext,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, target=%p)\n", __func__, pcontext,
- target);
-
context->gpu->stream_output_target_destroy(context->gpu, target);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -978,13 +658,8 @@ tegra_set_stream_output_targets(struct pipe_context *pcontext,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, num_targets=%u, targets=%p, offsets=%p)\n",
- __func__, pcontext, num_targets, targets, offsets);
-
context->gpu->set_stream_output_targets(context->gpu, num_targets,
targets, offsets);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -1002,15 +677,9 @@ tegra_resource_copy_region(struct pipe_context *pcontext,
struct tegra_resource *dst = to_tegra_resource(pdst);
struct tegra_resource *src = to_tegra_resource(psrc);
- debug_printf("> %s(pcontext=%p, pdst=%p, dst_level=%u, dstx=%x, dsty=%x, dstz=%u, src=%p, src_level=%u, src_box=%p)\n",
- __func__, pcontext, pdst, dst_level, dstx, dsty, dstz, src,
- src_level, src_box);
-
context->gpu->resource_copy_region(context->gpu, dst->gpu, dst_level, dstx,
dsty, dstz, src->gpu, src_level,
src_box);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -1019,8 +688,6 @@ tegra_blit(struct pipe_context *pcontext, const struct pipe_blit_info *pinfo)
struct tegra_context *context = to_tegra_context(pcontext);
struct pipe_blit_info info;
- debug_printf("> %s(pcontext=%p, pinfo=%p)\n", __func__, pcontext, pinfo);
-
if (pinfo) {
memcpy(&info, pinfo, sizeof(info));
info.dst.resource = tegra_resource_unwrap(info.dst.resource);
@@ -1029,8 +696,6 @@ tegra_blit(struct pipe_context *pcontext, const struct pipe_blit_info *pinfo)
}
context->gpu->blit(context->gpu, pinfo);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -1040,12 +705,7 @@ tegra_clear(struct pipe_context *pcontext, unsigned buffers,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, buffers=%x, color=%p, depth=%f, stencil=%u)\n",
- __func__, pcontext, buffers, color, depth, stencil);
-
context->gpu->clear(context->gpu, buffers, color, depth, stencil);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -1061,13 +721,8 @@ tegra_clear_render_target(struct pipe_context *pcontext,
struct tegra_context *context = to_tegra_context(pcontext);
struct tegra_surface *dst = to_tegra_surface(pdst);
- debug_printf("> %s(pcontext=%p, dst=%p, color=%p, dstx=%u, dsty=%u, width=%u, height=%u)\n",
- __func__, pcontext, dst, color, dstx, dsty, width, height);
-
context->gpu->clear_render_target(context->gpu, dst->gpu, color, dstx,
dsty, width, height, render_condition);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -1085,15 +740,9 @@ tegra_clear_depth_stencil(struct pipe_context *pcontext,
struct tegra_context *context = to_tegra_context(pcontext);
struct tegra_surface *dst = to_tegra_surface(pdst);
- debug_printf("> %s(pcontext=%p, dst=%p, flags=%x, depth=%f, stencil=%u, dstx=%u, dsty=%u, width=%u, height=%u)\n",
- __func__, pcontext, dst, flags, depth, stencil, dstx, dsty,
- width, height);
-
context->gpu->clear_depth_stencil(context->gpu, dst->gpu, flags, depth,
stencil, dstx, dsty, width, height,
render_condition);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -1106,12 +755,7 @@ tegra_clear_texture(struct pipe_context *pcontext,
struct tegra_resource *resource = to_tegra_resource(presource);
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, presource=%p, level=%u, box=%p, data=%p)\n",
- __func__, pcontext, presource, level, box, data);
-
context->gpu->clear_texture(context->gpu, resource->gpu, level, box, data);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -1125,14 +769,8 @@ tegra_clear_buffer(struct pipe_context *pcontext,
struct tegra_resource *resource = to_tegra_resource(presource);
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, presource=%p, offset=%u, size=%u, value=%p, value_size=%d)\n",
- __func__, pcontext, presource, offset, size, value,
- value_size);
-
context->gpu->clear_buffer(context->gpu, resource->gpu, offset, size,
value, value_size);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -1141,12 +779,7 @@ tegra_flush(struct pipe_context *pcontext, struct pipe_fence_handle **fence,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, fence=%p, flags=%x)\n", __func__, pcontext,
- fence, flags);
-
context->gpu->flush(context->gpu, fence, flags);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -1156,13 +789,8 @@ tegra_create_fence_fd(struct pipe_context *pcontext,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, fence=%p, fd=%d, type=%d)\n", __func__,
- pcontext, fence, fd, type);
-
assert(type == PIPE_FD_TYPE_NATIVE_SYNC);
context->gpu->create_fence_fd(context->gpu, fence, fd, type);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -1171,11 +799,7 @@ tegra_fence_server_sync(struct pipe_context *pcontext,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, fence=%p)\n", __func__, pcontext, fence);
-
context->gpu->fence_server_sync(context->gpu, fence);
-
- debug_printf("< %s()\n", __func__);
}
static struct pipe_sampler_view *
@@ -1187,9 +811,6 @@ tegra_create_sampler_view(struct pipe_context *pcontext,
struct tegra_context *context = to_tegra_context(pcontext);
struct tegra_sampler_view *view;
- debug_printf("> %s(pcontext=%p, presource=%p, template=%p)\n", __func__,
- pcontext, presource, template);
-
view = calloc(1, sizeof(*view));
if (!view)
return NULL;
@@ -1204,7 +825,6 @@ tegra_create_sampler_view(struct pipe_context *pcontext,
pipe_resource_reference(&view->base.texture, presource);
view->base.context = pcontext;
- debug_printf("< %s() = %p\n", __func__, &view->base);
return &view->base;
}
@@ -1214,13 +834,9 @@ tegra_sampler_view_destroy(struct pipe_context *pcontext,
{
struct tegra_sampler_view *view = to_tegra_sampler_view(pview);
- debug_printf("> %s(pcontext=%p, view=%p)\n", __func__, pcontext, view);
-
pipe_resource_reference(&view->base.texture, NULL);
pipe_sampler_view_reference(&view->gpu, NULL);
free(view);
-
- debug_printf("< %s()\n", __func__);
}
static struct pipe_surface *
@@ -1232,9 +848,6 @@ tegra_create_surface(struct pipe_context *pcontext,
struct tegra_context *context = to_tegra_context(pcontext);
struct tegra_surface *surface;
- debug_printf("> %s(pcontext=%p, presource=%p, template=%p)\n", __func__,
- pcontext, presource, template);
-
surface = calloc(1, sizeof(*surface));
if (!surface)
return NULL;
@@ -1254,8 +867,6 @@ tegra_create_surface(struct pipe_context *pcontext,
pipe_resource_reference(&surface->base.texture, presource);
surface->base.context = &context->base;
- debug_printf(" gpu: %p\n", surface->gpu);
- debug_printf("< %s() = %p\n", __func__, &surface->base);
return &surface->base;
}
@@ -1265,14 +876,9 @@ tegra_surface_destroy(struct pipe_context *pcontext,
{
struct tegra_surface *surface = to_tegra_surface(psurface);
- debug_printf("> %s(pcontext=%p, psurface=%p)\n", __func__, pcontext,
- psurface);
-
pipe_resource_reference(&surface->base.texture, NULL);
pipe_surface_reference(&surface->gpu, NULL);
free(surface);
-
- debug_printf("< %s()\n", __func__);
}
static void *
@@ -1286,9 +892,6 @@ tegra_transfer_map(struct pipe_context *pcontext,
struct tegra_context *context = to_tegra_context(pcontext);
struct tegra_transfer *transfer;
- debug_printf("> %s(pcontext=%p, presource=%p, level=%u, usage=%x, box=%p, ptransfer=%p)\n",
- __func__, pcontext, presource, level, usage, box, ptransfer);
-
transfer = calloc(1, sizeof(*transfer));
if (!transfer)
return NULL;
@@ -1297,14 +900,11 @@ tegra_transfer_map(struct pipe_context *pcontext,
level, usage, box,
&transfer->gpu);
memcpy(&transfer->base, transfer->gpu, sizeof(*transfer->gpu));
- if (transfer->base.resource != NULL)
- debug_printf(" resource: %p\n", transfer->base.resource);
transfer->base.resource = NULL;
pipe_resource_reference(&transfer->base.resource, presource);
*ptransfer = &transfer->base;
- debug_printf("< %s() = %p\n", __func__, transfer->map);
return transfer->map;
}
@@ -1316,12 +916,7 @@ tegra_transfer_flush_region(struct pipe_context *pcontext,
struct tegra_transfer *transfer = to_tegra_transfer(ptransfer);
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, transfer=%p, box=%p)\n", __func__,
- pcontext, transfer, box);
-
context->gpu->transfer_flush_region(context->gpu, transfer->gpu, box);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -1331,14 +926,9 @@ tegra_transfer_unmap(struct pipe_context *pcontext,
struct tegra_transfer *transfer = to_tegra_transfer(ptransfer);
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, ptransfer=%p)\n", __func__, pcontext,
- ptransfer);
-
context->gpu->transfer_unmap(context->gpu, transfer->gpu);
pipe_resource_reference(&transfer->base.resource, NULL);
free(transfer);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -1367,14 +957,8 @@ tegra_texture_subdata(struct pipe_context *pcontext,
struct tegra_resource *resource = to_tegra_resource(presource);
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, presource=%p, level=%u, usage=%x, box=%p, data=%p, stride=%u, layer_stride=%u)\n",
- __func__, pcontext, presource, level, usage, box, data,
- stride, layer_stride);
-
context->gpu->texture_subdata(context->gpu, resource->gpu, level, usage,
box, data, stride, layer_stride);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -1382,11 +966,7 @@ tegra_texture_barrier(struct pipe_context *pcontext, unsigned int flags)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, flags=%x)\n", __func__, pcontext, flags);
-
context->gpu->texture_barrier(context->gpu, flags);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -1394,11 +974,7 @@ tegra_memory_barrier(struct pipe_context *pcontext, unsigned int flags)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, flags=%x)\n", __func__, pcontext, flags);
-
context->gpu->memory_barrier(context->gpu, flags);
-
- debug_printf("< %s()\n", __func__);
}
static struct pipe_video_codec *
@@ -1406,15 +982,8 @@ tegra_create_video_codec(struct pipe_context *pcontext,
const struct pipe_video_codec *template)
{
struct tegra_context *context = to_tegra_context(pcontext);
- struct pipe_video_codec *codec;
-
- debug_printf("> %s(pcontext=%p, template=%p)\n", __func__, pcontext,
- template);
- codec = context->gpu->create_video_codec(context->gpu, template);
-
- debug_printf("< %s() = %p\n", __func__, codec);
- return codec;
+ return context->gpu->create_video_codec(context->gpu, template);
}
static struct pipe_video_buffer *
@@ -1422,15 +991,8 @@ tegra_create_video_buffer(struct pipe_context *pcontext,
const struct pipe_video_buffer *template)
{
struct tegra_context *context = to_tegra_context(pcontext);
- struct pipe_video_buffer *buffer;
-
- debug_printf("> %s(pcontext=%p, template=%p)\n", __func__, pcontext,
- template);
- buffer = context->gpu->create_video_buffer(context->gpu, template);
-
- debug_printf("< %s() = %p\n", __func__, buffer);
- return buffer;
+ return context->gpu->create_video_buffer(context->gpu, template);
}
static void *
@@ -1438,15 +1000,8 @@ tegra_create_compute_state(struct pipe_context *pcontext,
const struct pipe_compute_state *template)
{
struct tegra_context *context = to_tegra_context(pcontext);
- void *so;
-
- debug_printf("> %s(pcontext=%p, template=%p)\n", __func__, pcontext,
- template);
- so = context->gpu->create_compute_state(context->gpu, template);
-
- debug_printf("< %s() = %p\n", __func__, so);
- return so;
+ return context->gpu->create_compute_state(context->gpu, template);
}
static void
@@ -1454,11 +1009,7 @@ tegra_bind_compute_state(struct pipe_context *pcontext, void *so)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, so=%p)\n", __func__, pcontext, so);
-
context->gpu->bind_compute_state(context->gpu, so);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -1466,11 +1017,7 @@ tegra_delete_compute_state(struct pipe_context *pcontext, void *so)
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, so=%p)\n", __func__, pcontext, so);
-
context->gpu->delete_compute_state(context->gpu, so);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -1480,14 +1027,9 @@ tegra_set_compute_resources(struct pipe_context *pcontext,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, start=%u, count=%u, resources=%p)\n",
- __func__, pcontext, start, count, resources);
-
/* XXX unwrap resources */
context->gpu->set_compute_resources(context->gpu, start, count, resources);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -1497,15 +1039,10 @@ tegra_set_global_binding(struct pipe_context *pcontext, unsigned int first,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, first=%u, count=%u, resources=%p, handles=%p)\n",
- __func__, pcontext, first, count, resources, handles);
-
/* XXX unwrap resources */
context->gpu->set_global_binding(context->gpu, first, count, resources,
handles);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -1514,13 +1051,9 @@ tegra_launch_grid(struct pipe_context *pcontext,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, info=%p)\n", __func__, pcontext, info);
-
/* XXX unwrap info->indirect? */
context->gpu->launch_grid(context->gpu, info);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -1529,26 +1062,15 @@ tegra_get_sample_position(struct pipe_context *pcontext, unsigned int count,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, count=%u, index=%u, value=%p)\n",
- __func__, pcontext, count, index, value);
-
context->gpu->get_sample_position(context->gpu, count, index, value);
-
- debug_printf("< %s()\n", __func__);
}
static uint64_t
tegra_get_timestamp(struct pipe_context *pcontext)
{
struct tegra_context *context = to_tegra_context(pcontext);
- uint64_t timestamp;
- debug_printf("> %s(pcontext=%p)\n", __func__, pcontext);
-
- timestamp = context->gpu->get_timestamp(context->gpu);
-
- debug_printf("< %s() = %" PRIu64 "\n", __func__, timestamp);
- return timestamp;
+ return context->gpu->get_timestamp(context->gpu);
}
static void
@@ -1558,12 +1080,7 @@ tegra_flush_resource(struct pipe_context *pcontext,
struct tegra_resource *resource = to_tegra_resource(presource);
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, resource=%p)\n", __func__, pcontext,
- resource);
-
context->gpu->flush_resource(context->gpu, resource->gpu);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -1573,26 +1090,15 @@ tegra_invalidate_resource(struct pipe_context *pcontext,
struct tegra_resource *resource = to_tegra_resource(presource);
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, resource=%p)\n", __func__, pcontext,
- resource);
-
context->gpu->invalidate_resource(context->gpu, resource->gpu);
-
- debug_printf("< %s()\n", __func__);
}
static enum pipe_reset_status
tegra_get_device_reset_status(struct pipe_context *pcontext)
{
struct tegra_context *context = to_tegra_context(pcontext);
- enum pipe_reset_status status;
-
- debug_printf("> %s(pcontext=%p)\n", __func__, pcontext);
- status = context->gpu->get_device_reset_status(context->gpu);
-
- debug_printf("< %s() = %d\n", __func__, status);
- return status;
+ return context->gpu->get_device_reset_status(context->gpu);
}
static void
@@ -1601,11 +1107,7 @@ tegra_set_device_reset_callback(struct pipe_context *pcontext,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, cb=%p)\n", __func__, pcontext, cb);
-
context->gpu->set_device_reset_callback(context->gpu, cb);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -1614,12 +1116,7 @@ tegra_dump_debug_state(struct pipe_context *pcontext, FILE *stream,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, stream=%p, flags=%x)\n", __func__,
- pcontext, stream, flags);
-
context->gpu->dump_debug_state(context->gpu, stream, flags);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -1628,12 +1125,7 @@ tegra_emit_string_marker(struct pipe_context *pcontext, const char *string,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, string=%p, length=%d)\n", __func__,
- pcontext, string, length);
-
context->gpu->emit_string_marker(context->gpu, string, length);
-
- debug_printf("< %s()\n", __func__);
}
static boolean
@@ -1647,18 +1139,10 @@ tegra_generate_mipmap(struct pipe_context *pcontext,
{
struct tegra_resource *resource = to_tegra_resource(presource);
struct tegra_context *context = to_tegra_context(pcontext);
- boolean ret;
-
- debug_printf("> %s(pcontext=%p, resource=%p, format=%d, base_level=%u, last_level=%u, first_layer=%u, last_layer=%u)\n",
- __func__, pcontext, resource, format, base_level, last_level,
- first_layer, last_layer);
-
- ret = context->gpu->generate_mipmap(context->gpu, resource->gpu, format,
- base_level, last_level, first_layer,
- last_layer);
- debug_printf("< %s() = %d\n", __func__, ret);
- return ret;
+ return context->gpu->generate_mipmap(context->gpu, resource->gpu, format,
+ base_level, last_level, first_layer,
+ last_layer);
}
static uint64_t
@@ -1667,15 +1151,8 @@ tegra_create_texture_handle(struct pipe_context *pcontext,
const struct pipe_sampler_state *state)
{
struct tegra_context *context = to_tegra_context(pcontext);
- uint64_t handle;
- debug_printf("> %s(pcontext=%p, view=%p, state=%p)\n", __func__, pcontext,
- view, state);
-
- handle = context->gpu->create_texture_handle(context->gpu, view, state);
-
- debug_printf("< %s() = %" PRIu64 "\n", __func__, handle);
- return handle;
+ return context->gpu->create_texture_handle(context->gpu, view, state);
}
static void tegra_delete_texture_handle(struct pipe_context *pcontext,
@@ -1683,12 +1160,7 @@ static void tegra_delete_texture_handle(struct pipe_context *pcontext,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, handle=%" PRIu64 ")\n", __func__, pcontext,
- handle);
-
context->gpu->delete_texture_handle(context->gpu, handle);
-
- debug_printf("< %s()\n", __func__);
}
static void tegra_make_texture_handle_resident(struct pipe_context *pcontext,
@@ -1696,26 +1168,15 @@ static void tegra_make_texture_handle_resident(struct pipe_context *pcontext,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, handle=%" PRIu64 ")\n", __func__, pcontext,
- handle);
-
context->gpu->make_texture_handle_resident(context->gpu, handle, resident);
-
- debug_printf("< %s()\n", __func__);
}
static uint64_t tegra_create_image_handle(struct pipe_context *pcontext,
const struct pipe_image_view *image)
{
struct tegra_context *context = to_tegra_context(pcontext);
- uint64_t handle;
-
- debug_printf("> %s(pcontext=%p, image=%p)\n", __func__, pcontext, image);
- handle = context->gpu->create_image_handle(context->gpu, image);
-
- debug_printf("< %s() = %" PRIu64 "\n", __func__, handle);
- return handle;
+ return context->gpu->create_image_handle(context->gpu, image);
}
static void tegra_delete_image_handle(struct pipe_context *pcontext,
@@ -1723,12 +1184,7 @@ static void tegra_delete_image_handle(struct pipe_context *pcontext,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, handle=%" PRIu64 ")\n", __func__, pcontext,
- handle);
-
context->gpu->delete_image_handle(context->gpu, handle);
-
- debug_printf("< %s()\n", __func__);
}
static void tegra_make_image_handle_resident(struct pipe_context *pcontext,
@@ -1737,13 +1193,8 @@ static void tegra_make_image_handle_resident(struct pipe_context *pcontext,
{
struct tegra_context *context = to_tegra_context(pcontext);
- debug_printf("> %s(pcontext=%p, handle=%" PRIu64 ", access=%x, resident=%s)\n",
- __func__, pcontext, handle, access, resident ? "yes" : "no");
-
context->gpu->make_image_handle_resident(context->gpu, handle, access,
resident);
-
- debug_printf("< %s()\n", __func__);
}
struct pipe_context *
@@ -1753,9 +1204,6 @@ tegra_screen_context_create(struct pipe_screen *pscreen, void *priv,
struct tegra_screen *screen = to_tegra_screen(pscreen);
struct tegra_context *context;
- debug_printf("> %s(pscreen=%p, priv=%p, flags=%x)\n", __func__, pscreen,
- priv, flags);
-
context = calloc(1, sizeof(*context));
if (!context)
return NULL;
@@ -1926,13 +1374,11 @@ tegra_screen_context_create(struct pipe_screen *pscreen, void *priv,
context->base.delete_image_handle = tegra_delete_image_handle;
context->base.make_image_handle_resident = tegra_make_image_handle_resident;
- debug_printf("< %s() = %p\n", __func__, &context->base);
return &context->base;
destroy:
context->gpu->destroy(context->gpu);
free:
free(context);
- debug_printf("< %s() = NULL\n", __func__);
return NULL;
}
diff --git a/src/gallium/drivers/tegra/tegra_screen.c b/src/gallium/drivers/tegra/tegra_screen.c
index 11e2f808620..e03e71f81a2 100644
--- a/src/gallium/drivers/tegra/tegra_screen.c
+++ b/src/gallium/drivers/tegra/tegra_screen.c
@@ -34,9 +34,7 @@
#include "pipe/p_state.h"
#include "util/u_debug.h"
-#include "util/u_format.h"
#include "util/u_inlines.h"
-#include "util/u_modifier.h"
#include "state_tracker/drm_driver.h"
@@ -50,12 +48,8 @@ static void tegra_screen_destroy(struct pipe_screen *pscreen)
{
struct tegra_screen *screen = to_tegra_screen(pscreen);
- debug_printf("> %s(pscreen=%p)\n", __func__, pscreen);
-
screen->gpu->destroy(screen->gpu);
free(pscreen);
-
- debug_printf("< %s()\n", __func__);
}
static const char *
@@ -80,28 +74,16 @@ static int
tegra_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
{
struct tegra_screen *screen = to_tegra_screen(pscreen);
- int ret;
-
- debug_printf("> %s(pscreen=%p, param=%d)\n", __func__, pscreen, param);
- ret = screen->gpu->get_param(screen->gpu, param);
-
- debug_printf("< %s() = %d\n", __func__, ret);
- return ret;
+ return screen->gpu->get_param(screen->gpu, param);
}
static float
tegra_screen_get_paramf(struct pipe_screen *pscreen, enum pipe_capf param)
{
struct tegra_screen *screen = to_tegra_screen(pscreen);
- float ret;
- debug_printf("> %s(pscreen=%p, param=%d)\n", __func__, pscreen, param);
-
- ret = screen->gpu->get_paramf(screen->gpu, param);
-
- debug_printf("< %s() = %f\n", __func__, ret);
- return ret;
+ return screen->gpu->get_paramf(screen->gpu, param);
}
static int
@@ -109,14 +91,8 @@ tegra_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader,
enum pipe_shader_cap param)
{
struct tegra_screen *screen = to_tegra_screen(pscreen);
- int ret;
-
- debug_printf("> %s(pscreen=%p, param=%d)\n", __func__, pscreen, param);
-
- ret = screen->gpu->get_shader_param(screen->gpu, shader, param);
- debug_printf("< %s() = %d\n", __func__, ret);
- return ret;
+ return screen->gpu->get_shader_param(screen->gpu, shader, param);
}
static int
@@ -126,16 +102,9 @@ tegra_screen_get_video_param(struct pipe_screen *pscreen,
enum pipe_video_cap param)
{
struct tegra_screen *screen = to_tegra_screen(pscreen);
- int ret;
-
- debug_printf("> %s(pscreen=%p, profile=%d, entrypoint=%d, param=%d)\n",
- __func__, pscreen, profile, entrypoint, param);
-
- ret = screen->gpu->get_video_param(screen->gpu, profile, entrypoint,
- param);
- debug_printf("< %s() = %d\n", __func__, ret);
- return ret;
+ return screen->gpu->get_video_param(screen->gpu, profile, entrypoint,
+ param);
}
static int
@@ -145,29 +114,17 @@ tegra_screen_get_compute_param(struct pipe_screen *pscreen,
void *retp)
{
struct tegra_screen *screen = to_tegra_screen(pscreen);
- int ret;
-
- debug_printf("> %s(pscreen=%p, ir_type=%d, param=%d, retp=%p)\n",
- __func__, pscreen, ir_type, param, retp);
- ret = screen->gpu->get_compute_param(screen->gpu, ir_type, param, retp);
-
- debug_printf("< %s() = %d\n", __func__, ret);
- return ret;
+ return screen->gpu->get_compute_param(screen->gpu, ir_type, param,
+ retp);
}
static uint64_t
tegra_screen_get_timestamp(struct pipe_screen *pscreen)
{
struct tegra_screen *screen = to_tegra_screen(pscreen);
- uint64_t ret;
-
- debug_printf("> %s(pscreen=%p)\n", __func__, pscreen);
-
- ret = screen->gpu->get_timestamp(screen->gpu);
- debug_printf("< %s() = %" PRIu64 "\n", __func__, ret);
- return ret;
+ return screen->gpu->get_timestamp(screen->gpu);
}
static boolean
@@ -178,16 +135,9 @@ tegra_screen_is_format_supported(struct pipe_screen *pscreen,
unsigned usage)
{
struct tegra_screen *screen = to_tegra_screen(pscreen);
- boolean ret;
-
- debug_printf("> %s(pscreen=%p, format=%d, target=%d, sample_count=%u, usage=%x)\n",
- __func__, pscreen, format, target, sample_count, usage);
-
- ret = screen->gpu->is_format_supported(screen->gpu, format, target,
- sample_count, usage);
- debug_printf("< %s() = %d\n", __func__, ret);
- return ret;
+ return screen->gpu->is_format_supported(screen->gpu, format, target,
+ sample_count, usage);
}
static boolean
@@ -197,16 +147,9 @@ tegra_screen_is_video_format_supported(struct pipe_screen *pscreen,
enum pipe_video_entrypoint entrypoint)
{
struct tegra_screen *screen = to_tegra_screen(pscreen);
- boolean ret;
-
- debug_printf("> %s(pscreen=%p, format=%d, profile=%d, entrypoint=%d)\n",
- __func__, pscreen, format, profile, entrypoint);
- ret = screen->gpu->is_video_format_supported(screen->gpu, format, profile,
- entrypoint);
-
- debug_printf("< %s() = %d\n", __func__, ret);
- return ret;
+ return screen->gpu->is_video_format_supported(screen->gpu, format, profile,
+ entrypoint);
}
static boolean
@@ -214,24 +157,15 @@ tegra_screen_can_create_resource(struct pipe_screen *pscreen,
const struct pipe_resource *template)
{
struct tegra_screen *screen = to_tegra_screen(pscreen);
- boolean ret;
-
- debug_printf("> %s(pscreen=%p, template=%p)\n", __func__, pscreen,
- template);
- ret = screen->gpu->can_create_resource(screen->gpu, template);
-
- debug_printf("< %s() = %d\n", __func__, ret);
- return ret;
+ return screen->gpu->can_create_resource(screen->gpu, template);
}
static int tegra_open_render_node(void)
{
drmDevicePtr *devices, device;
int err, render = -ENOENT, fd;
- unsigned int num, i, j;
-
- debug_printf("> %s()\n", __func__);
+ unsigned int num, i;
err = drmGetDevices2(0, NULL, 0);
if (err < 0)
@@ -252,15 +186,6 @@ static int tegra_open_render_node(void)
for (i = 0; i < num; i++) {
device = devices[i];
- debug_printf("device: %p\n", device);
- debug_printf(" available nodes: %x\n", device->available_nodes);
- debug_printf(" bus: %d\n", device->bustype);
-
- for (j = 0; j < DRM_NODE_MAX; j++) {
- if (device->available_nodes & (1 << j))
- debug_printf(" node: %s\n", device->nodes[j]);
- }
-
if ((device->available_nodes & (1 << DRM_NODE_RENDER)) &&
(device->bustype == DRM_BUS_PLATFORM)) {
drmVersionPtr version;
@@ -280,9 +205,6 @@ static int tegra_open_render_node(void)
continue;
}
- debug_printf("match found: %s (%s)\n", device->nodes[DRM_NODE_RENDER],
- version->name);
-
drmFreeVersion(version);
render = fd;
break;
@@ -293,7 +215,6 @@ static int tegra_open_render_node(void)
free:
free(devices);
- debug_printf("< %s() = %d\n", __func__, render);
return render;
}
@@ -305,25 +226,20 @@ static int tegra_screen_import_resource(struct tegra_screen *screen,
boolean status;
int fd, err;
- debug_printf("> %s(screen=%p, resource=%p, has_modifiers=%s)\n", __func__, screen, resource, has_modifiers ? "yes" : "no");
-
memset(&handle, 0, sizeof(handle));
handle.modifier = DRM_FORMAT_MOD_INVALID;
handle.type = DRM_API_HANDLE_TYPE_FD;
status = screen->gpu->resource_get_handle(screen->gpu, NULL, resource->gpu,
&handle, usage);
- if (!status) {
- err = -EINVAL;
- goto out;
- }
+ if (!status)
+ return -EINVAL;
assert(handle.modifier != DRM_FORMAT_MOD_INVALID);
if (handle.modifier == DRM_FORMAT_MOD_INVALID) {
close(handle.handle);
- err = -EINVAL;
- goto out;
+ return -EINVAL;
}
resource->modifier = handle.modifier;
@@ -331,17 +247,11 @@ static int tegra_screen_import_resource(struct tegra_screen *screen,
fd = handle.handle;
err = drmPrimeFDToHandle(screen->fd, fd, &resource->handle);
- if (err < 0) {
- fprintf(stderr, "drmPrimeFDToHandle() failed: %s\n", strerror(errno));
+ if (err < 0)
err = -errno;
- close(fd);
- goto out;
- }
close(fd);
-out:
- debug_printf("< %s() = %d\n", __func__, err);
return err;
}
@@ -354,24 +264,6 @@ tegra_screen_resource_create(struct pipe_screen *pscreen,
struct tegra_resource *resource;
int err;
- debug_printf("> %s(pscreen=%p, template=%p)\n", __func__, pscreen,
- template);
- debug_printf(" template: %p\n", template);
- debug_printf(" target: %u\n", template->target);
- debug_printf(" format: %u\n", template->format);
- debug_printf(" width: %u\n", template->width0);
- debug_printf(" height: %u\n", template->height0);
- debug_printf(" depth: %u\n", template->depth0);
- debug_printf(" array_size: %u\n", template->array_size);
- debug_printf(" last_level: %u\n", template->last_level);
- debug_printf(" nr_samples: %u\n", template->nr_samples);
- debug_printf(" usage: %u\n", template->usage);
- debug_printf(" bind: %x\n", template->bind);
-#ifdef DEBUG
- debug_print_bind_flags(" flags", template->bind);
-#endif
- debug_printf(" flags: %x\n", template->flags);
-
resource = calloc(1, sizeof(*resource));
if (!resource)
return NULL;
@@ -403,20 +295,16 @@ tegra_screen_resource_create(struct pipe_screen *pscreen,
goto destroy;
}
- debug_printf(" gpu: %p\n", resource->gpu);
-
memcpy(&resource->base, resource->gpu, sizeof(*resource->gpu));
pipe_reference_init(&resource->base.reference, 1);
resource->base.screen = &screen->base;
- debug_printf("< %s() = %p\n", __func__, &resource->base);
return &resource->base;
destroy:
screen->gpu->resource_destroy(screen->gpu, resource->gpu);
free:
free(resource);
- debug_printf("< %s()\n", __func__);
return NULL;
}
@@ -429,15 +317,11 @@ tegra_screen_resource_create_front(struct pipe_screen *pscreen,
struct tegra_screen *screen = to_tegra_screen(pscreen);
struct pipe_resource *resource;
- debug_printf("> %s(pscreen=%p, template=%p, map_front_private=%p)\n",
- __func__, pscreen, template, map_front_private);
-
resource = screen->gpu->resource_create_front(screen->gpu, template,
map_front_private);
if (resource)
resource->screen = pscreen;
- debug_printf("< %s() = %p\n", __func__, resource);
return resource;
}
@@ -450,25 +334,6 @@ tegra_screen_resource_from_handle(struct pipe_screen *pscreen,
struct tegra_screen *screen = to_tegra_screen(pscreen);
struct tegra_resource *resource;
- debug_printf("> %s(pscreen=%p, template=%p, handle=%p, usage=%u)\n",
- __func__, pscreen, template, handle, usage);
- debug_printf(" template: %p\n", template);
- debug_printf(" target: %u\n", template->target);
- debug_printf(" format: %u\n", template->format);
- debug_print_format(" ", template->format);
- debug_printf(" width: %u\n", template->width0);
- debug_printf(" height: %u\n", template->height0);
- debug_printf(" depth: %u\n", template->depth0);
- debug_printf(" array_size: %u\n", template->array_size);
- debug_printf(" last_level: %u\n", template->last_level);
- debug_printf(" nr_samples: %u\n", template->nr_samples);
- debug_printf(" usage: %u\n", template->usage);
- debug_printf(" bind: %x\n", template->bind);
-#ifdef DEBUG
- debug_print_bind_flags(" flags", template->bind);
-#endif
- debug_printf(" flags: %x\n", template->flags);
-
resource = calloc(1, sizeof(*resource));
if (!resource)
return NULL;
@@ -484,7 +349,6 @@ tegra_screen_resource_from_handle(struct pipe_screen *pscreen,
pipe_reference_init(&resource->base.reference, 1);
resource->base.screen = &screen->base;
- debug_printf("< %s() = %p\n", __func__, &resource->base);
return &resource->base;
}
@@ -497,15 +361,11 @@ tegra_screen_resource_from_user_memory(struct pipe_screen *pscreen,
struct tegra_screen *screen = to_tegra_screen(pscreen);
struct pipe_resource *resource;
- debug_printf("> %s(pscreen=%p, template=%p, buffer=%p)\n", __func__,
- pscreen, template, buffer);
-
resource = screen->gpu->resource_from_user_memory(screen->gpu, template,
buffer);
if (resource)
resource->screen = pscreen;
- debug_printf("< %s() = %p\n", __func__, resource);
return resource;
}
@@ -521,25 +381,6 @@ tegra_screen_resource_get_handle(struct pipe_screen *pscreen,
struct tegra_screen *screen = to_tegra_screen(pscreen);
boolean ret = TRUE;
- debug_printf("> %s(pscreen=%p, presource=%p, handle=%p, usage=%u)\n",
- __func__, pscreen, presource, handle, usage);
- debug_printf(" resource: %p\n", presource);
- debug_printf(" target: %u\n", presource->target);
- debug_printf(" format: %u\n", presource->format);
- debug_print_format(" ", presource->format);
- debug_printf(" width: %u\n", presource->width0);
- debug_printf(" height: %u\n", presource->height0);
- debug_printf(" depth: %u\n", presource->depth0);
- debug_printf(" array_size: %u\n", presource->array_size);
- debug_printf(" last_level: %u\n", presource->last_level);
- debug_printf(" nr_samples: %u\n", presource->nr_samples);
- debug_printf(" usage: %u\n", presource->usage);
- debug_printf(" bind: %x\n", presource->bind);
-#ifdef DEBUG
- debug_print_bind_flags(" flags", presource->bind);
-#endif
- debug_printf(" flags: %x\n", presource->flags);
-
/*
* Assume that KMS handles for scanout resources will only ever be used
* to pass buffers into Tegra DRM for display. In all other cases, return
@@ -556,13 +397,6 @@ tegra_screen_resource_get_handle(struct pipe_screen *pscreen,
resource->gpu, handle, usage);
}
- debug_printf(" handle: %u\n", handle->handle);
- debug_printf(" type: %u\n", handle->type);
- debug_printf(" stride: %u\n", handle->stride);
- debug_printf(" offset: %u\n", handle->offset);
- debug_printf(" modifier: %" PRIx64 " (%s)\n", handle->modifier,
- util_modifier_name(handle->modifier));
- debug_printf("< %s() = %d\n", __func__, ret);
return ret;
}
@@ -572,13 +406,8 @@ tegra_screen_resource_destroy(struct pipe_screen *pscreen,
{
struct tegra_resource *resource = to_tegra_resource(presource);
- debug_printf("> %s(pscreen=%p, presource=%p)\n", __func__, pscreen,
- presource);
-
pipe_resource_reference(&resource->gpu, NULL);
free(resource);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -591,14 +420,8 @@ tegra_screen_flush_frontbuffer(struct pipe_screen *pscreen,
{
struct tegra_screen *screen = to_tegra_screen(pscreen);
- debug_printf("> %s(pscreen=%p, resource=%p, level=%u, layer=%u, winsys_drawable_handle=%p, box=%p)\n",
- __func__, pscreen, resource, level, layer,
- winsys_drawable_handle, box);
-
screen->gpu->flush_frontbuffer(screen->gpu, resource, level, layer,
winsys_drawable_handle, box);
-
- debug_printf("< %s()\n", __func__);
}
static void
@@ -608,12 +431,7 @@ tegra_screen_fence_reference(struct pipe_screen *pscreen,
{
struct tegra_screen *screen = to_tegra_screen(pscreen);
- debug_printf("> %s(pscreen=%p, ptr=%p, fence=%p)\n", __func__, pscreen,
- ptr, fence);
-
screen->gpu->fence_reference(screen->gpu, ptr, fence);
-
- debug_printf("< %s()\n", __func__);
}
static boolean
@@ -624,16 +442,10 @@ tegra_screen_fence_finish(struct pipe_screen *pscreen,
{
struct tegra_context *context = to_tegra_context(pcontext);
struct tegra_screen *screen = to_tegra_screen(pscreen);
- boolean ret;
-
- debug_printf("> %s(pscreen=%p, pcontext=%p, fence=%p, timeout=%" PRIu64 ")\n",
- __func__, pscreen, pcontext, fence, timeout);
-
- ret = screen->gpu->fence_finish(screen->gpu, context ? context->gpu : NULL,
- fence, timeout);
- debug_printf("< %s() = %d\n", __func__, ret);
- return ret;
+ return screen->gpu->fence_finish(screen->gpu,
+ context ? context->gpu : NULL,
+ fence, timeout);
}
static int
@@ -641,14 +453,8 @@ tegra_screen_fence_get_fd(struct pipe_screen *pscreen,
struct pipe_fence_handle *fence)
{
struct tegra_screen *screen = to_tegra_screen(pscreen);
- boolean ret;
-
- debug_printf("> %s(pscreen=%p, fence=%p)\n", __func__, pscreen, fence);
- ret = screen->gpu->fence_get_fd(screen->gpu, fence);
-
- debug_printf("< %s() = %d\n", __func__, ret);
- return ret;
+ return screen->gpu->fence_get_fd(screen->gpu, fence);
}
static int
@@ -657,15 +463,8 @@ tegra_screen_get_driver_query_info(struct pipe_screen *pscreen,
struct pipe_driver_query_info *info)
{
struct tegra_screen *screen = to_tegra_screen(pscreen);
- int ret;
- debug_printf("> %s(pscreen=%p, index=%u, info=%p)\n", __func__, pscreen,
- index, info);
-
- ret = screen->gpu->get_driver_query_info(screen->gpu, index, info);
-
- debug_printf("< %s() = %d\n", __func__, ret);
- return ret;
+ return screen->gpu->get_driver_query_info(screen->gpu, index, info);
}
static int
@@ -674,15 +473,8 @@ tegra_screen_get_driver_query_group_info(struct pipe_screen *pscreen,
struct pipe_driver_query_group_info *info)
{
struct tegra_screen *screen = to_tegra_screen(pscreen);
- int ret;
-
- debug_printf("> %s(pscreen=%p, index=%u, info=%p)\n", __func__, pscreen,
- index, info);
-
- ret = screen->gpu->get_driver_query_group_info(screen->gpu, index, info);
- debug_printf("< %s() = %d\n", __func__, ret);
- return ret;
+ return screen->gpu->get_driver_query_group_info(screen->gpu, index, info);
}
static void
@@ -691,11 +483,7 @@ tegra_screen_query_memory_info(struct pipe_screen *pscreen,
{
struct tegra_screen *screen = to_tegra_screen(pscreen);
- debug_printf("> %s(pscreen=%p, info=%p)\n", __func__, pscreen, info);
-
screen->gpu->query_memory_info(screen->gpu, info);
-
- debug_printf("< %s()\n", __func__);
}
static const void *
@@ -706,13 +494,9 @@ tegra_screen_get_compiler_options(struct pipe_screen *pscreen,
struct tegra_screen *screen = to_tegra_screen(pscreen);
const void *options = NULL;
- debug_printf("> %s(pscreen=%p, ir=%d, shader=%u)\n", __func__, pscreen, ir,
- shader);
-
if (screen->gpu->get_compiler_options)
options = screen->gpu->get_compiler_options(screen->gpu, ir, shader);
- debug_printf("< %s() = %p\n", __func__, options);
return options;
}
@@ -720,14 +504,8 @@ static struct disk_cache *
tegra_screen_get_disk_shader_cache(struct pipe_screen *pscreen)
{
struct tegra_screen *screen = to_tegra_screen(pscreen);
- struct disk_cache *cache;
- debug_printf("> %s(pscreen=%p)\n", __func__, pscreen);
-
- cache = screen->gpu->get_disk_shader_cache(screen->gpu);
-
- debug_printf("< %s() = %p\n", __func__, cache);
- return cache;
+ return screen->gpu->get_disk_shader_cache(screen->gpu);
}
static struct pipe_resource *
@@ -739,30 +517,7 @@ tegra_screen_resource_create_with_modifiers(struct pipe_screen *pscreen,
struct tegra_screen *screen = to_tegra_screen(pscreen);
struct pipe_resource tmpl = *template;
struct tegra_resource *resource;
- int i, err;
-
- debug_printf("> %s(pscreen=%p, template=%p, modifiers=%p, count=%d)\n",
- __func__, pscreen, template, modifiers, count);
- debug_printf(" template: %p\n", template);
- debug_printf(" target: %u\n", template->target);
- debug_printf(" format: %u (%s)\n", template->format, util_format_name(template->format));
- debug_printf(" width: %u\n", template->width0);
- debug_printf(" height: %u\n", template->height0);
- debug_printf(" depth: %u\n", template->depth0);
- debug_printf(" array_size: %u\n", template->array_size);
- debug_printf(" last_level: %u\n", template->last_level);
- debug_printf(" nr_samples: %u\n", template->nr_samples);
- debug_printf(" usage: %u\n", template->usage);
- debug_printf(" bind: %x\n", template->bind);
-#ifdef DEBUG
- debug_print_bind_flags(" flags", template->bind);
-#endif
- debug_printf(" flags: %x\n", template->flags);
- debug_printf(" modifiers: %d\n", count);
-
- for (i = 0; i < count; i++)
- debug_printf(" %d: %" PRIx64 " (%s)\n", i, modifiers[i],
- util_modifier_name(modifiers[i]));
+ int err;
resource = calloc(1, sizeof(*resource));
if (!resource)
@@ -789,20 +544,16 @@ tegra_screen_resource_create_with_modifiers(struct pipe_screen *pscreen,
if (err < 0)
goto destroy;
- debug_printf(" gpu: %p\n", resource->gpu);
-
memcpy(&resource->base, resource->gpu, sizeof(*resource->gpu));
pipe_reference_init(&resource->base.reference, 1);
resource->base.screen = &screen->base;
- debug_printf("< %s() = %p\n", __func__, resource);
return &resource->base;
destroy:
screen->gpu->resource_destroy(screen->gpu, resource->gpu);
free:
free(resource);
- debug_printf("< %s()\n", __func__);
return NULL;
}
@@ -814,13 +565,8 @@ static void tegra_screen_query_dmabuf_modifiers(struct pipe_screen *pscreen,
{
struct tegra_screen *screen = to_tegra_screen(pscreen);
- debug_printf("> %s(pscreen=%p, format=%x, max=%d, modifiers=%p, external_only=%p, count=%p)\n",
- __func__, pscreen, format, max, modifiers, external_only, count);
-
screen->gpu->query_dmabuf_modifiers(screen->gpu, format, max, modifiers,
external_only, count);
-
- debug_printf("< %s()\n", __func__);
}
static struct pipe_memory_object *
@@ -829,16 +575,9 @@ tegra_screen_memobj_create_from_handle(struct pipe_screen *pscreen,
bool dedicated)
{
struct tegra_screen *screen = to_tegra_screen(pscreen);
- struct pipe_memory_object *memobj;
-
- debug_printf("> %s(pscreen=%p, handle=%p, dedicated=%d))\n", __func__,
- pscreen, handle, dedicated);
- memobj = screen->gpu->memobj_create_from_handle(screen->gpu, handle,
- dedicated);
-
- debug_printf("< %s() = %p\n", __func__, memobj);
- return memobj;
+ return screen->gpu->memobj_create_from_handle(screen->gpu, handle,
+ dedicated);
}
struct pipe_screen *
@@ -846,8 +585,6 @@ tegra_screen_create(int fd)
{
struct tegra_screen *screen;
- debug_printf("> %s(fd=%d)\n", __func__, fd);
-
screen = calloc(1, sizeof(*screen));
if (!screen)
return NULL;
@@ -912,6 +649,5 @@ tegra_screen_create(int fd)
screen->base.query_dmabuf_modifiers = tegra_screen_query_dmabuf_modifiers;
screen->base.memobj_create_from_handle = tegra_screen_memobj_create_from_handle;
- debug_printf("< %s() = %p\n", __func__, &screen->base);
return &screen->base;
}
diff --git a/src/gallium/winsys/tegra/drm/tegra_drm_winsys.c b/src/gallium/winsys/tegra/drm/tegra_drm_winsys.c
index 2875fd3e785..e2a8efb0f63 100644
--- a/src/gallium/winsys/tegra/drm/tegra_drm_winsys.c
+++ b/src/gallium/winsys/tegra/drm/tegra_drm_winsys.c
@@ -33,23 +33,17 @@ struct pipe_screen *tegra_drm_screen_create(int fd)
{
struct pipe_screen *screen;
- debug_printf("> %s(fd=%d)\n", __func__, fd);
-
/*
* NOTE: There are reportedly issues with reusing the file descriptor
* as-is related to Xinerama. Duplicate it to side-step any issues.
*/
fd = fcntl(fd, F_DUPFD_CLOEXEC, 0);
- if (fd < 0) {
- screen = NULL;
- goto out;
- }
+ if (fd < 0)
+ return NULL;
screen = tegra_screen_create(fd);
if (!screen)
close(fd);
-out:
- debug_printf("< %s() = %p\n", __func__, screen);
return screen;
}