* which includes creating dumb buffers to render into
*
* @param dev The Ecore_Drm_Device to setup for software rendering
+ *
* @return EINA_TRUE on success, EINA_FALSE on failure
*
* @ingroup Ecore_Drm_Device_Group
EAPI Eina_Bool ecore_drm_device_software_setup(Ecore_Drm_Device *dev);
/**
+ * Find an Ecore_Drm_Output at the given coordinates
+ *
+ * This function will loop all the existing outputs in Ecore_Drm_Device and
+ * return an output if one exists that encapsulates the given coordinates.
+ *
+ * @param dev The Ecore_Drm_Device to search
+ * @param x The x coordinate
+ * @param y The y coordinate
+ *
+ * @return An Ecore_Drm_Output if one exists at these coordinates or NULL
+ *
+ * @ingroup Ecore_Drm_Device_Group
+ * @since 1.15
+ */
+EAPI Ecore_Drm_Output *ecore_drm_device_output_find(Ecore_Drm_Device *dev, int x, int y);
+
+/**
* Open a tty for use
*
* @param dev The Ecore_Drm_Device that this tty will belong to.
#include "ecore_drm_private.h"
#include <dlfcn.h>
+#define INSIDE(x, y, xx, yy, ww, hh) \
+ (((x) < ((xx) + (ww))) && ((y) < ((yy) + (hh))) && \
+ ((x) >= (xx)) && ((y) >= (yy)))
+
static Eina_List *drm_devices;
static void
}
return EINA_FALSE;
}
+
+EAPI Ecore_Drm_Output *
+ecore_drm_device_output_find(Ecore_Drm_Device *dev, int x, int y)
+{
+ Ecore_Drm_Output *output;
+ Eina_List *l;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(dev, NULL);
+
+ EINA_LIST_FOREACH(dev->outputs, l, output)
+ {
+ int ox = 0, oy = 0;
+ int ow = 0, oh = 0;
+
+ if (!output->cloned)
+ {
+ ox = output->x;
+ oy = output->y;
+ }
+
+ ow = output->current_mode->width;
+ oh = output->current_mode->height;
+
+ if (INSIDE(x, y, ox, oy, ow, oh))
+ return output;
+ }
+
+ return NULL;
+}