1) Add weston_randr definition and randr_backend intreface. 2) Export functions used in compositor.c so that module wrandr could use them. For example, weston_output_transform_scale_init. 3) Support new_mode backend interface in output structure.
Signed-off-by: Quanxian Wang <quanxian.w...@intel.com> --- src/compositor.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/compositor.h b/src/compositor.h index 22a485f..c728ffe 100644 --- a/src/compositor.h +++ b/src/compositor.h @@ -172,6 +172,17 @@ enum weston_mode_switch_op { WESTON_MODE_SWITCH_RESTORE_NATIVE }; +struct wrandr { + struct weston_compositor *compositor; + struct wl_global *global; + struct wl_resource *resource; + struct wl_listener destroy_listener; + struct { + struct wl_list request_list; + struct wl_list randr_callback_list; + } pending; +}; + struct weston_output { uint32_t id; char *name; @@ -218,6 +229,33 @@ struct weston_output { void (*destroy)(struct weston_output *output); void (*assign_planes)(struct weston_output *output); int (*switch_mode)(struct weston_output *output, struct weston_mode *mode); + struct weston_mode * (*new_timing)(struct weston_output *output, + uint32_t clock, + int hdisplay, + int hsync_start, + int hsync_end, + int htotal, + int vdisplay, + int vsync_start, + int vsync_end, + int vtotal, + int vscan, + uint32_t flags); + + int (*compare_timing)(struct weston_mode *mode, + uint32_t clock, + int hdisplay, + int hsync_start, + int hsync_end, + int htotal, + int vdisplay, + int vsync_start, + int vsync_end, + int vtotal, + int vscan, + uint32_t flags); + + struct weston_mode * (*new_mode)(int width, int height, int refresh); /* backlight values are on 0-255 range, where higher is brighter */ int32_t backlight_current; @@ -632,6 +670,7 @@ struct weston_compositor { /* Raw keyboard processing (no libxkbcommon initialization or handling) */ int use_xkbcommon; + struct wrandr *randr; }; struct weston_buffer { @@ -1356,6 +1395,10 @@ weston_surface_set_color(struct weston_surface *surface, void weston_surface_destroy(struct weston_surface *surface); +void +weston_output_transform_scale_init(struct weston_output *output, + uint32_t transform, uint32_t scale); + int weston_output_switch_mode(struct weston_output *output, struct weston_mode *mode, int32_t scale, enum weston_mode_switch_op op); -- 1.8.1.2 _______________________________________________ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel