Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[xsrc-public/trunk]: xsrc-public/external/mit/libdrm/include merge libXi 1.8 ...



details:   https://anonhg.NetBSD.org/xsrc-public/rev/e3d0188f06f3
branches:  trunk
changeset: 6943:e3d0188f06f3
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sun Jan 09 09:05:34 2022 +0000

description:
merge libXi 1.8 and libdrm 2.4.109.

updated generated_static_table_fourcc.h generated with:

   python3.9 gen_table_fourcc.py include/drm/drm_fourcc.h ../include/generated_static_table_fourcc.h

diffstat:

 external/mit/libXi/dist/src/XIPassiveGrab.c                 |   59 ++
 external/mit/libdrm/dist/amdgpu/amdgpu.h                    |   13 +
 external/mit/libdrm/dist/amdgpu/amdgpu_bo.c                 |   24 +-
 external/mit/libdrm/dist/include/drm/drm.h                  |  250 +++++++++--
 external/mit/libdrm/dist/intel/intel_bufmgr_gem.c           |  190 +--------
 external/mit/libdrm/dist/radeon/radeon_bo_gem.c             |    7 +-
 external/mit/libdrm/dist/tests/modetest/modetest.c          |   46 +-
 external/mit/libdrm/dist/xf86drm.c                          |  217 +++++++--
 external/mit/libdrm/dist/xf86drm.h                          |    4 +
 external/mit/libdrm/dist/xf86drmMode.c                      |  108 +++++
 external/mit/libdrm/dist/xf86drmMode.h                      |   24 +-
 external/mit/libdrm/include/generated_static_table_fourcc.h |    1 +
 12 files changed, 598 insertions(+), 345 deletions(-)

diffs (truncated from 1778 to 300 lines):

diff -r 1421c8974abd -r e3d0188f06f3 external/mit/libXi/dist/src/XIPassiveGrab.c
--- a/external/mit/libXi/dist/src/XIPassiveGrab.c       Sun Jan 09 09:01:58 2022 +0000
+++ b/external/mit/libXi/dist/src/XIPassiveGrab.c       Sun Jan 09 09:05:34 2022 +0000
@@ -177,6 +177,37 @@
                                 num_modifiers, modifiers_inout, CurrentTime);
 }
 
+int XIGrabPinchGestureBegin(Display* dpy, int deviceid, Window grab_window, int grab_mode,
+                            int paired_device_mode, int owner_events,
+                            XIEventMask *mask, int num_modifiers, XIGrabModifiers *modifiers_inout)
+{
+    XExtDisplayInfo *extinfo = XInput_find_display(dpy);
+
+    LockDisplay(dpy);
+    if (_XiCheckExtInit(dpy, XInput_2_4, extinfo) == -1)
+        return -1;
+    UnlockDisplay(dpy);
+
+    return _XIPassiveGrabDevice(dpy, deviceid, XIGrabtypeGesturePinchBegin, 0,
+                                grab_window, None, grab_mode, paired_device_mode,
+                                owner_events, mask, num_modifiers, modifiers_inout, CurrentTime);
+}
+
+int XIGrabSwipeGestureBegin(Display* dpy, int deviceid, Window grab_window, int grab_mode,
+                            int paired_device_mode, int owner_events,
+                            XIEventMask *mask, int num_modifiers, XIGrabModifiers *modifiers_inout)
+{
+    XExtDisplayInfo *extinfo = XInput_find_display(dpy);
+
+    LockDisplay(dpy);
+    if (_XiCheckExtInit(dpy, XInput_2_4, extinfo) == -1)
+        return -1;
+    UnlockDisplay(dpy);
+
+    return _XIPassiveGrabDevice(dpy, deviceid, XIGrabtypeGestureSwipeBegin, 0,
+                                grab_window, None, grab_mode, paired_device_mode,
+                                owner_events, mask, num_modifiers, modifiers_inout, CurrentTime);
+}
 
 static int
 _XIPassiveUngrabDevice(Display* dpy, int deviceid, int grabtype, int detail,
@@ -256,3 +287,31 @@
     return _XIPassiveUngrabDevice(display, deviceid, XIGrabtypeTouchBegin, 0,
                                   grab_window, num_modifiers, modifiers);
 }
