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/etnaviv | |
parent | c234e39f846deec7355d2eb93506aeea1c61e92d (diff) |
Import libdrm 2.4.110
Diffstat (limited to 'lib/libdrm/etnaviv')
-rw-r--r-- | lib/libdrm/etnaviv/etnaviv_bo.c | 13 | ||||
-rw-r--r-- | lib/libdrm/etnaviv/etnaviv_drm.h | 13 | ||||
-rw-r--r-- | lib/libdrm/etnaviv/meson.build | 9 |
3 files changed, 20 insertions, 15 deletions
diff --git a/lib/libdrm/etnaviv/etnaviv_bo.c b/lib/libdrm/etnaviv/etnaviv_bo.c index 43ce6b4e3..27123e673 100644 --- a/lib/libdrm/etnaviv/etnaviv_bo.c +++ b/lib/libdrm/etnaviv/etnaviv_bo.c @@ -48,12 +48,8 @@ drm_private void bo_del(struct etna_bo *bo) drmHashDelete(bo->dev->name_table, bo->name); if (bo->handle) { - struct drm_gem_close req = { - .handle = bo->handle, - }; - drmHashDelete(bo->dev->handle_table, bo->handle); - drmIoctl(bo->dev->fd, DRM_IOCTL_GEM_CLOSE, &req); + drmCloseBufferHandle(bo->dev->fd, bo->handle); } free(bo); @@ -82,12 +78,7 @@ static struct etna_bo *bo_from_handle(struct etna_device *dev, struct etna_bo *bo = calloc(sizeof(*bo), 1); if (!bo) { - struct drm_gem_close req = { - .handle = handle, - }; - - drmIoctl(dev->fd, DRM_IOCTL_GEM_CLOSE, &req); - + drmCloseBufferHandle(dev->fd, handle); return NULL; } diff --git a/lib/libdrm/etnaviv/etnaviv_drm.h b/lib/libdrm/etnaviv/etnaviv_drm.h index 0d5c49dc4..af024d904 100644 --- a/lib/libdrm/etnaviv/etnaviv_drm.h +++ b/lib/libdrm/etnaviv/etnaviv_drm.h @@ -73,6 +73,10 @@ struct drm_etnaviv_timespec { #define ETNAVIV_PARAM_GPU_INSTRUCTION_COUNT 0x18 #define ETNAVIV_PARAM_GPU_NUM_CONSTANTS 0x19 #define ETNAVIV_PARAM_GPU_NUM_VARYINGS 0x1a +#define ETNAVIV_PARAM_SOFTPIN_START_ADDR 0x1b +#define ETNAVIV_PARAM_GPU_PRODUCT_ID 0x1c +#define ETNAVIV_PARAM_GPU_CUSTOMER_ID 0x1d +#define ETNAVIV_PARAM_GPU_ECO_ID 0x1e #define ETNA_MAX_PIPES 4 @@ -148,6 +152,11 @@ struct drm_etnaviv_gem_submit_reloc { * then patching the cmdstream for this entry is skipped. This can * avoid kernel needing to map/access the cmdstream bo in the common * case. + * If the submit is a softpin submit (ETNA_SUBMIT_SOFTPIN) the 'presumed' + * field is interpreted as the fixed location to map the bo into the gpu + * virtual address space. If the kernel is unable to map the buffer at + * this location the submit will fail. This means userspace is responsible + * for the whole gpu virtual address management. */ #define ETNA_SUBMIT_BO_READ 0x0001 #define ETNA_SUBMIT_BO_WRITE 0x0002 @@ -177,9 +186,11 @@ struct drm_etnaviv_gem_submit_pmr { #define ETNA_SUBMIT_NO_IMPLICIT 0x0001 #define ETNA_SUBMIT_FENCE_FD_IN 0x0002 #define ETNA_SUBMIT_FENCE_FD_OUT 0x0004 +#define ETNA_SUBMIT_SOFTPIN 0x0008 #define ETNA_SUBMIT_FLAGS (ETNA_SUBMIT_NO_IMPLICIT | \ ETNA_SUBMIT_FENCE_FD_IN | \ - ETNA_SUBMIT_FENCE_FD_OUT) + ETNA_SUBMIT_FENCE_FD_OUT| \ + ETNA_SUBMIT_SOFTPIN) #define ETNA_PIPE_3D 0x00 #define ETNA_PIPE_2D 0x01 #define ETNA_PIPE_VG 0x02 diff --git a/lib/libdrm/etnaviv/meson.build b/lib/libdrm/etnaviv/meson.build index 8b82ed079..591f20f0c 100644 --- a/lib/libdrm/etnaviv/meson.build +++ b/lib/libdrm/etnaviv/meson.build @@ -31,6 +31,7 @@ libdrm_etnaviv = library( include_directories : [inc_root, inc_drm], link_with : libdrm, c_args : libdrm_c_args, + gnu_symbol_visibility : 'hidden', dependencies : [dep_pthread_stubs, dep_rt, dep_atomic_ops], version : '1.0.0', install : true, @@ -39,11 +40,9 @@ libdrm_etnaviv = library( install_headers('etnaviv_drmif.h', subdir : 'libdrm') pkg.generate( + libdrm_etnaviv, name : 'libdrm_etnaviv', - libraries : libdrm_etnaviv, subdirs : ['.', 'libdrm'], - version : meson.project_version(), - requires_private : 'libdrm', description : 'Userspace interface to Tegra kernel DRM services', ) @@ -52,6 +51,10 @@ ext_libdrm_etnaviv = declare_dependency( include_directories : [inc_drm, include_directories('.')], ) +if meson.version().version_compare('>= 0.54.0') + meson.override_dependency('libdrm_etnaviv', ext_libdrm_etnaviv) +endif + test( 'etnaviv-symbols-check', symbols_check, |