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 a13d2c10a7e14db59c0a625d3df133729f3630da
Author: Christopher Michael <devilho...@comcast.net>
AuthorDate: Mon Jan 2 07:20:03 2023 -0500

    ecore_drm2: Add API to return display edid
---
 src/lib/ecore_drm2/Ecore_Drm2.h          |  1 +
 src/lib/ecore_drm2/ecore_drm2_displays.c | 36 ++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+)

diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index 4b499658a9..778f701ff5 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -68,6 +68,7 @@ EAPI void ecore_drm2_display_physical_size_get(Ecore_Drm2_Display *disp, int *w,
 EAPI int ecore_drm2_display_dpms_get(Ecore_Drm2_Display *disp);
 EAPI Eina_Bool ecore_drm2_display_enabled_get(Ecore_Drm2_Display *disp);
 EAPI unsigned int ecore_drm2_display_crtc_get(Ecore_Drm2_Display *disp);
+EAPI char *ecore_drm2_display_edid_get(Ecore_Drm2_Display *disp);
 
 /* XXX: These are 'test' APIs */
 EAPI void ecore_drm2_display_mode_set(Ecore_Drm2_Display *disp, Ecore_Drm2_Display_Mode *mode, int x, int y);
diff --git a/src/lib/ecore_drm2/ecore_drm2_displays.c b/src/lib/ecore_drm2/ecore_drm2_displays.c
index 247bf31f28..fb38ce376d 100644
--- a/src/lib/ecore_drm2/ecore_drm2_displays.c
+++ b/src/lib/ecore_drm2/ecore_drm2_displays.c
@@ -613,3 +613,39 @@ ecore_drm2_display_crtc_get(Ecore_Drm2_Display *disp)
    EINA_SAFETY_ON_NULL_RETURN_VAL(disp->crtc, 0);
    return disp->crtc->id;
 }
+
+EAPI char *
+ecore_drm2_display_edid_get(Ecore_Drm2_Display *disp)
+{
+   char *edid_str = NULL;
+   unsigned char *blob;
+   unsigned char fblob[128];
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(disp, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(disp->conn, NULL);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(disp->conn->state, NULL);
+
+   blob = disp->conn->state->edid.data;
+   if (!blob)
+     {
+        memset(fblob, 0, sizeof(fblob));
+        blob = fblob;
+     }
+
+   edid_str = malloc((128 * 2) + 1);
+   if (edid_str)
+     {
+        unsigned int k, kk;
+        const char *hexch = "0123456789abcdef";
+
+        for (kk = 0, k = 0; k < 128; k++)
+          {
+             edid_str[kk] = hexch[(blob[k] >> 4) & 0xf];
+             edid_str[kk + 1] = hexch[blob[k] & 0xf];
+             kk += 2;
+          }
+        edid_str[kk] = 0;
+     }
+
+   return edid_str;
+}

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

Reply via email to