ecore_drm2: Add API to get screen size range
This commit is contained in:
parent
06960f71ca
commit
e47a812240
|
@ -53,7 +53,9 @@ EAPI Ecore_Drm2_Device *ecore_drm2_device_open(const char *seat, unsigned int tt
|
|||
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);
|
||||
EAPI void ecore_drm2_device_screen_size_range_get(Ecore_Drm2_Device *dev, int *minw, int *minh, int *maxw, int *maxh);
|
||||
|
||||
/* 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);
|
||||
|
||||
# endif
|
||||
|
|
|
@ -347,3 +347,26 @@ ecore_drm2_device_preferred_depth_get(Ecore_Drm2_Device *dev, int *depth, int *b
|
|||
if (bpp) *bpp = caps;
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
ecore_drm2_device_screen_size_range_get(Ecore_Drm2_Device *dev, int *minw, int *minh, int *maxw, int *maxh)
|
||||
{
|
||||
drmModeRes *res;
|
||||
|
||||
if (minw) *minw = 0;
|
||||
if (minh) *minh = 0;
|
||||
if (maxw) *maxw = 0;
|
||||
if (maxh) *maxh = 0;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN(dev);
|
||||
|
||||
res = sym_drmModeGetResources(dev->fd);
|
||||
if (!res) return;
|
||||
|
||||
if (minw) *minw = res->min_width;
|
||||
if (minh) *minh = res->min_height;
|
||||
if (maxw) *maxw = res->max_width;
|
||||
if (maxh) *maxh = res->max_height;
|
||||
|
||||
sym_drmModeFreeResources(res);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue