diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2013-11-21 13:30:08 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2013-11-21 13:30:08 +0000 |
commit | 56d47e600c0f3bd13b8de3d21f09c2f150e7e9dc (patch) | |
tree | fe1f1a3ae7d16ad35e4748f69fcccc3741ac7cfc /lib/libdrm/intel | |
parent | d4d6a6023ec2b01f5b80249f65559e1864b09643 (diff) |
update to libdrm 2.4.47
ok mpi@, jsg@
Diffstat (limited to 'lib/libdrm/intel')
-rw-r--r-- | lib/libdrm/intel/intel_bufmgr_gem.c | 19 | ||||
-rw-r--r-- | lib/libdrm/intel/libdrm_intel.pc.in | 4 |
2 files changed, 20 insertions, 3 deletions
diff --git a/lib/libdrm/intel/intel_bufmgr_gem.c b/lib/libdrm/intel/intel_bufmgr_gem.c index 0a42b719b..fb1a44c25 100644 --- a/lib/libdrm/intel/intel_bufmgr_gem.c +++ b/lib/libdrm/intel/intel_bufmgr_gem.c @@ -1326,6 +1326,7 @@ int drm_intel_gem_bo_map_gtt(drm_intel_bo *bo) int drm_intel_gem_bo_map_unsynchronized(drm_intel_bo *bo) { drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; + drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; int ret; /* If the CPU cache isn't coherent with the GTT, then use a @@ -1339,7 +1340,13 @@ int drm_intel_gem_bo_map_unsynchronized(drm_intel_bo *bo) return drm_intel_gem_bo_map_gtt(bo); pthread_mutex_lock(&bufmgr_gem->lock); + ret = map_gtt(bo); + if (ret == 0) { + drm_intel_gem_bo_mark_mmaps_incoherent(bo); + VG(VALGRIND_MAKE_MEM_DEFINED(bo_gem->gtt_virtual, bo->size)); + } + pthread_mutex_unlock(&bufmgr_gem->lock); return ret; @@ -2459,7 +2466,17 @@ drm_intel_bo_gem_create_from_prime(drm_intel_bufmgr *bufmgr, int prime_fd, int s if (!bo_gem) return NULL; - bo_gem->bo.size = size; + /* Determine size of bo. The fd-to-handle ioctl really should + * return the size, but it doesn't. If we have kernel 3.12 or + * later, we can lseek on the prime fd to get the size. Older + * kernels will just fail, in which case we fall back to the + * provided (estimated or guess size). */ + ret = lseek(prime_fd, 0, SEEK_END); + if (ret != -1) + bo_gem->bo.size = ret; + else + bo_gem->bo.size = size; + bo_gem->bo.handle = handle; bo_gem->bo.bufmgr = bufmgr; diff --git a/lib/libdrm/intel/libdrm_intel.pc.in b/lib/libdrm/intel/libdrm_intel.pc.in index 3b4b74cd7..e3e1b8a40 100644 --- a/lib/libdrm/intel/libdrm_intel.pc.in +++ b/lib/libdrm/intel/libdrm_intel.pc.in @@ -3,8 +3,8 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ -Name: libdrm -Description: Userspace interface to kernel DRM services +Name: libdrm_intel +Description: Userspace interface to intel kernel DRM services Version: @PACKAGE_VERSION@ Libs: -L${libdir} -ldrm -ldrm_intel Cflags: -I${includedir} -I/usr/include/dev/pci/drm |