void *data;
};
+struct _Ecore_Drm_Event_Output
+{
+ int x, y;
+ int w, h;
+ int phys_width, phys_height;
+ unsigned int refresh;
+ int subpixel_order;
+ int transform;
+ const char *make;
+ const char *model;
+ Eina_Bool plug : 1;
+};
+
/* opaque structure to represent a drm device */
typedef struct _Ecore_Drm_Device Ecore_Drm_Device;
/* sturcture to inform drm vblank */
typedef struct _Ecore_Drm_Event_Vblank Ecore_Drm_Event_Vblank;
+/* structure to inform drm output plug events */
+/** @since 1.14 */
+typedef struct _Ecore_Drm_Event_Output Ecore_Drm_Event_Output;
+
EAPI extern int ECORE_DRM_EVENT_ACTIVATE;
EAPI extern int ECORE_DRM_EVENT_PAGE_FLIP;
EAPI extern int ECORE_DRM_EVENT_VBLANK;
+EAPI extern int ECORE_DRM_EVENT_OUTPUT; /**< @since 1.14 */
+
/**
* @file
* @brief Ecore functions for dealing with drm, virtual terminals
ECORE_DRM_EVENT_ACTIVATE = ecore_event_type_new();
ECORE_DRM_EVENT_PAGE_FLIP = ecore_event_type_new();
ECORE_DRM_EVENT_VBLANK = ecore_event_type_new();
+ ECORE_DRM_EVENT_OUTPUT = ecore_event_type_new();
/* return init count */
return _ecore_drm_init_count;
"DP", "HDMI", "HDMI", "TV", "eDP",
};
+EAPI int ECORE_DRM_EVENT_OUTPUT = 0;
+
/* local functions */
static Eina_Bool
output->backlight =
_ecore_drm_output_backlight_init(output, conn->connector_type);
+ _ecore_drm_event_output_send(output, EINA_TRUE);
+
return output;
mode_err:
_ecore_drm_update_outputs(output);
}
+static void
+_ecore_drm_event_output_free(void *data EINA_UNUSED, void *event)
+{
+ Ecore_Drm_Event_Output *e = event;
+
+ eina_stringshare_del(e->make);
+ eina_stringshare_del(e->model);
+ free(event);
+}
+
+void
+_ecore_drm_event_output_send(const Ecore_Drm_Output *output, Eina_Bool plug)
+{
+ Ecore_Drm_Event_Output *e;
+
+ if (!(e = calloc(1, sizeof(Ecore_Drm_Event_Output)))) return;
+ e->plug = plug;
+ if (plug)
+ {
+ e->w = output->current_mode->width;
+ e->h = output->current_mode->height;
+ e->x = output->x;
+ e->y = output->y;
+ e->phys_width = 0;
+ e->phys_height = 0;
+ e->refresh = output->current_mode->refresh;
+ e->subpixel_order = output->subpixel;
+ e->make = eina_stringshare_ref(output->make);
+ e->model = eina_stringshare_ref(output->model);
+ e->transform = 0;
+ }
+ ecore_event_add(ECORE_DRM_EVENT_OUTPUT, e,
+ _ecore_drm_event_output_free, NULL);
+}
+
/* public functions */
/**
typedef void (*Ecore_Drm_Open_Cb)(void *data, int fd, Eina_Bool b);
void _ecore_drm_event_activate_send(Eina_Bool active);
+void _ecore_drm_event_output_send(const Ecore_Drm_Output *output, Eina_Bool plug);
Eina_Bool _ecore_drm_launcher_device_open(const char *device, Ecore_Drm_Open_Cb callback, void *data, int flags);
int _ecore_drm_launcher_device_open_no_pending(const char *device, int flags);