unsigned int enable_fake;
unsigned int started;
+ unsigned int stamp;
double last_time;
} tdm_client_wait_info;
static void
+_tdm_client_vblank_cb_stamp(void *data, struct wl_tdm_vblank *wl_tdm_vblank, uint32_t stamp)
+{
+ tdm_private_client_vblank *private_vblank = data;
+
+ TDM_RETURN_IF_FAIL(private_vblank != NULL);
+
+ private_vblank->stamp = stamp;
+}
+
+static void
_tdm_client_vblank_cb_done(void *data, struct wl_tdm_vblank *wl_tdm_vblank,
uint32_t req_id, uint32_t sequence, uint32_t tv_sec,
uint32_t tv_usec, uint32_t error)
}
static const struct wl_tdm_vblank_listener tdm_client_vblank_listener = {
+ _tdm_client_vblank_cb_stamp,
_tdm_client_vblank_cb_done,
};
tdm_client_vblank*
tdm_client_output_create_vblank(tdm_client_output *output, tdm_error *error)
{
+ tdm_private_client *private_client;
tdm_private_client_output *private_output;
tdm_private_client_vblank *private_vblank;
}
private_output = (tdm_private_client_output*)output;
+ private_client = private_output->private_client;
+
+ if (!private_client) {
+ TDM_ERR("'!private_client' failed");
+ if (error)
+ *error = TDM_ERROR_INVALID_PARAMETER;
+ return NULL;
+ }
private_vblank = calloc(1, sizeof *private_vblank);
if (!private_vblank) {
wl_tdm_vblank_add_listener(private_vblank->vblank,
&tdm_client_vblank_listener, private_vblank);
+ wl_display_roundtrip(private_client->display);
return (tdm_client_vblank*)private_vblank;
}
tdm_vblank_set_add_front(tdm_vblank *vblank, unsigned int add_front);
tdm_error
tdm_vblank_set_resource(tdm_vblank *vblank, struct wl_resource *resource);
+double
+tdm_vblank_get_stamp(tdm_vblank *vblank);
tdm_error
tdm_vblank_set_client_vblank_fps(unsigned int pid, const char *name, unsigned int fps);
void
struct wl_resource *resource;
tdm_vblank *vblank;
+ unsigned int stamp;
} tdm_server_vblank_info;
typedef struct _tdm_server_wait_info {
vblank_info->output_info = output_info;
vblank_info->resource = vblank_resource;
vblank_info->vblank = vblank;
+ vblank_info->stamp = (unsigned int)tdm_vblank_get_stamp(vblank);
tdm_vblank_set_resource(vblank, vblank_resource);
wl_resource_set_implementation(vblank_resource, &tdm_vblank_implementation,
vblank_info, destroy_vblank_callback);
+ wl_tdm_vblank_send_stamp(vblank_info->resource, vblank_info->stamp);
+
return;
}
return TDM_ERROR_NONE;
}
+INTERN double
+tdm_vblank_get_stamp(tdm_vblank *vblank)
+{
+ tdm_private_vblank *private_vblank = vblank;
+
+ TDM_RETURN_VAL_IF_FAIL(private_vblank != NULL, TDM_ERROR_INVALID_PARAMETER);
+
+ return private_vblank->stamp;
+}
+
INTERN void
tdm_vblank_get_vblank_list_information(tdm_display *dpy, char *reply, int *len)
{