#include <sys/syscall.h>
#include <sys/types.h>
#include <math.h>
+#include <grp.h>
+#include <wayland-server-protocol.h>
#include <tbm_bufmgr.h>
#include <tbm_surface_queue.h>
TDM_DUMP_FLAG_LAYER = (1 << 0),
TDM_DUMP_FLAG_PP = (1 << 1),
TDM_DUMP_FLAG_CAPTURE = (1 << 2),
+ TDM_DUMP_FLAG_WINDOW = (1 << 3),
};
#define TDM_DUMP_DIR "/tmp"
typedef struct _tdm_private_display tdm_private_display;
typedef struct _tdm_private_output tdm_private_output;
typedef struct _tdm_private_layer tdm_private_layer;
+typedef struct _tdm_private_hwc_window tdm_private_hwc_window;
typedef struct _tdm_private_pp tdm_private_pp;
typedef struct _tdm_private_capture tdm_private_capture;
typedef struct _tdm_private_loop tdm_private_loop;
tdm_func_display func_display;
tdm_func_output func_output;
tdm_func_layer func_layer;
+ tdm_func_hwc_window func_hwc_window;
tdm_func_pp func_pp;
tdm_func_capture func_capture;
int commit_per_vblank;
tdm_commit_type commit_type;
+ int hwc_enable;
+
int print_fps;
};
int regist_dpms_cb;
struct list_head layer_list;
+ struct list_head hwc_window_list;
struct list_head capture_list;
struct list_head vblank_handler_list;
struct list_head output_commit_handler_list;
tdm_caps_layer caps;
tdm_layer *layer_backend;
- tdm_private_layer_buffer *pending_buffer;
+ /* When a buffer is set to a layer, it will be stored to waiting_buffer.
+ * And when a layer is committed, it will be moved to committed_buffer.
+ * Finally when a commit handler is called, it will be moved to showing_buffer.
+ */
tdm_private_layer_buffer *waiting_buffer;
+ tdm_private_layer_buffer *committed_buffer; /* for output_commit */
tdm_private_layer_buffer *showing_buffer;
tbm_surface_queue_h buffer_queue;
unsigned int fps_count;
};
+struct _tdm_private_hwc_window {
+ struct list_head link;
+
+ int index;
+ uint32_t zpos;
+
+ tdm_private_display *private_display;
+ tdm_private_output *private_output;
+
+ tdm_hwc_window *hwc_window_backend;
+};
+
+
struct _tdm_private_pp {
struct list_head link;
tdm_private_layer *private_layer;
tdm_layer_commit_handler func;
void *user_data;
+
+ tdm_private_layer_buffer *committed_buffer; /* for layer_commit */
};
struct _tdm_private_change_handler {
tdm_error
tdm_output_wait_vblank_add_front(tdm_output *output, int interval, int sync,
tdm_output_vblank_handler func, void *user_data);
+tdm_error
+tdm_output_commit_internal(tdm_output *output, int sync, tdm_output_commit_handler func, void *user_data);
+tdm_error
+tdm_output_get_dpms_internal(tdm_output *output, tdm_output_dpms *dpms_value);
+
+void
+tdm_output_remove_vblank_handler_internal(tdm_output *output, tdm_output_vblank_handler func, void *user_data);
+void
+tdm_output_remove_commit_handler_internal(tdm_output *output, tdm_output_commit_handler func, void *user_data);
+void
+tdm_layer_remove_commit_handler_internal(tdm_layer *layer, tdm_layer_commit_handler func, void *user_data);
+
+void
+tdm_layer_committed(tdm_private_layer *private_layer, tdm_private_layer_buffer **committed_buffer);
void
tdm_pp_cb_done(tdm_pp *pp_backend, tbm_surface_h src, tbm_surface_h dst,
tdm_vblank_cb_vblank_SW(tdm_vblank *vblank, double vblank_stamp);
tdm_error
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);
+tdm_error
+tdm_vblank_set_client_vblank_fps(unsigned int pid, const char *name, unsigned int fps);
+void
+tdm_vblank_get_vblank_list_information(tdm_display *dpy, char *reply, int *len);
void
tdm_output_call_change_handler_internal(tdm_private_output *private_output,
void
tdm_pp_destroy_internal(tdm_private_pp *private_pp);
+tdm_hwc_window *
+tdm_hwc_window_create_internal(tdm_private_output *private_output, tdm_error *error);
+tdm_error
+tdm_hwc_window_destroy_internal(tdm_private_hwc_window * private_hwc_window);
+
tdm_private_capture *
tdm_capture_create_output_internal(tdm_private_output *private_output,
tdm_error *error);
tdm_event_loop_dispatch(tdm_private_display *private_display);
void
tdm_event_loop_flush(tdm_private_display *private_display);
+tdm_error
+tdm_event_loop_trace_enable(tdm_private_display *private_display, unsigned int enable);
typedef enum {
TDM_THREAD_CB_NONE,
tdm_server_init(tdm_private_loop *private_loop);
void
tdm_server_deinit(tdm_private_loop *private_loop);
-tdm_error
-tdm_server_set_client_vblank_fps(unsigned int pid, const char *name, unsigned int fps);
-void
-tdm_server_get_vblank_list_information(tdm_display *dpy, char *reply, int *len);
+const char*
+tdm_server_get_client_name(pid_t pid);
char *
tdm_helper_dump_make_directory(const char *path, char *reply, int *len);
extern int tdm_mutex_locked;
extern const char *tdm_mutex_lock_func;
extern int tdm_mutex_lock_line;
+extern const char *tdm_mutex_unlock_func;
+extern int tdm_mutex_unlock_line;
extern int tdm_dump_enable;
extern char *tdm_debug_dump_dir;
tdm_mutex_locked = 0; \
tdm_mutex_lock_func = NULL; \
tdm_mutex_lock_line = 0; \
+ tdm_mutex_unlock_func = __FUNCTION__; \
+ tdm_mutex_unlock_line = __LINE__; \
pthread_mutex_unlock(&tdm_mutex_check_lock); \
pthread_mutex_unlock(l); \
} while (0)
tdm_mutex_locked = 1; \
tdm_mutex_lock_func = __FUNCTION__; \
tdm_mutex_lock_line = __LINE__; \
+ tdm_mutex_unlock_func = NULL; \
+ tdm_mutex_unlock_line = 0; \
pthread_mutex_unlock(&tdm_mutex_check_lock); \
} \
} while (0)
tdm_mutex_locked = 1; \
tdm_mutex_lock_func = __FUNCTION__; \
tdm_mutex_lock_line = __LINE__; \
+ tdm_mutex_unlock_func = NULL; \
+ tdm_mutex_unlock_line = 0; \
pthread_mutex_unlock(&tdm_mutex_check_lock); \
} while (0)
#endif //TDM_CONFIG_MUTEX_TIMEOUT
void
tdm_monitor_server_command(tdm_display *dpy, const char *options, char *reply, int *len);
+
+
+#define TDM_WAYLAND_LOGGER ((WAYLAND_VERSION_MAJOR == 1) && (WAYLAND_VERSION_MINOR > 11))
+
+#if !TDM_WAYLAND_LOGGER
+#ifndef WL_CLOSURE_MAX_ARGS
+#define WL_CLOSURE_MAX_ARGS 20
+#endif
+
+struct wl_closure {
+ int count;
+ const struct wl_message *message;
+ uint32_t opcode;
+ uint32_t sender_id;
+ union wl_argument args[WL_CLOSURE_MAX_ARGS];
+ struct wl_list link;
+ struct wl_proxy *proxy;
+ struct wl_array extra[0];
+};
+#endif /* TDM_WAYLAND_LOGGER */
+
+struct argument_details {
+ char type;
+ int nullable;
+};
+
+
#ifdef __cplusplus
}
#endif