intel: Downgrade error warnings to debug

As the higher layers check the error return from libdrm-intel and
are supposed to handle the error (and print their own warning in
extremis) the voluminous output on stderr is just noise and a hazard in
its own right.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
main
Chris Wilson 2010-10-01 16:50:09 +01:00
parent 624e58e3e4
commit 96214860bb
1 changed files with 47 additions and 56 deletions

View File

@ -782,8 +782,8 @@ drm_intel_bo_gem_create_from_name(drm_intel_bufmgr *bufmgr,
DRM_IOCTL_GEM_OPEN, DRM_IOCTL_GEM_OPEN,
&open_arg); &open_arg);
if (ret != 0) { if (ret != 0) {
fprintf(stderr, "Couldn't reference %s handle 0x%08x: %s\n", DBG("Couldn't reference %s handle 0x%08x: %s\n",
name, handle, strerror(errno)); name, handle, strerror(errno));
free(bo_gem); free(bo_gem);
return NULL; return NULL;
} }
@ -835,9 +835,8 @@ drm_intel_gem_bo_free(drm_intel_bo *bo)
close.handle = bo_gem->gem_handle; close.handle = bo_gem->gem_handle;
ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_GEM_CLOSE, &close); ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_GEM_CLOSE, &close);
if (ret != 0) { if (ret != 0) {
fprintf(stderr, DBG("DRM_IOCTL_GEM_CLOSE %d failed (%s): %s\n",
"DRM_IOCTL_GEM_CLOSE %d failed (%s): %s\n", bo_gem->gem_handle, bo_gem->name, strerror(errno));
bo_gem->gem_handle, bo_gem->name, strerror(errno));
} }
free(bo); free(bo);
} }
@ -975,10 +974,9 @@ static int drm_intel_gem_bo_map(drm_intel_bo *bo, int write_enable)
&mmap_arg); &mmap_arg);
if (ret != 0) { if (ret != 0) {
ret = -errno; ret = -errno;
fprintf(stderr, DBG("%s:%d: Error mapping buffer %d (%s): %s .\n",
"%s:%d: Error mapping buffer %d (%s): %s .\n", __FILE__, __LINE__, bo_gem->gem_handle,
__FILE__, __LINE__, bo_gem->gem_handle, bo_gem->name, strerror(errno));
bo_gem->name, strerror(errno));
pthread_mutex_unlock(&bufmgr_gem->lock); pthread_mutex_unlock(&bufmgr_gem->lock);
return ret; return ret;
} }
@ -998,9 +996,9 @@ static int drm_intel_gem_bo_map(drm_intel_bo *bo, int write_enable)
DRM_IOCTL_I915_GEM_SET_DOMAIN, DRM_IOCTL_I915_GEM_SET_DOMAIN,
&set_domain); &set_domain);
if (ret != 0) { if (ret != 0) {
fprintf(stderr, "%s:%d: Error setting to CPU domain %d: %s\n", DBG("%s:%d: Error setting to CPU domain %d: %s\n",
__FILE__, __LINE__, bo_gem->gem_handle, __FILE__, __LINE__, bo_gem->gem_handle,
strerror(errno)); strerror(errno));
} }
pthread_mutex_unlock(&bufmgr_gem->lock); pthread_mutex_unlock(&bufmgr_gem->lock);
@ -1033,11 +1031,10 @@ int drm_intel_gem_bo_map_gtt(drm_intel_bo *bo)
&mmap_arg); &mmap_arg);
if (ret != 0) { if (ret != 0) {
ret = -errno; ret = -errno;
fprintf(stderr, DBG("%s:%d: Error preparing buffer map %d (%s): %s .\n",
"%s:%d: Error preparing buffer map %d (%s): %s .\n", __FILE__, __LINE__,
__FILE__, __LINE__, bo_gem->gem_handle, bo_gem->name,
bo_gem->gem_handle, bo_gem->name, strerror(errno));
strerror(errno));
pthread_mutex_unlock(&bufmgr_gem->lock); pthread_mutex_unlock(&bufmgr_gem->lock);
return ret; return ret;
} }
@ -1049,11 +1046,10 @@ int drm_intel_gem_bo_map_gtt(drm_intel_bo *bo)
if (bo_gem->gtt_virtual == MAP_FAILED) { if (bo_gem->gtt_virtual == MAP_FAILED) {
bo_gem->gtt_virtual = NULL; bo_gem->gtt_virtual = NULL;
ret = -errno; ret = -errno;
fprintf(stderr, DBG("%s:%d: Error mapping buffer %d (%s): %s .\n",
"%s:%d: Error mapping buffer %d (%s): %s .\n", __FILE__, __LINE__,
__FILE__, __LINE__, bo_gem->gem_handle, bo_gem->name,
bo_gem->gem_handle, bo_gem->name, strerror(errno));
strerror(errno));
pthread_mutex_unlock(&bufmgr_gem->lock); pthread_mutex_unlock(&bufmgr_gem->lock);
return ret; return ret;
} }
@ -1072,9 +1068,9 @@ int drm_intel_gem_bo_map_gtt(drm_intel_bo *bo)
DRM_IOCTL_I915_GEM_SET_DOMAIN, DRM_IOCTL_I915_GEM_SET_DOMAIN,
&set_domain); &set_domain);
if (ret != 0) { if (ret != 0) {
fprintf(stderr, "%s:%d: Error setting domain %d: %s\n", DBG("%s:%d: Error setting domain %d: %s\n",
__FILE__, __LINE__, bo_gem->gem_handle, __FILE__, __LINE__, bo_gem->gem_handle,
strerror(errno)); strerror(errno));
} }
pthread_mutex_unlock(&bufmgr_gem->lock); pthread_mutex_unlock(&bufmgr_gem->lock);
@ -1148,10 +1144,9 @@ drm_intel_gem_bo_subdata(drm_intel_bo *bo, unsigned long offset,
&pwrite); &pwrite);
if (ret != 0) { if (ret != 0) {
ret = -errno; ret = -errno;
fprintf(stderr, DBG("%s:%d: Error writing data to buffer %d: (%d %d) %s .\n",
"%s:%d: Error writing data to buffer %d: (%d %d) %s .\n", __FILE__, __LINE__, bo_gem->gem_handle, (int)offset,
__FILE__, __LINE__, bo_gem->gem_handle, (int)offset, (int)size, strerror(errno));
(int)size, strerror(errno));
} }
return ret; return ret;
@ -1200,10 +1195,9 @@ drm_intel_gem_bo_get_subdata(drm_intel_bo *bo, unsigned long offset,
&pread); &pread);
if (ret != 0) { if (ret != 0) {
ret = -errno; ret = -errno;
fprintf(stderr, DBG("%s:%d: Error reading data from buffer %d: (%d %d) %s .\n",
"%s:%d: Error reading data from buffer %d: (%d %d) %s .\n", __FILE__, __LINE__, bo_gem->gem_handle, (int)offset,
__FILE__, __LINE__, bo_gem->gem_handle, (int)offset, (int)size, strerror(errno));
(int)size, strerror(errno));
} }
return ret; return ret;
@ -1238,11 +1232,10 @@ drm_intel_gem_bo_start_gtt_access(drm_intel_bo *bo, int write_enable)
DRM_IOCTL_I915_GEM_SET_DOMAIN, DRM_IOCTL_I915_GEM_SET_DOMAIN,
&set_domain); &set_domain);
if (ret != 0) { if (ret != 0) {
fprintf(stderr, DBG("%s:%d: Error setting memory domains %d (%08x %08x): %s .\n",
"%s:%d: Error setting memory domains %d (%08x %08x): %s .\n", __FILE__, __LINE__, bo_gem->gem_handle,
__FILE__, __LINE__, bo_gem->gem_handle, set_domain.read_domains, set_domain.write_domain,
set_domain.read_domains, set_domain.write_domain, strerror(errno));
strerror(errno));
} }
} }
@ -1513,16 +1506,15 @@ drm_intel_gem_bo_exec(drm_intel_bo *bo, int used,
if (ret != 0) { if (ret != 0) {
ret = -errno; ret = -errno;
if (errno == ENOSPC) { if (errno == ENOSPC) {
fprintf(stderr, DBG("Execbuffer fails to pin. "
"Execbuffer fails to pin. " "Estimate: %u. Actual: %u. Available: %u\n",
"Estimate: %u. Actual: %u. Available: %u\n", drm_intel_gem_estimate_batch_space(bufmgr_gem->exec_bos,
drm_intel_gem_estimate_batch_space(bufmgr_gem->exec_bos, bufmgr_gem->
bufmgr_gem-> exec_count),
exec_count), drm_intel_gem_compute_batch_space(bufmgr_gem->exec_bos,
drm_intel_gem_compute_batch_space(bufmgr_gem->exec_bos, bufmgr_gem->
bufmgr_gem-> exec_count),
exec_count), (unsigned int)bufmgr_gem->gtt_size);
(unsigned int)bufmgr_gem->gtt_size);
} }
} }
drm_intel_update_buffer_offsets(bufmgr_gem); drm_intel_update_buffer_offsets(bufmgr_gem);
@ -1583,14 +1575,13 @@ drm_intel_gem_bo_mrb_exec2(drm_intel_bo *bo, int used,
if (ret != 0) { if (ret != 0) {
ret = -errno; ret = -errno;
if (ret == -ENOSPC) { if (ret == -ENOSPC) {
fprintf(stderr, DBG("Execbuffer fails to pin. "
"Execbuffer fails to pin. " "Estimate: %u. Actual: %u. Available: %u\n",
"Estimate: %u. Actual: %u. Available: %u\n", drm_intel_gem_estimate_batch_space(bufmgr_gem->exec_bos,
drm_intel_gem_estimate_batch_space(bufmgr_gem->exec_bos, bufmgr_gem->exec_count),
bufmgr_gem->exec_count), drm_intel_gem_compute_batch_space(bufmgr_gem->exec_bos,
drm_intel_gem_compute_batch_space(bufmgr_gem->exec_bos, bufmgr_gem->exec_count),
bufmgr_gem->exec_count), (unsigned int) bufmgr_gem->gtt_size);
(unsigned int) bufmgr_gem->gtt_size);
} }
} }
drm_intel_update_buffer_offsets2(bufmgr_gem); drm_intel_update_buffer_offsets2(bufmgr_gem);