mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	Merge branch 'master' into display-destroy
This commit is contained in:
		
						commit
						c67a5824b8
					
				
					 25 changed files with 326 additions and 116 deletions
				
			
		| 
						 | 
				
			
			@ -93,6 +93,12 @@ void parse_edid(struct wlr_output *restrict output, size_t len, const uint8_t *d
 | 
			
		|||
	uint16_t id = (data[8] << 8) | data[9];
 | 
			
		||||
	snprintf(output->make, sizeof(output->make), "%s", get_manufacturer(id));
 | 
			
		||||
 | 
			
		||||
	uint16_t model = data[10] | (data[11] << 8);
 | 
			
		||||
	snprintf(output->model, sizeof(output->model), "0x%04X", model);
 | 
			
		||||
 | 
			
		||||
	uint32_t serial = data[12] | (data[13] << 8) | (data[14] << 8) | (data[15] << 8);
 | 
			
		||||
	snprintf(output->serial, sizeof(output->serial), "0x%08X", serial);
 | 
			
		||||
 | 
			
		||||
	output->phys_width = ((data[68] & 0xf0) << 4) | data[66];
 | 
			
		||||
	output->phys_height = ((data[68] & 0x0f) << 8) | data[67];
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -28,6 +28,15 @@ static struct wl_callback_listener frame_listener = {
 | 
			
		|||
	.done = surface_frame_callback
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static bool wlr_wl_output_set_custom_mode(struct wlr_output *_output,
 | 
			
		||||
		int32_t width, int32_t height, int32_t refresh) {
 | 
			
		||||
	struct wlr_wl_backend_output *output = (struct wlr_wl_backend_output *)_output;
 | 
			
		||||
	wl_egl_window_resize(output->egl_window, width, height, 0, 0);
 | 
			
		||||
	wlr_output_update_size(&output->wlr_output, width, height);
 | 
			
		||||
	wl_signal_emit(&output->wlr_output.events.resolution, output);
 | 
			
		||||
	return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void wlr_wl_output_make_current(struct wlr_output *_output) {
 | 
			
		||||
	struct wlr_wl_backend_output *output = (struct wlr_wl_backend_output *)_output;
 | 
			
		||||
	if (!eglMakeCurrent(output->backend->egl.display,
 | 
			
		||||
| 
						 | 
				
			
			@ -185,6 +194,7 @@ bool wlr_wl_output_move_cursor(struct wlr_output *_output, int x, int y) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
static struct wlr_output_impl output_impl = {
 | 
			
		||||
	.set_custom_mode = wlr_wl_output_set_custom_mode,
 | 
			
		||||
	.transform = wlr_wl_output_transform,
 | 
			
		||||
	.destroy = wlr_wl_output_destroy,
 | 
			
		||||
	.make_current = wlr_wl_output_make_current,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -204,8 +204,8 @@ static bool wlr_x11_backend_start(struct wlr_backend *backend) {
 | 
			
		|||
	snprintf(output->wlr_output.name, sizeof(output->wlr_output.name), "X11-1");
 | 
			
		||||
 | 
			
		||||
	output->win = xcb_generate_id(x11->xcb_conn);
 | 
			
		||||
	xcb_create_window(x11->xcb_conn, XCB_COPY_FROM_PARENT, output->win, x11->screen->root,
 | 
			
		||||
		0, 0, 1024, 768, 1, XCB_WINDOW_CLASS_INPUT_OUTPUT,
 | 
			
		||||
	xcb_create_window(x11->xcb_conn, XCB_COPY_FROM_PARENT, output->win,
 | 
			
		||||
		x11->screen->root, 0, 0, 1024, 768, 1, XCB_WINDOW_CLASS_INPUT_OUTPUT,
 | 
			
		||||
		x11->screen->root_visual, mask, values);
 | 
			
		||||
 | 
			
		||||
	output->surf = wlr_egl_create_surface(&x11->egl, &output->win);
 | 
			
		||||
| 
						 | 
				
			
			@ -340,6 +340,17 @@ error_x11:
 | 
			
		|||
	return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static bool output_set_custom_mode(struct wlr_output *wlr_output, int32_t width,
 | 
			
		||||
		int32_t height, int32_t refresh) {
 | 
			
		||||
	struct wlr_x11_output *output = (struct wlr_x11_output *)wlr_output;
 | 
			
		||||
	struct wlr_x11_backend *x11 = output->x11;
 | 
			
		||||
 | 
			
		||||
	const uint32_t values[] = { width, height };
 | 
			
		||||
	xcb_configure_window(x11->xcb_conn, output->win,
 | 
			
		||||
		XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, values);
 | 
			
		||||
	return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void output_transform(struct wlr_output *wlr_output, enum wl_output_transform transform) {
 | 
			
		||||
	struct wlr_x11_output *output = (struct wlr_x11_output *)wlr_output;
 | 
			
		||||
	output->wlr_output.transform = transform;
 | 
			
		||||
| 
						 | 
				
			
			@ -373,6 +384,7 @@ static void output_swap_buffers(struct wlr_output *wlr_output) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
static struct wlr_output_impl output_impl = {
 | 
			
		||||
	.set_custom_mode = output_set_custom_mode,
 | 
			
		||||
	.transform = output_transform,
 | 
			
		||||
	.destroy = output_destroy,
 | 
			
		||||
	.make_current = output_make_current,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue