This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch devs/devilhorns/apos
in repository efl.

View the commit online.

commit 94cdf5d9f2c306d647ec6e67597fe208752ee736
Author: Christopher Michael <devilho...@comcast.net>
AuthorDate: Tue Aug 23 09:09:42 2022 -0400

    ecore_drm2: Add API function to retrieve cursor size
---
 src/lib/ecore_drm2/Ecore_Drm2.h         |  1 +
 src/lib/ecore_drm2/ecore_drm2.c         |  3 ++-
 src/lib/ecore_drm2/ecore_drm2_device.c  | 23 +++++++++++++++++++++++
 src/lib/ecore_drm2/ecore_drm2_private.h |  1 +
 4 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index 6b880a0b0a..5b5dea6a7c 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -39,6 +39,7 @@ EAPI int ecore_drm2_init(void);
 EAPI int ecore_drm2_shutdown(void);
 EAPI Ecore_Drm2_Device *ecore_drm2_device_open(const char *seat, unsigned int tty);
 EAPI void ecore_drm2_device_close(Ecore_Drm2_Device *dev);
+EAPI void ecore_drm2_device_cursor_size_get(Ecore_Drm2_Device *dev, int *width, int *height);
 
 # endif
 
diff --git a/src/lib/ecore_drm2/ecore_drm2.c b/src/lib/ecore_drm2/ecore_drm2.c
index cec5cb42e4..5d485294b0 100644
--- a/src/lib/ecore_drm2/ecore_drm2.c
+++ b/src/lib/ecore_drm2/ecore_drm2.c
@@ -10,6 +10,7 @@ int _ecore_drm2_log_dom = -1;
 /* external drm function prototypes (for dlopen) */
 void *(*sym_drmModeGetResources)(int fd) = NULL;
 void (*sym_drmModeFreeResources)(drmModeResPtr ptr) = NULL;
+int (*sym_drmGetCap)(int fd, uint64_t capability, uint64_t *value);
 int (*sym_drmSetClientCap)(int fd, uint64_t capability, uint64_t value) = NULL;
 void *(*sym_drmModeGetProperty)(int fd, uint32_t propertyId);
 void (*sym_drmModeFreeProperty)(drmModePropertyPtr ptr);
@@ -19,7 +20,6 @@ int (*sym_drmModeCreatePropertyBlob)(int fd, const void *data, size_t size, uint
 int (*sym_drmModeDestroyPropertyBlob)(int fd, uint32_t id);
 void *(*sym_drmModeObjectGetProperties)(int fd, uint32_t object_id, uint32_t object_type);
 void (*sym_drmModeFreeObjectProperties)(drmModeObjectPropertiesPtr ptr);
-
 void *(*sym_drmModeGetPlaneResources)(int fd);
 void (*sym_drmModeFreePlaneResources)(drmModePlaneResPtr ptr);
 void *(*sym_drmModeGetPlane)(int fd, uint32_t plane_id);
@@ -60,6 +60,7 @@ _ecore_drm2_link(void)
         /* TODO: Sym needed libdrm functions */
         SYM(_drm_lib, drmModeGetResources);
         SYM(_drm_lib, drmModeFreeResources);
+        SYM(_drm_lib, drmGetCap);
         SYM(_drm_lib, drmSetClientCap);
         SYM(_drm_lib, drmModeGetProperty);
         SYM(_drm_lib, drmModeFreeProperty);
diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c b/src/lib/ecore_drm2/ecore_drm2_device.c
index 47b8764467..0143db17b5 100644
--- a/src/lib/ecore_drm2/ecore_drm2_device.c
+++ b/src/lib/ecore_drm2/ecore_drm2_device.c
@@ -210,3 +210,26 @@ ecore_drm2_device_close(Ecore_Drm2_Device *dev)
 
    free(dev);
 }
+
+EAPI void
+ecore_drm2_device_cursor_size_get(Ecore_Drm2_Device *dev, int *width, int *height)
+{
+   uint64_t caps;
+   int ret = -1;
+
+   EINA_SAFETY_ON_NULL_RETURN(dev);
+
+   if (width)
+     {
+        *width = 64;
+        ret = sym_drmGetCap(dev->fd, DRM_CAP_CURSOR_WIDTH, &caps);
+        if (ret == 0) *width = caps;
+     }
+
+   if (height)
+     {
+        *height = 64;
+        ret = sym_drmGetCap(dev->fd, DRM_CAP_CURSOR_HEIGHT, &caps);
+        if (ret == 0) *height = caps;
+     }
+}
diff --git a/src/lib/ecore_drm2/ecore_drm2_private.h b/src/lib/ecore_drm2/ecore_drm2_private.h
index 2977d601b4..39fcdcaf5f 100644
--- a/src/lib/ecore_drm2/ecore_drm2_private.h
+++ b/src/lib/ecore_drm2/ecore_drm2_private.h
@@ -177,6 +177,7 @@ void _ecore_drm2_atomic_state_free(Ecore_Drm2_Atomic_State *state);
 /* external drm function prototypes (for dlopen) */
 extern void *(*sym_drmModeGetResources)(int fd);
 extern void (*sym_drmModeFreeResources)(drmModeResPtr ptr);
+extern int (*sym_drmGetCap)(int fd, uint64_t capability, uint64_t *value);
 extern int (*sym_drmSetClientCap)(int fd, uint64_t capability, uint64_t value);
 extern void *(*sym_drmModeGetProperty)(int fd, uint32_t propertyId);
 extern void (*sym_drmModeFreeProperty)(drmModePropertyPtr ptr);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to