diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2022-04-29 10:11:54 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2022-04-29 10:11:54 +0000 |
commit | f6a607883d3ddd203eef4b1917035e470b47e760 (patch) | |
tree | da9f4d97f524064d4467d9760843b67b76d69f58 /lib/libdrm/nouveau | |
parent | c234e39f846deec7355d2eb93506aeea1c61e92d (diff) |
Import libdrm 2.4.110
Diffstat (limited to 'lib/libdrm/nouveau')
-rw-r--r-- | lib/libdrm/nouveau/meson.build | 9 | ||||
-rw-r--r-- | lib/libdrm/nouveau/nouveau.c | 5 | ||||
-rw-r--r-- | lib/libdrm/nouveau/pushbuf.c | 6 |
3 files changed, 12 insertions, 8 deletions
diff --git a/lib/libdrm/nouveau/meson.build b/lib/libdrm/nouveau/meson.build index af45336c6..350f34c40 100644 --- a/lib/libdrm/nouveau/meson.build +++ b/lib/libdrm/nouveau/meson.build @@ -23,6 +23,7 @@ libdrm_nouveau = library( 'drm_nouveau', [files( 'nouveau.c', 'pushbuf.c', 'bufctx.c', 'abi16.c'), config_file], c_args : libdrm_c_args, + gnu_symbol_visibility : 'hidden', include_directories : [inc_root, inc_drm], link_with : libdrm, dependencies : [dep_threads, dep_atomic_ops], @@ -35,6 +36,10 @@ ext_libdrm_nouveau = declare_dependency( include_directories : [inc_drm, include_directories('.')], ) +if meson.version().version_compare('>= 0.54.0') + meson.override_dependency('libdrm_nouveau', ext_libdrm_nouveau) +endif + install_headers('nouveau.h', subdir : 'libdrm/nouveau') install_headers( 'nvif/class.h', 'nvif/cl0080.h', 'nvif/cl9097.h', 'nvif/if0002.h', @@ -43,11 +48,9 @@ install_headers( ) pkg.generate( + libdrm_nouveau, name : 'libdrm_nouveau', - libraries : libdrm_nouveau, subdirs : ['.', 'libdrm', 'libdrm/nouveau'], - version : meson.project_version(), - requires_private : 'libdrm', description : 'Userspace interface to nouveau kernel DRM services', ) diff --git a/lib/libdrm/nouveau/nouveau.c b/lib/libdrm/nouveau/nouveau.c index 9fa940a93..7b4efded9 100644 --- a/lib/libdrm/nouveau/nouveau.c +++ b/lib/libdrm/nouveau/nouveau.c @@ -607,7 +607,6 @@ nouveau_bo_del(struct nouveau_bo *bo) struct nouveau_drm *drm = nouveau_drm(&bo->device->object); struct nouveau_device_priv *nvdev = nouveau_device(bo->device); struct nouveau_bo_priv *nvbo = nouveau_bo(bo); - struct drm_gem_close req = { .handle = bo->handle }; if (nvbo->head.next) { pthread_mutex_lock(&nvdev->lock); @@ -621,11 +620,11 @@ nouveau_bo_del(struct nouveau_bo *bo) * might cause the bo to be closed accidentally while * re-importing. */ - drmIoctl(drm->fd, DRM_IOCTL_GEM_CLOSE, &req); + drmCloseBufferHandle(drm->fd, bo->handle); } pthread_mutex_unlock(&nvdev->lock); } else { - drmIoctl(drm->fd, DRM_IOCTL_GEM_CLOSE, &req); + drmCloseBufferHandle(drm->fd, bo->handle); } if (bo->map) drm_munmap(bo->map, bo->size); diff --git a/lib/libdrm/nouveau/pushbuf.c b/lib/libdrm/nouveau/pushbuf.c index 10ff3f57f..5fadd7a99 100644 --- a/lib/libdrm/nouveau/pushbuf.c +++ b/lib/libdrm/nouveau/pushbuf.c @@ -29,6 +29,7 @@ #include <string.h> #include <assert.h> #include <errno.h> +#include <inttypes.h> #include <xf86drm.h> #include <xf86atomic.h> @@ -274,9 +275,10 @@ pushbuf_dump(struct nouveau_pushbuf_krec *krec, int krec_id, int chid) kref = krec->buffer; for (i = 0; i < krec->nr_buffer; i++, kref++) { - err("ch%d: buf %08x %08x %08x %08x %08x\n", chid, i, + bo = (void *)(uintptr_t)kref->user_priv; + err("ch%d: buf %08x %08x %08x %08x %08x %p 0x%"PRIx64" 0x%"PRIx64"\n", chid, i, kref->handle, kref->valid_domains, - kref->read_domains, kref->write_domains); + kref->read_domains, kref->write_domains, bo->map, bo->offset, bo->size); } krel = krec->reloc; |