+
+int XIUngrabPinchGestureBegin(Display* display, int deviceid, Window grab_window,
+                              int num_modifiers, XIGrabModifiers *modifiers)
+{
+    XExtDisplayInfo *extinfo = XInput_find_display(display);
+
+    LockDisplay(display);
+    if (_XiCheckExtInit(display, XInput_2_4, extinfo) == -1)
+        return -1;
+    UnlockDisplay(display);
+
+    return _XIPassiveUngrabDevice(display, deviceid, XIGrabtypeGesturePinchBegin, 0,
+                                  grab_window, num_modifiers, modifiers);
+}
+
+int XIUngrabSwipeGestureBegin(Display* display, int deviceid, Window grab_window,
+                              int num_modifiers, XIGrabModifiers *modifiers)
+{
+    XExtDisplayInfo *extinfo = XInput_find_display(display);
+
+    LockDisplay(display);
+    if (_XiCheckExtInit(display, XInput_2_4, extinfo) == -1)
+        return -1;
+    UnlockDisplay(display);
+
+    return _XIPassiveUngrabDevice(display, deviceid, XIGrabtypeGestureSwipeBegin, 0,
+                                  grab_window, num_modifiers, modifiers);
+}
diff -r 1421c8974abd -r e3d0188f06f3 external/mit/libdrm/dist/amdgpu/amdgpu.h
--- a/external/mit/libdrm/dist/amdgpu/amdgpu.h  Sun Jan 09 09:01:58 2022 +0000
+++ b/external/mit/libdrm/dist/amdgpu/amdgpu.h  Sun Jan 09 09:05:34 2022 +0000
@@ -549,6 +549,19 @@
 */
 int amdgpu_device_deinitialize(amdgpu_device_handle device_handle);
 
+/**
+ *
+ * /param device_handle - \c [in] Device handle.
+ *                           See #amdgpu_device_initialize()
+ *
+ * \return Returns the drm fd used for operations on this
+ *         device. This is still owned by the library and hence
+ *         should not be closed. Guaranteed to be valid until
+ *         #amdgpu_device_deinitialize gets called.
+ *
+*/
+int amdgpu_device_get_fd(amdgpu_device_handle device_handle);
+
 /*
  * Memory Management
  *
diff -r 1421c8974abd -r e3d0188f06f3 external/mit/libdrm/dist/amdgpu/amdgpu_bo.c
--- a/external/mit/libdrm/dist/amdgpu/amdgpu_bo.c       Sun Jan 09 09:01:58 2022 +0000
+++ b/external/mit/libdrm/dist/amdgpu/amdgpu_bo.c       Sun Jan 09 09:05:34 2022 +0000
@@ -39,14 +39,6 @@
 #include "amdgpu_internal.h"
 #include "util_math.h"
 
-static int amdgpu_close_kms_handle(int fd, uint32_t handle)
-{
-       struct drm_gem_close args = {};
-
-       args.handle = handle;
-       return drmIoctl(fd, DRM_IOCTL_GEM_CLOSE, &args);
-}
-
 static int amdgpu_bo_create(amdgpu_device_handle dev,
                            uint64_t size,
                            uint32_t handle,
@@ -101,7 +93,7 @@
                             buf_handle);
        pthread_mutex_unlock(&dev->bo_table_mutex);
        if (r) {
-               amdgpu_close_kms_handle(dev->fd, args.out.handle);
+               drmCloseBufferHandle(dev->fd, args.out.handle);
        }
 
 out:
@@ -216,7 +208,7 @@
        bo->flink_name = flink.name;
 
        if (bo->dev->flink_fd != bo->dev->fd)
-               amdgpu_close_kms_handle(bo->dev->flink_fd, handle);
+               drmCloseBufferHandle(bo->dev->flink_fd, handle);
 
        pthread_mutex_lock(&bo->dev->bo_table_mutex);
        r = handle_table_insert(&bo->dev->bo_flink_names, bo->flink_name, bo);
@@ -342,8 +334,8 @@
                        close(dma_fd);
                        if (r)
                                goto free_bo_handle;
-                       r = amdgpu_close_kms_handle(dev->flink_fd,
-                                                   open_arg.handle);
+                       r = drmCloseBufferHandle(dev->flink_fd,
+                                                open_arg.handle);
                        if (r)
                                goto free_bo_handle;
                }
@@ -381,12 +373,12 @@
 
 free_bo_handle:
        if (flink_name && open_arg.handle)
-               amdgpu_close_kms_handle(dev->flink_fd, open_arg.handle);
+               drmCloseBufferHandle(dev->flink_fd, open_arg.handle);
 
        if (bo)
                amdgpu_bo_free(bo);
        else
-               amdgpu_close_kms_handle(dev->fd, handle);
+               drmCloseBufferHandle(dev->fd, handle);
 unlock:
        pthread_mutex_unlock(&dev->bo_table_mutex);
        return r;
@@ -415,7 +407,7 @@
                        amdgpu_bo_cpu_unmap(bo);
                }
 
-               amdgpu_close_kms_handle(dev->fd, bo->handle);
+               drmCloseBufferHandle(dev->fd, bo->handle);
                pthread_mutex_destroy(&bo->cpu_access_mutex);
                free(bo);
        }
@@ -598,7 +590,7 @@
        r = amdgpu_bo_create(dev, size, args.handle, buf_handle);
        pthread_mutex_unlock(&dev->bo_table_mutex);
        if (r) {
-               amdgpu_close_kms_handle(dev->fd, args.handle);
+               drmCloseBufferHandle(dev->fd, args.handle);
        }
 
 out:
diff -r 1421c8974abd -r e3d0188f06f3 external/mit/libdrm/dist/include/drm/drm.h
--- a/external/mit/libdrm/dist/include/drm/drm.h        Sun Jan 09 09:01:58 2022 +0000
+++ b/external/mit/libdrm/dist/include/drm/drm.h        Sun Jan 09 09:05:34 2022 +0000
@@ -1,11 +1,10 @@
-/**
- * \file drm.h
+/*
  * Header for the Direct Rendering Manager
  *
- * \author Rickard E. (Rik) Faith <faith%valinux.com@localhost>
+ * Author: Rickard E. (Rik) Faith <faith%valinux.com@localhost>
  *
- * \par Acknowledgments:
- * Dec 1999, Richard Henderson <rth%twiddle.net@localhost>, move to generic \c cmpxchg.
+ * Acknowledgments:
+ * Dec 1999, Richard Henderson <rth%twiddle.net@localhost>, move to generic cmpxchg.
  */
 
 /*
@@ -82,7 +81,7 @@
 typedef unsigned int drm_drawable_t;
 typedef unsigned int drm_magic_t;
 
-/**
+/*
  * Cliprect.
  *
  * \warning: If you change this structure, make sure you change
@@ -98,7 +97,7 @@
        unsigned short y2;
 };
 
-/**
+/*
  * Drawable information.
  */
 struct drm_drawable_info {
@@ -106,7 +105,7 @@
        struct drm_clip_rect *rects;
 };
 
