if (type == PIPE_FD_TYPE_NATIVE_SYNC) {
ret = drmSyncobjCreate(dev->fd, 0, &f->syncobj);
if (ret) {
- fprintf(stderr, "create syncobj failed\n");
+ agx_msg("create syncobj failed\n");
goto err_free_fence;
}
ret = drmSyncobjImportSyncFile(dev->fd, f->syncobj, fd);
if (ret) {
- fprintf(stderr, "import syncfile failed\n");
+ agx_msg("import syncfile failed\n");
goto err_destroy_syncobj;
}
} else {
assert(type == PIPE_FD_TYPE_SYNCOBJ);
ret = drmSyncobjFDToHandle(dev->fd, fd, &f->syncobj);
if (ret) {
- fprintf(stderr, "import syncobj FD failed\n");
+ agx_msg("import syncobj FD failed\n");
goto err_free_fence;
}
}
ret = drmSyncobjExportSyncFile(dev->fd, ctx->syncobj, &fd);
assert(ret >= 0 && fd != -1 && "export failed");
if (ret || fd == -1) {
- fprintf(stderr, "export failed\n");
+ agx_msg("export failed\n");
return NULL;
}
renderonly_scanout_for_resource(&scanout_tmpl, dev->ro, &handle);
if (!nresource->scanout) {
- fprintf(stderr, "Failed to create scanout resource\n");
+ agx_msg("Failed to create scanout resource\n");
free(nresource);
return NULL;
}
static bool warned_about_hacks = false;
if (!warned_about_hacks) {
- fprintf(stderr, "\n------------------\n"
- "Unsupported debug parameter set. Expect breakage.\n"
- "Do not report bugs.\n"
- "------------------\n\n");
+ agx_msg("\n------------------\n"
+ "Unsupported debug parameter set. Expect breakage.\n"
+ "Do not report bugs.\n"
+ "------------------\n\n");
warned_about_hacks = true;
}
}
* implementation lowers to multiple draws with culling. Warn.
*/
if (unlikely(cso->fill_front != cso->fill_back)) {
- fprintf(stderr, "Warning: Two-sided fill modes are unsupported, "
- "rendering may be incorrect.\n");
+ agx_msg("Warning: Two-sided fill modes are unsupported, "
+ "rendering may be incorrect.\n");
}
so->polygon_mode = agx_translate_polygon_mode(cso->fill_front);
#include "util/u_range.h"
#include "agx_meta.h"
+#ifdef __GLIBC__
+#include <errno.h>
+#define agx_msg(fmt, ...) \
+ fprintf(stderr, "[%s] " fmt, program_invocation_short_name, ##__VA_ARGS__)
+#else
+#define agx_msg(...) fprintf(stderr, __VA_ARGS)
+#endif
+
struct agx_streamout_target {
struct pipe_stream_output_target base;
uint32_t offset;