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 57a4c8a8d45c370beb6dcfdce6d341d6c4bb03a6
Author: Christopher Michael <[email protected]>
AuthorDate: Fri Jan 23 12:15:23 2026 -0600

    ecore_drm2: Cache preferred depth & bpp
    
    As we call this function multiple times from different locations,
    let's cache the preferred depth & bpp to avoid refetching from drm too
    much
---
 src/lib/ecore_drm2/ecore_drm2_device.c  | 9 +++++++++
 src/lib/ecore_drm2/ecore_drm2_private.h | 1 +
 2 files changed, 10 insertions(+)

diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c b/src/lib/ecore_drm2/ecore_drm2_device.c
index fec75ad0b5..346b928f4e 100644
--- a/src/lib/ecore_drm2/ecore_drm2_device.c
+++ b/src/lib/ecore_drm2/ecore_drm2_device.c
@@ -393,9 +393,18 @@ ecore_drm2_device_preferred_depth_get(Ecore_Drm2_Device *dev, int *depth, int *b
 
    EINA_SAFETY_ON_NULL_RETURN(dev);
 
+   if ((dev->depth != 0) && (dev->bpp != 0))
+     {
+        if (depth) *depth = dev->depth;
+        if (bpp) *bpp = dev->bpp;
+        return;
+     }
+
    ret = sym_drmGetCap(dev->fd, DRM_CAP_DUMB_PREFERRED_DEPTH, &caps);
    if (ret == 0)
      {
+        dev->depth = caps;
+        dev->bpp = caps;
         if (depth) *depth = caps;
         if (bpp) *bpp = caps;
      }
diff --git a/src/lib/ecore_drm2/ecore_drm2_private.h b/src/lib/ecore_drm2/ecore_drm2_private.h
index b46517775b..74d5a7a443 100644
--- a/src/lib/ecore_drm2/ecore_drm2_private.h
+++ b/src/lib/ecore_drm2/ecore_drm2_private.h
@@ -370,6 +370,7 @@ struct _Ecore_Drm2_Device
 
    int fd;
    int clock_id;
+   int depth, bpp;
 
    struct
      {

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

Reply via email to