-/**
+/*
  * Texture region,
  */
 struct drm_tex_region {
@@ -117,7 +116,7 @@
        unsigned int age;
 };
 
-/**
+/*
  * Hardware lock.
  *
  * The lock structure is a simple cache-line aligned integer.  To avoid
@@ -129,7 +128,7 @@
        char padding[60];                       /**< Pad to cache line */
 };
 
-/**
+/*
  * DRM_IOCTL_VERSION ioctl argument type.
  *
  * \sa drmGetVersion().
@@ -146,7 +145,7 @@
        char *desc;       /**< User-space buffer to hold desc */
 };
 
-/**
+/*
  * DRM_IOCTL_GET_UNIQUE ioctl argument type.
  *
  * \sa drmGetBusid() and drmSetBusId().
@@ -165,7 +164,7 @@
        int unused;
 };
 
-/**
+/*
  * DRM_IOCTL_CONTROL ioctl argument type.
  *
  * \sa drmCtlInstHandler() and drmCtlUninstHandler().
@@ -180,7 +179,7 @@
        int irq;
 };
 
-/**
+/*
  * Type of memory to map.
  */
 enum drm_map_type {
@@ -192,7 +191,7 @@
        _DRM_CONSISTENT = 5       /**< Consistent memory for PCI DMA */
 };
 
-/**
+/*
  * Memory mapping flags.
  */
 enum drm_map_flags {
@@ -211,7 +210,7 @@
        void *handle;            /**< Handle of map */
 };
 
-/**
+/*
  * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls
  * argument type.
  *
@@ -228,7 +227,7 @@
        /*   Private data */
 };
 
-/**
+/*
  * DRM_IOCTL_GET_CLIENT ioctl argument type.
  */
 struct drm_client {
@@ -260,7 +259,7 @@
            /* Add to the *END* of the list */
 };
 
-/**
+/*



Home | Main Index | Thread Index | Old Index