diff options
author | Keith Packard <keithp@keithp.com> | 2008-12-13 11:06:11 -0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2008-12-17 10:28:25 -0800 |
commit | bd14b2cf7551826c6437bbf1d8409cebd45615a5 (patch) | |
tree | c4d1070eaba166ef219591ffbb1bae09eda52899 /libdrm/intel | |
parent | b13f4e1a32ab98fa719a3233cad59ff4d49cfb38 (diff) |
intel: return error status from drm_intel_gem_bo_map
Applications may actually care if the mapping operation failed, so when
it happens, return an error indication. errno is probably trashed by
fprintf though.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'libdrm/intel')
-rw-r--r-- | libdrm/intel/intel_bufmgr_gem.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libdrm/intel/intel_bufmgr_gem.c b/libdrm/intel/intel_bufmgr_gem.c index c94f82e2..dbce9385 100644 --- a/libdrm/intel/intel_bufmgr_gem.c +++ b/libdrm/intel/intel_bufmgr_gem.c @@ -544,6 +544,8 @@ drm_intel_gem_bo_map(drm_intel_bo *bo, int write_enable) fprintf(stderr, "%s:%d: Error mapping buffer %d (%s): %s .\n", __FILE__, __LINE__, bo_gem->gem_handle, bo_gem->name, strerror(errno)); + pthread_mutex_unlock(&bufmgr_gem->lock); + return ret; } bo_gem->virtual = (void *)(uintptr_t)mmap_arg.addr_ptr; bo_gem->swrast = 0; @@ -566,6 +568,8 @@ drm_intel_gem_bo_map(drm_intel_bo *bo, int write_enable) if (ret != 0) { fprintf (stderr, "%s:%d: Error setting swrast %d: %s\n", __FILE__, __LINE__, bo_gem->gem_handle, strerror (errno)); + pthread_mutex_unlock(&bufmgr_gem->lock); + return ret; } bo_gem->swrast = 1; } |