libweston: export weston_linux_sync_file_read_timestamp()

This is an internal export for GL-renderer, so that it does not need to build
linux-sync-file.c a second time. This follows the example of
linux-explicit-synchronization.c which is also used by GL-renderer.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
dev
Pekka Paalanen 6 years ago
parent 4e952328ca
commit 4b5727375c
  1. 3
      libweston/gl-renderer.c
  2. 5
      libweston/linux-sync-file.c
  3. 2
      libweston/linux-sync-file.h
  4. 1
      libweston/meson.build

@ -339,7 +339,8 @@ timeline_render_point_handler(int fd, uint32_t mask, void *data)
if (mask & WL_EVENT_READABLE) { if (mask & WL_EVENT_READABLE) {
struct timespec tspec = { 0 }; struct timespec tspec = { 0 };
if (linux_sync_file_read_timestamp(trp->fd, &tspec) == 0) { if (weston_linux_sync_file_read_timestamp(trp->fd,
&tspec) == 0) {
TL_POINT(tp_name, TLP_GPU(&tspec), TL_POINT(tp_name, TLP_GPU(&tspec),
TLP_OUTPUT(trp->output), TLP_END); TLP_OUTPUT(trp->output), TLP_END);
} }

@ -30,6 +30,7 @@
#include <poll.h> #include <poll.h>
#include <stddef.h> #include <stddef.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <wayland-server-core.h>
#ifdef HAVE_LINUX_SYNC_FILE_H #ifdef HAVE_LINUX_SYNC_FILE_H
#include <linux/sync_file.h> #include <linux/sync_file.h>
@ -62,8 +63,8 @@ linux_sync_file_is_valid(int fd)
* \param ts[out] the timespec struct to fill with the timestamp * \param ts[out] the timespec struct to fill with the timestamp
* \return 0 if a timestamp was read, -1 on error * \return 0 if a timestamp was read, -1 on error
*/ */
int WL_EXPORT int
linux_sync_file_read_timestamp(int fd, struct timespec *ts) weston_linux_sync_file_read_timestamp(int fd, struct timespec *ts)
{ {
struct sync_file_info file_info = { { 0 } }; struct sync_file_info file_info = { { 0 } };
struct sync_fence_info fence_info = { { 0 } }; struct sync_fence_info fence_info = { { 0 } };

@ -33,6 +33,6 @@ bool
linux_sync_file_is_valid(int fd); linux_sync_file_is_valid(int fd);
int int
linux_sync_file_read_timestamp(int fd, struct timespec *ts); weston_linux_sync_file_read_timestamp(int fd, struct timespec *ts);
#endif /* WESTON_LINUX_SYNC_FILE_H */ #endif /* WESTON_LINUX_SYNC_FILE_H */

@ -443,7 +443,6 @@ if get_option('renderer-gl')
srcs_renderer_gl = [ srcs_renderer_gl = [
'gl-renderer.c', 'gl-renderer.c',
'linux-sync-file.c',
'../shared/matrix.c', '../shared/matrix.c',
linux_dmabuf_unstable_v1_protocol_c, linux_dmabuf_unstable_v1_protocol_c,
linux_dmabuf_unstable_v1_server_protocol_h, linux_dmabuf_unstable_v1_server_protocol_h,

Loading…
Cancel
Save