[EGIT] [efl] 01/02: ecore_drm2: Add API function to retrieve cursor size

2022-08-23 Thread Enlightenment Git

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 f6a0c3d19a3191cf25c923045feea504f1131d28
Author: Christopher Michael 
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.





[EGIT] [efl] 02/02: ecore_drm2: Add API function to get preferred depth

2022-08-23 Thread Enlightenment Git

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 b87fde4248e235579f844c36244f38e362abf07c
Author: Christopher Michael 
AuthorDate: Tue Aug 23 09:17:15 2022 -0400

ecore_drm2: Add API function to get preferred depth
---
 src/lib/ecore_drm2/Ecore_Drm2.h|  1 +
 src/lib/ecore_drm2/ecore_drm2_device.c | 16 
 2 files changed, 17 insertions(+)

diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index 5b5dea6a7c..4a860883e0 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -40,6 +40,7 @@ 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);
+EAPI void ecore_drm2_device_preferred_depth_get(Ecore_Drm2_Device *dev, int *depth, int *bpp);
 
 # endif
 
diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c b/src/lib/ecore_drm2/ecore_drm2_device.c
index 0143db17b5..ec280cbf7e 100644
--- a/src/lib/ecore_drm2/ecore_drm2_device.c
+++ b/src/lib/ecore_drm2/ecore_drm2_device.c
@@ -233,3 +233,19 @@ ecore_drm2_device_cursor_size_get(Ecore_Drm2_Device *dev, int *width, int *heigh
 if (ret == 0) *height = caps;
  }
 }
+
+EAPI void
+ecore_drm2_device_preferred_depth_get(Ecore_Drm2_Device *dev, int *depth, int *bpp)
+{
+   uint64_t caps;
+   int ret = -1;
+
+   EINA_SAFETY_ON_NULL_RETURN(dev);
+
+   ret = sym_drmGetCap(dev->fd, DRM_CAP_DUMB_PREFERRED_DEPTH, &caps);
+   if (ret == 0)
+ {
+if (depth) *depth = caps;
+if (bpp) *bpp = caps;
+ }
+}


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





[EGIT] [terminology] 01/01: colorschemes helper: compute pre-multiplied alpha

2022-08-23 Thread Enlightenment Git

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

git pushed a commit to branch master
in repository terminology.


View the commit online.
commit fccf4b18e43adf492ae1397d3c7448f074aef109
Author: Boris Faure 
AuthorDate: Tue Aug 23 22:33:42 2022 +0200

colorschemes helper: compute pre-multiplied alpha
---
 data/colorschemes/ini2desc.py | 16 ++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/data/colorschemes/ini2desc.py b/data/colorschemes/ini2desc.py
index 798962c..d5a9117 100755
--- a/data/colorschemes/ini2desc.py
+++ b/data/colorschemes/ini2desc.py
@@ -3,6 +3,14 @@
 import argparse
 import configparser
 
+def ensure_premultiplied(t):
+(r, g, b, a) = t
+if a != 255 and (a > r or a > g or a > b):
+r = (r * a) // 255
+g = (g * a) // 255
+b = (b * a) // 255
+return (r, g, b, a)
+
 def parse_color(color_string):
 h = color_string.lstrip('#')
 if len(h) == 6:
@@ -10,9 +18,13 @@ def parse_color(color_string):
 elif len(h) == 3:
 return tuple(int(h[i]+h[i], 16) for i in (0, 1, 2)) + (255,)
 elif len(h) == 8:
-return tuple(int(h[i:i+2], 16) for i in (0, 2, 4, 6))
+t = tuple(int(h[i:i+2], 16) for i in (0, 2, 4, 6))
+t = ensure_premultiplied(t)
+return t
 elif len(h) == 4:
-return tuple(int(h[i]+h[i], 16) for i in (0, 1, 2, 3))
+t = tuple(int(h[i]+h[i], 16) for i in (0, 1, 2, 3))
+t = ensure_premultiplied(t)
+return t
 
 def write_color(out, color_string):
 (r, g, b, a) = parse_color(color_string)


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