Lines Matching +full:data +full:- +full:width
2 * Copyright © 2011-2014 Intel Corporation
20 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
27 #include <dix-config.h>
87 output_handle_geometry(void *data, struct wl_output *wl_output, int x, int y, in output_handle_geometry() argument
91 struct xwl_output *xwl_output = data; in output_handle_geometry()
93 RROutputSetPhysicalSize(xwl_output->randr_output, in output_handle_geometry()
95 RROutputSetSubpixelOrder(xwl_output->randr_output, in output_handle_geometry()
98 /* Apply the change from wl_output only if xdg-output is not supported */ in output_handle_geometry()
99 if (!xwl_output->xdg_output) { in output_handle_geometry()
100 xwl_output->x = x; in output_handle_geometry()
101 xwl_output->y = y; in output_handle_geometry()
103 xwl_output->rotation = wl_transform_to_xrandr(transform); in output_handle_geometry()
107 output_handle_mode(void *data, struct wl_output *wl_output, uint32_t flags, in output_handle_mode() argument
108 int width, int height, int refresh) in output_handle_mode() argument
110 struct xwl_output *xwl_output = data; in output_handle_mode()
115 /* Apply the change from wl_output only if xdg-output is not supported */ in output_handle_mode()
116 if (!xwl_output->xdg_output) { in output_handle_mode()
117 xwl_output->width = width; in output_handle_mode()
118 xwl_output->height = height; in output_handle_mode()
120 xwl_output->refresh = refresh; in output_handle_mode()
126 int *height, int *width) in output_get_new_size() argument
130 if (!need_rotate || (xwl_output->rotation & (RR_Rotate_0 | RR_Rotate_180))) { in output_get_new_size()
131 output_width = xwl_output->width; in output_get_new_size()
132 output_height = xwl_output->height; in output_get_new_size()
134 output_width = xwl_output->height; in output_get_new_size()
135 output_height = xwl_output->width; in output_get_new_size()
138 if (*width < xwl_output->x + output_width) in output_get_new_size()
139 *width = xwl_output->x + output_width; in output_get_new_size()
141 if (*height < xwl_output->y + output_height) in output_get_new_size()
142 *height = xwl_output->y + output_height; in output_get_new_size()
146 xwl_set_pixmap_visit_window(WindowPtr window, void *data) in xwl_set_pixmap_visit_window() argument
148 ScreenPtr screen = window->drawable.pScreen; in xwl_set_pixmap_visit_window()
150 if (screen->GetWindowPixmap(window) == data) { in xwl_set_pixmap_visit_window()
151 screen->SetWindowPixmap(window, screen->GetScreenPixmap(screen)); in xwl_set_pixmap_visit_window()
159 update_backing_pixmaps(struct xwl_screen *xwl_screen, int width, int height) in update_backing_pixmaps() argument
161 ScreenPtr pScreen = xwl_screen->screen; in update_backing_pixmaps()
162 WindowPtr pRoot = pScreen->root; in update_backing_pixmaps()
165 old_pixmap = pScreen->GetScreenPixmap(pScreen); in update_backing_pixmaps()
166 new_pixmap = pScreen->CreatePixmap(pScreen, width, height, in update_backing_pixmaps()
167 pScreen->rootDepth, in update_backing_pixmaps()
169 pScreen->SetScreenPixmap(new_pixmap); in update_backing_pixmaps()
173 pScreen->DestroyPixmap(old_pixmap); in update_backing_pixmaps()
176 pScreen->ResizeWindow(pRoot, 0, 0, width, height, NULL); in update_backing_pixmaps()
180 update_screen_size(struct xwl_output *xwl_output, int width, int height) in update_screen_size() argument
182 struct xwl_screen *xwl_screen = xwl_output->xwl_screen; in update_screen_size()
184 if (xwl_screen->root_clip_mode == ROOT_CLIP_FULL) in update_screen_size()
185 SetRootClip(xwl_screen->screen, ROOT_CLIP_NONE); in update_screen_size()
187 if (!xwl_screen->rootless && xwl_screen->screen->root) in update_screen_size()
188 update_backing_pixmaps (xwl_screen, width, height); in update_screen_size()
190 xwl_screen->width = width; in update_screen_size()
191 xwl_screen->height = height; in update_screen_size()
192 xwl_screen->screen->width = width; in update_screen_size()
193 xwl_screen->screen->height = height; in update_screen_size()
194 xwl_screen->screen->mmWidth = (width * 25.4) / monitorResolution; in update_screen_size()
195 xwl_screen->screen->mmHeight = (height * 25.4) / monitorResolution; in update_screen_size()
197 SetRootClip(xwl_screen->screen, xwl_screen->root_clip_mode); in update_screen_size()
199 if (xwl_screen->screen->root) { in update_screen_size()
200 BoxRec box = { 0, 0, width, height }; in update_screen_size()
202 xwl_screen->screen->root->drawable.width = width; in update_screen_size()
203 xwl_screen->screen->root->drawable.height = height; in update_screen_size()
204 RegionReset(&xwl_screen->screen->root->winSize, &box); in update_screen_size()
205 RRScreenSizeNotify(xwl_screen->screen); in update_screen_size()
214 struct xwl_screen *xwl_screen = xwl_output->xwl_screen; in apply_output_change()
217 int width = 0, height = 0, has_this_output = 0; in apply_output_change() local
222 xwl_output->wl_output_done = FALSE; in apply_output_change()
223 xwl_output->xdg_output_done = FALSE; in apply_output_change()
225 /* xdg-output sends output size in compositor space. so already rotated */ in apply_output_change()
226 need_rotate = (xwl_output->xdg_output == NULL); in apply_output_change()
229 if (need_rotate || xwl_output->rotation & (RR_Rotate_0 | RR_Rotate_180)) { in apply_output_change()
230 mode_width = xwl_output->width; in apply_output_change()
231 mode_height = xwl_output->height; in apply_output_change()
233 mode_width = xwl_output->height; in apply_output_change()
234 mode_height = xwl_output->width; in apply_output_change()
238 xwl_output->refresh / 1000.0, 0, 0); in apply_output_change()
239 RROutputSetModes(xwl_output->randr_output, &randr_mode, 1, 1); in apply_output_change()
240 RRCrtcNotify(xwl_output->randr_crtc, randr_mode, in apply_output_change()
241 xwl_output->x, xwl_output->y, in apply_output_change()
242 xwl_output->rotation, NULL, 1, &xwl_output->randr_output); in apply_output_change()
244 xorg_list_for_each_entry(it, &xwl_screen->output_list, link) { in apply_output_change()
252 output_get_new_size(it, need_rotate, &height, &width); in apply_output_change()
256 xorg_list_append(&xwl_output->link, &xwl_screen->output_list); in apply_output_change()
259 output_get_new_size(xwl_output, need_rotate, &height, &width); in apply_output_change()
261 --xwl_screen->expecting_event; in apply_output_change()
264 update_screen_size(xwl_output, width, height); in apply_output_change()
268 output_handle_done(void *data, struct wl_output *wl_output) in output_handle_done() argument
270 struct xwl_output *xwl_output = data; in output_handle_done()
272 xwl_output->wl_output_done = TRUE; in output_handle_done()
274 * or if xdg-output is not supported. in output_handle_done()
276 if (xwl_output->xdg_output_done || !xwl_output->xdg_output) in output_handle_done()
281 output_handle_scale(void *data, struct wl_output *wl_output, int32_t factor) in output_handle_scale() argument
293 xdg_output_handle_logical_position(void *data, struct zxdg_output_v1 *xdg_output, in xdg_output_handle_logical_position() argument
296 struct xwl_output *xwl_output = data; in xdg_output_handle_logical_position()
298 xwl_output->x = x; in xdg_output_handle_logical_position()
299 xwl_output->y = y; in xdg_output_handle_logical_position()
303 xdg_output_handle_logical_size(void *data, struct zxdg_output_v1 *xdg_output, in xdg_output_handle_logical_size() argument
304 int32_t width, int32_t height) in xdg_output_handle_logical_size() argument
306 struct xwl_output *xwl_output = data; in xdg_output_handle_logical_size()
308 xwl_output->width = width; in xdg_output_handle_logical_size()
309 xwl_output->height = height; in xdg_output_handle_logical_size()
313 xdg_output_handle_done(void *data, struct zxdg_output_v1 *xdg_output) in xdg_output_handle_done() argument
315 struct xwl_output *xwl_output = data; in xdg_output_handle_done()
317 xwl_output->xdg_output_done = TRUE; in xdg_output_handle_done()
318 if (xwl_output->wl_output_done) in xdg_output_handle_done()
341 xwl_output->output = wl_registry_bind(xwl_screen->registry, id, in xwl_output_create()
343 if (!xwl_output->output) { in xwl_output_create()
348 xwl_output->server_output_id = id; in xwl_output_create()
349 wl_output_add_listener(xwl_output->output, &output_listener, xwl_output); in xwl_output_create()
353 xwl_output->xwl_screen = xwl_screen; in xwl_output_create()
354 xwl_output->randr_crtc = RRCrtcCreate(xwl_screen->screen, xwl_output); in xwl_output_create()
355 if (!xwl_output->randr_crtc) { in xwl_output_create()
359 RRCrtcSetRotations (xwl_output->randr_crtc, ALL_ROTATIONS); in xwl_output_create()
361 xwl_output->randr_output = RROutputCreate(xwl_screen->screen, name, in xwl_output_create()
363 if (!xwl_output->randr_output) { in xwl_output_create()
368 RRCrtcGammaSetSize(xwl_output->randr_crtc, 256); in xwl_output_create()
369 RROutputSetCrtcs(xwl_output->randr_output, &xwl_output->randr_crtc, 1); in xwl_output_create()
370 RROutputSetConnection(xwl_output->randr_output, RR_Connected); in xwl_output_create()
373 * use it when binding to the xdg-output protocol... in xwl_output_create()
375 xorg_list_append(&xwl_output->link, &xwl_screen->output_list); in xwl_output_create()
376 --xwl_screen->expecting_event; in xwl_output_create()
378 if (xwl_screen->xdg_output_manager) in xwl_output_create()
384 if (xwl_output->randr_crtc) in xwl_output_create()
385 RRCrtcDestroy(xwl_output->randr_crtc); in xwl_output_create()
386 if (xwl_output->output) in xwl_output_create()
387 wl_output_destroy(xwl_output->output); in xwl_output_create()
395 wl_output_destroy(xwl_output->output); in xwl_output_destroy()
403 struct xwl_screen *xwl_screen = xwl_output->xwl_screen; in xwl_output_remove()
404 int width = 0, height = 0; in xwl_output_remove() local
405 Bool need_rotate = (xwl_output->xdg_output == NULL); in xwl_output_remove()
407 xorg_list_del(&xwl_output->link); in xwl_output_remove()
409 xorg_list_for_each_entry(it, &xwl_screen->output_list, link) in xwl_output_remove()
410 output_get_new_size(it, need_rotate, &height, &width); in xwl_output_remove()
411 update_screen_size(xwl_output, width, height); in xwl_output_remove()
413 RRCrtcDestroy(xwl_output->randr_crtc); in xwl_output_remove()
414 RROutputDestroy(xwl_output->randr_output); in xwl_output_remove()
439 if (!RRScreenInit(xwl_screen->screen)) in xwl_screen_init_output()
442 RRScreenSetSizeRange(xwl_screen->screen, 16, 16, 32767, 32767); in xwl_screen_init_output()
444 rp = rrGetScrPriv(xwl_screen->screen); in xwl_screen_init_output()
445 rp->rrGetInfo = xwl_randr_get_info; in xwl_screen_init_output()
446 rp->rrSetConfig = xwl_randr_set_config; in xwl_screen_init_output()
454 struct xwl_screen *xwl_screen = xwl_output->xwl_screen; in xwl_output_get_xdg_output()
456 xwl_output->xdg_output = in xwl_output_get_xdg_output()
457 zxdg_output_manager_v1_get_xdg_output (xwl_screen->xdg_output_manager, in xwl_output_get_xdg_output()
458 xwl_output->output); in xwl_output_get_xdg_output()
460 zxdg_output_v1_add_listener(xwl_output->xdg_output, in xwl_output_get_xdg_output()
470 assert(xwl_screen->xdg_output_manager); in xwl_screen_init_xdg_output()
472 xorg_list_for_each_entry(it, &xwl_screen->output_list, link) in xwl_screen_init_xdg_output()