Consistently just use C99's __func__ everywhere.
No functional changes.
Acked-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Marius Predut <marius.predut@intel.com>
break;
default:
fprintf(stderr, "[%s:%u] Unknown framebuffer type %s (%d).\n",
- __FUNCTION__, __LINE__,
+ __func__, __LINE__,
_mesa_get_format_name(format), format);
return NULL;
}
}
DBG("%s %s to mt %p level %d layer %d\n",
- __FUNCTION__, opname, mt, level, layer);
+ __func__, opname, mt, level, layer);
if (brw->gen >= 8) {
gen8_hiz_exec(brw, mt, level, layer, op);
DBG("%s from %dx %s mt %p %d %d (%f,%f) (%f,%f)"
"to %dx %s mt %p %d %d (%f,%f) (%f,%f) (flip %d,%d)\n",
- __FUNCTION__,
+ __func__,
src_mt->num_samples, _mesa_get_format_name(src_mt->format), src_mt,
src_level, src_layer, src_x0, src_y0, src_x1, src_y1,
dst_mt->num_samples, _mesa_get_format_name(dst_mt->format), dst_mt,
struct brw_context *brw = rzalloc(NULL, struct brw_context);
if (!brw) {
- fprintf(stderr, "%s: failed to alloc context\n", __FUNCTION__);
+ fprintf(stderr, "%s: failed to alloc context\n", __func__);
*dri_ctx_error = __DRI_CTX_ERROR_NO_MEMORY;
return false;
}
if (!_mesa_initialize_context(ctx, api, mesaVis, shareCtx, &functions)) {
*dri_ctx_error = __DRI_CTX_ERROR_NO_MEMORY;
- fprintf(stderr, "%s: failed to init mesa context\n", __FUNCTION__);
+ fprintf(stderr, "%s: failed to init mesa context\n", __func__);
intelDestroyContext(driContextPriv);
return false;
}
}
if (0)
- fprintf(stderr, "%s %d..%d\n", __FUNCTION__, min_index, max_index);
+ fprintf(stderr, "%s %d..%d\n", __func__, min_index, max_index);
/* Accumulate the list of enabled arrays. */
brw->vb.nr_enabled = 0;
struct brw_cache_item *c, *next;
GLuint i;
- DBG("%s\n", __FUNCTION__);
+ DBG("%s\n", __func__);
for (i = 0; i < cache->size; i++) {
for (c = cache->items[i]; c; c = next) {
brw_destroy_cache(struct brw_context *brw, struct brw_cache *cache)
{
- DBG("%s\n", __FUNCTION__);
+ DBG("%s\n", __func__);
if (brw->has_llc)
drm_intel_bo_unmap(cache->bo);
}
break;
}
- DBG("%s: %dx%dx%d\n", __FUNCTION__,
+ DBG("%s: %dx%dx%d\n", __func__,
mt->total_width, mt->total_height, mt->cpp);
}
format = brw->render_target_format[rb_format];
if (unlikely(!brw->format_supported_as_render_target[rb_format])) {
_mesa_problem(ctx, "%s: renderbuffer format %s unsupported\n",
- __FUNCTION__, _mesa_get_format_name(rb_format));
+ __func__, _mesa_get_format_name(rb_format));
}
surf[0] = (BRW_SURFACE_2D << BRW_SURFACE_TYPE_SHIFT |
format = brw->render_target_format[rb_format];
if (unlikely(!brw->format_supported_as_render_target[rb_format])) {
_mesa_problem(ctx, "%s: renderbuffer format %s unsupported\n",
- __FUNCTION__, _mesa_get_format_name(rb_format));
+ __func__, _mesa_get_format_name(rb_format));
}
switch (gl_target) {
format = brw->render_target_format[rb_format];
if (unlikely(!brw->format_supported_as_render_target[rb_format])) {
_mesa_problem(ctx, "%s: renderbuffer format %s unsupported\n",
- __FUNCTION__, _mesa_get_format_name(rb_format));
+ __func__, _mesa_get_format_name(rb_format));
}
switch (gl_target) {
format = brw->render_target_format[rb_format];
if (unlikely(!brw->format_supported_as_render_target[rb_format]))
_mesa_problem(ctx, "%s: renderbuffer format %s unsupported\n",
- __FUNCTION__, _mesa_get_format_name(rb_format));
+ __func__, _mesa_get_format_name(rb_format));
}
if (mt->mcs_mt) {
(dst_format != MESA_FORMAT_B8G8R8A8_UNORM &&
dst_format != MESA_FORMAT_B8G8R8X8_UNORM))) {
perf_debug("%s: Can't use hardware blitter from %s to %s, "
- "falling back.\n", __FUNCTION__,
+ "falling back.\n", __func__,
_mesa_get_format_name(src_format),
_mesa_get_format_name(dst_format));
return false;
intel_batchbuffer_require_space(brw, length * 4, BLT_RING);
DBG("%s src:buf(%p)/%d+%d %d,%d dst:buf(%p)/%d+%d %d,%d sz:%dx%d\n",
- __FUNCTION__,
+ __func__,
src_buffer, src_pitch, src_offset, src_x, src_y,
dst_buffer, dst_pitch, dst_offset, dst_x, dst_y, w, h);
return true;
DBG("%s dst:buf(%p)/%d+%d %d,%d sz:%dx%d, %d bytes %d dwords\n",
- __FUNCTION__,
+ __func__,
dst_buffer, dst_pitch, dst_offset, x, y, w, h, src_size, dwords);
unsigned xy_setup_blt_length = brw->gen >= 8 ? 10 : 8;
cpp = mt->cpp;
DBG("%s dst:buf(%p)/%d %d,%d sz:%dx%d\n",
- __FUNCTION__, mt->bo, pitch, x, y, width, height);
+ __func__, mt->bo, pitch, x, y, width, height);
BR13 = br13_for_cpp(cpp) | 0xf0 << 16;
CMD = XY_COLOR_BLT_CMD;
}
DBG("%s: rb %d (%s) mt mapped: (%d, %d) (%dx%d) -> %p/%"PRIdPTR"\n",
- __FUNCTION__, rb->Name, _mesa_get_format_name(rb->Format),
+ __func__, rb->Name, _mesa_get_format_name(rb->Format),
x, y, w, h, map, stride);
*out_map = map;
struct intel_renderbuffer *irb = intel_renderbuffer(rb);
struct intel_mipmap_tree *mt;
- DBG("%s: rb %d (%s)\n", __FUNCTION__,
+ DBG("%s: rb %d (%s)\n", __func__,
rb->Name, _mesa_get_format_name(rb->Format));
if (srb->Buffer) {
intel_miptree_release(&irb->mt);
- DBG("%s: %s: %s (%dx%d)\n", __FUNCTION__,
+ DBG("%s: %s: %s (%dx%d)\n", __func__,
_mesa_lookup_enum_by_nr(internalFormat),
_mesa_get_format_name(rb->Format), width, height);
struct intel_mipmap_tree *depth_mt = NULL, *stencil_mt = NULL;
int i;
- DBG("%s() on fb %p (%s)\n", __FUNCTION__,
+ DBG("%s() on fb %p (%s)\n", __func__,
fb, (fb == ctx->DrawBuffer ? "drawbuffer" :
(fb == ctx->ReadBuffer ? "readbuffer" : "other buffer")));
if (!mt)
return NULL;
- DBG("%s target %s format %s level %d..%d slices %d <-- %p\n", __FUNCTION__,
+ DBG("%s target %s format %s level %d..%d slices %d <-- %p\n", __func__,
_mesa_lookup_enum_by_nr(target),
_mesa_get_format_name(format),
first_level, last_level, depth0, mt);
if (src) {
src->refcount++;
- DBG("%s %p refcount now %d\n", __FUNCTION__, src, src->refcount);
+ DBG("%s %p refcount now %d\n", __func__, src, src->refcount);
}
*dst = src;
if (!*mt)
return;
- DBG("%s %p refcount will be %d\n", __FUNCTION__, *mt, (*mt)->refcount - 1);
+ DBG("%s %p refcount will be %d\n", __func__, *mt, (*mt)->refcount - 1);
if (--(*mt)->refcount <= 0) {
GLuint i;
- DBG("%s deleting %p\n", __FUNCTION__, *mt);
+ DBG("%s deleting %p\n", __func__, *mt);
drm_intel_bo_unreference((*mt)->bo);
intel_miptree_release(&(*mt)->stencil_mt);
mt->level[level].level_x = x;
mt->level[level].level_y = y;
- DBG("%s level %d, depth %d, offset %d,%d\n", __FUNCTION__,
+ DBG("%s level %d, depth %d, offset %d,%d\n", __func__,
level, d, x, y);
assert(mt->level[level].slice == NULL);
mt->level[level].slice[img].y_offset = mt->level[level].level_y + y;
DBG("%s level %d img %d pos %d,%d\n",
- __FUNCTION__, level, img,
+ __func__, level, img,
mt->level[level].slice[img].x_offset,
mt->level[level].slice[img].y_offset);
}
}
DBG("%s: %d,%d %dx%d from mt %p (%s) "
- "%"PRIiPTR",%"PRIiPTR" = %p/%d\n", __FUNCTION__,
+ "%"PRIiPTR",%"PRIiPTR" = %p/%d\n", __func__,
map->x, map->y, map->w, map->h,
mt, _mesa_get_format_name(mt->format),
x, y, map->ptr, map->stride);
map->ptr = intel_miptree_map_raw(brw, map->mt);
- DBG("%s: %d,%d %dx%d from mt %p (%s) %d,%d = %p/%d\n", __FUNCTION__,
+ DBG("%s: %d,%d %dx%d from mt %p (%s) %d,%d = %p/%d\n", __func__,
map->x, map->y, map->w, map->h,
mt, _mesa_get_format_name(mt->format),
level, slice, map->ptr, map->stride);
assert(map->mode & GL_MAP_READ_BIT);
assert(!(map->mode & GL_MAP_WRITE_BIT));
- DBG("%s: %d,%d %dx%d from mt %p (%s) %d,%d = %p/%d\n", __FUNCTION__,
+ DBG("%s: %d,%d %dx%d from mt %p (%s) %d,%d = %p/%d\n", __func__,
map->x, map->y, map->w, map->h,
mt, _mesa_get_format_name(mt->format),
level, slice, map->ptr, map->stride);
intel_miptree_unmap_raw(brw, mt);
- DBG("%s: %d,%d %dx%d from mt %p %d,%d = %p/%d\n", __FUNCTION__,
+ DBG("%s: %d,%d %dx%d from mt %p %d,%d = %p/%d\n", __func__,
map->x, map->y, map->w, map->h,
mt, map->x + image_x, map->y + image_y, map->ptr, map->stride);
} else {
- DBG("%s: %d,%d %dx%d from mt %p = %p/%d\n", __FUNCTION__,
+ DBG("%s: %d,%d %dx%d from mt %p = %p/%d\n", __func__,
map->x, map->y, map->w, map->h,
mt, map->ptr, map->stride);
}
intel_miptree_unmap_raw(brw, z_mt);
DBG("%s: %d,%d %dx%d from z mt %p %d,%d, s mt %p %d,%d = %p/%d\n",
- __FUNCTION__,
+ __func__,
map->x, map->y, map->w, map->h,
z_mt, map->x + z_image_x, map->y + z_image_y,
s_mt, map->x + s_image_x, map->y + s_image_y,
map->ptr, map->stride);
} else {
- DBG("%s: %d,%d %dx%d from mt %p = %p/%d\n", __FUNCTION__,
+ DBG("%s: %d,%d %dx%d from mt %p = %p/%d\n", __func__,
map->x, map->y, map->w, map->h,
mt, map->ptr, map->stride);
}
intel_miptree_unmap_raw(brw, z_mt);
DBG("%s: %d,%d %dx%d from z mt %p (%s) %d,%d, s mt %p %d,%d = %p/%d\n",
- __FUNCTION__,
+ __func__,
map->x, map->y, map->w, map->h,
z_mt, _mesa_get_format_name(z_mt->format),
map->x + z_image_x, map->y + z_image_y,
if (!map)
return;
- DBG("%s: mt %p (%s) level %d slice %d\n", __FUNCTION__,
+ DBG("%s: mt %p (%s) level %d slice %d\n", __func__,
mt, _mesa_get_format_name(mt->format), level, slice);
if (mt->format == MESA_FORMAT_S_UINT8) {
GLuint count = 0;
DBG("%s %d,%d %dx%d bitmap %dx%d skip %d src_offset %d mask %d\n",
- __FUNCTION__, x,y,w,h,width,height,unpack->SkipPixels, src_offset, mask);
+ __func__, x,y,w,h,width,height,unpack->SkipPixels, src_offset, mask);
if (invert) {
first = h-1;
width, height,
(ctx->Color.ColorLogicOpEnabled ?
ctx->Color.LogicOp : GL_COPY))) {
- DBG("%s: blit failure\n", __FUNCTION__);
+ DBG("%s: blit failure\n", __func__);
return false;
}
out:
- DBG("%s: success\n", __FUNCTION__);
+ DBG("%s: success\n", __func__);
return true;
}
GLsizei width, GLsizei height,
GLint destx, GLint desty, GLenum type)
{
- DBG("%s\n", __FUNCTION__);
+ DBG("%s\n", __func__);
if (!_mesa_check_conditional_render(ctx))
return;
GLuint src_offset;
drm_intel_bo *src_buffer;
- DBG("%s\n", __FUNCTION__);
+ DBG("%s\n", __func__);
if (!intel_check_blit_fragment_ops(ctx, false))
return false;
if (ctx->DrawBuffer->_NumColorDrawBuffers != 1) {
- DBG("%s: fallback due to MRT\n", __FUNCTION__);
+ DBG("%s: fallback due to MRT\n", __func__);
return false;
}
if (!_mesa_format_matches_format_and_type(irb->mt->format, format, type,
false)) {
- DBG("%s: bad format for blit\n", __FUNCTION__);
+ DBG("%s: bad format for blit\n", __func__);
return false;
}
if (unpack->SwapBytes || unpack->LsbFirst ||
unpack->SkipPixels || unpack->SkipRows) {
- DBG("%s: bad packing params\n", __FUNCTION__);
+ DBG("%s: bad packing params\n", __func__);
return false;
}
irb->mt, irb->mt_level, irb->mt_layer,
x, y, _mesa_is_winsys_fbo(ctx->DrawBuffer),
width, height, GL_COPY)) {
- DBG("%s: blit failed\n", __FUNCTION__);
+ DBG("%s: blit failed\n", __func__);
intel_miptree_release(&pbo_mt);
return false;
}
if (ctx->Query.CurrentOcclusionObject)
ctx->Query.CurrentOcclusionObject->Result += width * height;
- DBG("%s: success\n", __FUNCTION__);
+ DBG("%s: success\n", __func__);
return true;
}
return;
}
- perf_debug("%s: fallback to generic code in PBO case\n", __FUNCTION__);
+ perf_debug("%s: fallback to generic code in PBO case\n", __func__);
}
_mesa_meta_DrawPixels(ctx, x, y, width, height, format, type,
error = brw_bo_map(brw, bo, false /* write enable */, "miptree");
if (error) {
- DBG("%s: failed to map bo\n", __FUNCTION__);
+ DBG("%s: failed to map bo\n", __func__);
return false;
}
DBG("%s: x,y=(%d,%d) (w,h)=(%d,%d) format=0x%x type=0x%x "
"mesa_format=0x%x tiling=%d "
"pack=(alignment=%d row_length=%d skip_pixels=%d skip_rows=%d)\n",
- __FUNCTION__, xoffset, yoffset, width, height,
+ __func__, xoffset, yoffset, width, height,
format, type, rb->Format, irb->mt->tiling,
pack->Alignment, pack->RowLength, pack->SkipPixels,
pack->SkipRows);
struct brw_context *brw = brw_context(ctx);
bool dirty;
- DBG("%s\n", __FUNCTION__);
+ DBG("%s\n", __func__);
if (_mesa_is_bufferobj(pack->BufferObj)) {
if (_mesa_meta_pbo_GetTexSubImage(ctx, 2, NULL, x, y, 0, width, height, 1,
format, type, pixels, pack))
return;
- perf_debug("%s: fallback to CPU mapping in PBO case\n", __FUNCTION__);
+ perf_debug("%s: fallback to CPU mapping in PBO case\n", __func__);
}
ok = intel_readpixels_tiled_memcpy(ctx, x, y, width, height,
if (f->nplanes == 1) {
image->offset = image->offsets[0];
- intel_image_warn_if_unaligned(image, __FUNCTION__);
+ intel_image_warn_if_unaligned(image, __func__);
}
return image;
image->pitch = stride;
image->offset = offset;
- intel_image_warn_if_unaligned(image, __FUNCTION__);
+ intel_image_warn_if_unaligned(image, __func__);
return image;
}
static struct gl_texture_image *
intelNewTextureImage(struct gl_context * ctx)
{
- DBG("%s\n", __FUNCTION__);
+ DBG("%s\n", __func__);
(void) ctx;
return (struct gl_texture_image *) CALLOC_STRUCT(intel_texture_image);
}
(void) ctx;
- DBG("%s\n", __FUNCTION__);
+ DBG("%s\n", __func__);
if (obj == NULL)
return NULL;
intel_miptree_match_image(intel_texobj->mt, image)) {
intel_miptree_reference(&intel_image->mt, intel_texobj->mt);
DBG("%s: alloc obj %p level %d %dx%dx%d using object's miptree %p\n",
- __FUNCTION__, texobj, image->Level,
+ __func__, texobj, image->Level,
image->Width, image->Height, image->Depth, intel_texobj->mt);
} else {
intel_image->mt = intel_miptree_create_for_teximage(brw, intel_texobj,
intel_miptree_reference(&intel_texobj->mt, intel_image->mt);
DBG("%s: alloc obj %p level %d %dx%dx%d using new miptree %p\n",
- __FUNCTION__, texobj, image->Level,
+ __func__, texobj, image->Level,
image->Width, image->Height, image->Depth, intel_image->mt);
}
{
struct intel_texture_image *intelImage = intel_texture_image(texImage);
- DBG("%s\n", __FUNCTION__);
+ DBG("%s\n", __func__);
intel_miptree_release(&intelImage->mt);
if (!intelImage->mt || !irb || !irb->mt) {
if (unlikely(INTEL_DEBUG & DEBUG_PERF))
fprintf(stderr, "%s fail %p %p (0x%08x)\n",
- __FUNCTION__, intelImage->mt, irb, internalFormat);
+ __func__, intelImage->mt, irb, internalFormat);
return false;
}
}
/* Finally, fall back to meta. This will likely be slow. */
- perf_debug("%s - fallback to swrast\n", __FUNCTION__);
+ perf_debug("%s - fallback to swrast\n", __func__);
_mesa_meta_CopyTexSubImage(ctx, dims, texImage,
xoffset, yoffset, slice,
rb, x, y, width, height);
intel_miptree_get_dimensions_for_image(&intelImage->base.Base,
&width, &height, &depth);
- DBG("%s\n", __FUNCTION__);
+ DBG("%s\n", __func__);
/* Figure out image dimensions at start level. */
for (i = intelImage->base.Base.Level; i > 0; i--) {
bool tex_busy = intelImage->mt && drm_intel_bo_busy(intelImage->mt->bo);
DBG("%s mesa_format %s target %s format %s type %s level %d %dx%dx%d\n",
- __FUNCTION__, _mesa_get_format_name(texImage->TexFormat),
+ __func__, _mesa_get_format_name(texImage->TexFormat),
_mesa_lookup_enum_by_nr(texImage->TexObject->Target),
_mesa_lookup_enum_by_nr(format), _mesa_lookup_enum_by_nr(type),
texImage->Level, texImage->Width, texImage->Height, texImage->Depth);
return;
DBG("%s: upload image %dx%dx%d pixels %p\n",
- __FUNCTION__, texImage->Width, texImage->Height, texImage->Depth,
+ __func__, texImage->Width, texImage->Height, texImage->Depth,
pixels);
_mesa_store_teximage(ctx, dims, texImage,
error = brw_bo_map(brw, bo, false /* write enable */, "miptree");
if (error) {
- DBG("%s: failed to map bo\n", __FUNCTION__);
+ DBG("%s: failed to map bo\n", __func__);
return false;
}
DBG("%s: level=%d x,y=(%d,%d) (w,h)=(%d,%d) format=0x%x type=0x%x "
"mesa_format=0x%x tiling=%d "
"packing=(alignment=%d row_length=%d skip_pixels=%d skip_rows=%d)\n",
- __FUNCTION__, texImage->Level, xoffset, yoffset, width, height,
+ __func__, texImage->Level, xoffset, yoffset, width, height,
format, type, texImage->TexFormat, image->mt->tiling,
packing->Alignment, packing->RowLength, packing->SkipPixels,
packing->SkipRows);
struct brw_context *brw = brw_context(ctx);
bool ok;
- DBG("%s\n", __FUNCTION__);
+ DBG("%s\n", __func__);
if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) {
if (_mesa_meta_pbo_GetTexSubImage(ctx, 3, texImage, 0, 0, 0,
pixels, &ctx->Pack))
return;
- perf_debug("%s: fallback to CPU mapping in PBO case\n", __FUNCTION__);
+ perf_debug("%s: fallback to CPU mapping in PBO case\n", __func__);
}
ok = intel_gettexsubimage_tiled_memcpy(ctx, texImage, 0, 0,
_mesa_meta_GetTexImage(ctx, format, type, pixels, texImage);
- DBG("%s - DONE\n", __FUNCTION__);
+ DBG("%s - DONE\n", __func__);
}
void
error = brw_bo_map(brw, bo, true /* write enable */, "miptree");
if (error || bo->virtual == NULL) {
- DBG("%s: failed to map bo\n", __FUNCTION__);
+ DBG("%s: failed to map bo\n", __func__);
return false;
}
"mesa_format=0x%x tiling=%d "
"packing=(alignment=%d row_length=%d skip_pixels=%d skip_rows=%d) "
"for_glTexImage=%d\n",
- __FUNCTION__, texImage->Level, xoffset, yoffset, width, height,
+ __func__, texImage->Level, xoffset, yoffset, width, height,
format, type, texImage->TexFormat, image->mt->tiling,
packing->Alignment, packing->RowLength, packing->SkipPixels,
packing->SkipRows, for_glTexImage);
bool tex_busy = intelImage->mt && drm_intel_bo_busy(intelImage->mt->bo);
DBG("%s mesa_format %s target %s format %s type %s level %d %dx%dx%d\n",
- __FUNCTION__, _mesa_get_format_name(texImage->TexFormat),
+ __func__, _mesa_get_format_name(texImage->TexFormat),
_mesa_lookup_enum_by_nr(texImage->TexObject->Target),
_mesa_lookup_enum_by_nr(format), _mesa_lookup_enum_by_nr(type),
texImage->Level, texImage->Width, texImage->Height, texImage->Depth);
int ret = 0;
-#define register_coalesce(v) _register_coalesce(v, __FUNCTION__)
+#define register_coalesce(v) _register_coalesce(v, __func__)
class register_coalesce_test : public ::testing::Test {
virtual void SetUp();