*
* @param fb
* @param output
- * @param data
*
* @return The result of drmModePageFlip function call
*
* @ingroup Ecore_Drm2_Fb_Group
* @since 1.18
*/
-EAPI int ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output, void *data);
+EAPI int ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output);
/**
* Return the Ecore_Drm2_Fb's busy status
*/
EAPI void ecore_drm2_fb_busy_set(Ecore_Drm2_Fb *fb, Eina_Bool busy);
+/**
+ * Set the user data for the output's page flip handler
+ *
+ * @param output The output to update user data for
+ * @param data The new user data pointer
+ *
+ * @ingroup Ecore_Drm2_Output_Group
+ * @since 1.19
+ */
+EAPI void ecore_drm2_output_user_data_set(Ecore_Drm2_Output *o, void *data);
+
# endif
#endif
}
EAPI int
-ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output, void *data)
+ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output)
{
int ret = 0;
ret =
drmModePageFlip(fb->fd, output->crtc_id, fb->id,
- DRM_MODE_PAGE_FLIP_EVENT, data);
+ DRM_MODE_PAGE_FLIP_EVENT, output->user_data);
if (ret < 0)
{
DBG("Pageflip Failed for Crtc %u on Connector %u: %m",
return ret;
}
+
+EAPI void
+ecore_drm2_output_user_data_set(Ecore_Drm2_Output *o, void *data)
+{
+ o->user_data = data;
+}
Eina_List *planes;
+ void *user_data;
+
Eina_Bool connected : 1;
Eina_Bool primary : 1;
Eina_Bool cloned : 1;
if (next)
{
ecore_drm2_output_next_fb_set(ob->priv.output, NULL);
- ecore_drm2_fb_flip(next, ob->priv.output, ob);
+ ecore_drm2_fb_flip(next, ob->priv.output);
}
}
}
ecore_drm2_fb_dirty(ofb->fb, rects, count);
- if (ecore_drm2_fb_flip(ofb->fb, ob->priv.output, ob) == 0)
+ if (ecore_drm2_fb_flip(ofb->fb, ob->priv.output) == 0)
ob->priv.display = ofb;
ecore_drm2_fb_busy_set(ofb->fb, EINA_TRUE);
ob->ctx.vblank_handler = _cb_vblank;
ob->ctx.page_flip_handler = _cb_pageflip;
+ ecore_drm2_output_user_data_set(ob->priv.output, ob);
+
ob->hdlr =
ecore_main_fd_handler_add(ob->fd, ECORE_FD_READ, _cb_drm_event, ob,
NULL, NULL);
if (next)
{
ecore_drm2_output_next_fb_set(ob->priv.output, NULL);
- if (ecore_drm2_fb_flip(next, ob->priv.output, ob) < 0)
+ if (ecore_drm2_fb_flip(next, ob->priv.output) < 0)
_outbuf_tick_source_set(NULL);
}
}
if (fb)
{
ecore_drm2_fb_dirty(fb, rects, count);
- if (ecore_drm2_fb_flip(fb, ob->priv.output, ob) < 0)
+ if (ecore_drm2_fb_flip(fb, ob->priv.output) < 0)
_outbuf_tick_source_set(NULL);
/* Ecore_Drm2_Plane *plane; */
return NULL;
}
+ ecore_drm2_output_user_data_set(ob->priv.output, ob);
_outbuf_tick_source_set(ob);
return ob;