Compare commits
4 Commits
f02385bd09
...
5664911df8
Author | SHA1 | Date |
---|---|---|
Christopher Michael | 5664911df8 | |
Christopher Michael | cf2a325012 | |
Christopher Michael | 5278c54839 | |
Christopher Michael | 28e9ef0ec0 |
|
@ -68,6 +68,11 @@ 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);
|
||||
EAPI const Eina_List *ecore_drm2_display_modes_get(Ecore_Drm2_Display *disp);
|
||||
EAPI void ecore_drm2_display_mode_info_get(Ecore_Drm2_Display_Mode *mode, int *w, int *h, unsigned int *refresh, unsigned int *flags);
|
||||
EAPI Eina_Bool ecore_drm2_display_primary_get(Ecore_Drm2_Display *disp);
|
||||
EAPI void ecore_drm2_display_primary_set(Ecore_Drm2_Display *disp, Eina_Bool primary);
|
||||
|
||||
/* 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);
|
||||
|
|
|
@ -613,3 +613,76 @@ 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;
|
||||
}
|
||||
|
||||
EAPI const Eina_List *
|
||||
ecore_drm2_display_modes_get(Ecore_Drm2_Display *disp)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(disp, NULL);
|
||||
return disp->modes;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
ecore_drm2_display_mode_info_get(Ecore_Drm2_Display_Mode *mode, int *w, int *h, unsigned int *refresh, unsigned int *flags)
|
||||
{
|
||||
if (w) *w = 0;
|
||||
if (h) *h = 0;
|
||||
if (refresh) *refresh = 0;
|
||||
if (flags) *flags = 0;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN(mode);
|
||||
|
||||
if (w) *w = mode->width;
|
||||
if (h) *h = mode->height;
|
||||
if (refresh) *refresh = mode->refresh;
|
||||
if (flags) *flags = mode->flags;
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
ecore_drm2_display_primary_get(Ecore_Drm2_Display *disp)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(disp, EINA_FALSE);
|
||||
return disp->primary;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
ecore_drm2_display_primary_set(Ecore_Drm2_Display *disp, Eina_Bool primary)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN(disp);
|
||||
disp->primary = primary;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue