Lines Matching full:output
4 Subject: [PATCH 19/95] backend-drm: Support controlling output dynamically
6 Use config file to set output's rotate/down-scale/size/pos/mode/off/
7 freeze/input/display-rectangle and prefer/primary output.
12 Supported configs format is "output:<output name>:<config>", for
14 echo "output:DSI-1:off" >> /tmp/.weston_drm.conf
15 echo "output:eDP-1:freeze" >> /tmp/.weston_drm.conf
16 echo "output:all:rotate90" >> /tmp/.weston_drm.conf
17 echo "output:all:rect=<100,20,1636,2068>" >> /tmp/.weston_drm.conf
18 echo "output:HDMI-A-1:mode=800x600" >> /tmp/.weston_drm.conf
19 echo "output:HDMI-A-1:pos=100,200" >> /tmp/.weston_drm.conf
20 echo "output:HDMI-A-1:size=1920x1080" >> /tmp/.weston_drm.conf
21 echo "output:HDMI-A-1:prefer" >> /tmp/.weston_drm.conf
22 echo "output:HDMI-A-1:primary" >> /tmp/.weston_drm.conf
23 echo "output:HDMI-A-1:down-scale=0.5" >> /tmp/.weston_drm.conf
24 echo "output:HDMI-A-1:input=*" >> /tmp/.weston_drm.conf
25 echo "output:HDMI-A-1:input=" >> /tmp/.weston_drm.conf
26 echo "output:HDMI-A-1:input=event6" >> /tmp/.weston_drm.conf
27 echo "output:HDMI-A-1:input=goodix*" >> /tmp/.weston_drm.conf
28 echo "output:HDMI-A-1:input=goodix-ts" >> /tmp/.weston_drm.conf
48 @@ -2080,6 +2080,20 @@ drm_backend_output_configure(struct weston_output *output,
54 + if (sscanf(s, "%d,%d", &output->x, &output->y) == 2)
55 + output->fixed_position = true;
61 + if (sscanf(s, "%dx%d", &output->width, &output->height) == 2)
62 + output->fixed_size = true;
66 if (api->set_mode(output, mode, modeline) < 0) {
67 weston_log("Cannot configure an output using weston_drm_output_api.\n");
77 - struct weston_output *output, *target_output = NULL;
78 + struct weston_output *output, *target_output = NULL, *prefer_output = NULL;
86 - wl_list_for_each(output, &compositor->output_list, link) {
87 + wl_list_for_each_reverse(output, &compositor->output_list, link) {
88 if (output->unavailable)
91 - if (pixman_region32_contains_point(&output->region, ix, iy, NULL)) {
92 + if (output == compositor->prefer_output)
93 + prefer_output = output;
95 + if (pixman_region32_contains_point(&output->region, ix, iy, NULL))
96 target_output = output;
108 output->height);
115 + struct weston_output *output = data;
123 + if (view->output != output)
132 + set_fullscreen(shsurf, true, output);
150 struct weston_output *output = (struct weston_output *)data;
151 struct shell_output *sh_output = find_shell_output_from_weston_output(shell, output);
156 shell_resize_surface_to_output(shell, sh_output->background_surface, output);
157 shell_resize_surface_to_output(shell, sh_output->panel_surface, output);
165 x = view->geometry.x + output->move_x;
166 y = view->geometry.y + output->move_y;
169 + if (pixman_region32_contains_point(&output->region, x, y, NULL))
235 drm_output_print_modes(struct drm_output *output);
239 + struct drm_output *output,
268 @@ -510,6 +513,12 @@ drm_output_update_complete(struct drm_output *output, uint32_t flags,
273 + weston_output_finish_frame(&output->base, NULL,
287 + if (output->base.down_scale != 1.0f && b->use_pixman) {
289 + output->base.down_scale = 1.0f;
292 + sw = fb->width * output->base.down_scale;
293 + sh = fb->height * output->base.down_scale;
295 dx = output->plane_bounds.x1;
296 dy = output->plane_bounds.y1;
303 + now_ms < output->last_resize_ms + b->resize_freeze_ms) {
325 /* Determine the type of vblank synchronization to use for the output.
327 output->base.switch_mode = drm_output_switch_mode;
328 output->base.set_gamma = drm_output_set_gamma;
330 + output->original_transform = output->base.transform;
332 output->state_invalid = true;
334 weston_log("Output %s (crtc %d) video modes:\n",
359 +drm_output_rotate(struct drm_output *output, int rotate)
361 + struct drm_backend *b = to_drm_backend(output->base.compositor);
362 + uint32_t transform = output->original_transform;
368 + if (output->base.transform == transform)
371 + /* Freeze output when rotating */
373 + output->last_resize_ms = timespec_to_msec(&now);
375 + weston_output_set_transform(&output->base, transform);
379 +drm_output_modeset(struct drm_output *output, const char *modeline)
381 + struct drm_backend *b = to_drm_backend(output->base.compositor);
383 + to_drm_head(weston_output_get_first_head(&output->base));
388 + if (output->page_flip_pending || output->atomic_complete_pending) {
393 + mode = drm_output_choose_initial_mode(b->drm, output,
398 + weston_output_mode_set_native(&output->base, &mode->base,
399 + output->base.current_scale);
400 + weston_output_damage(&output->base);
402 + mode = to_drm_mode(output->base.current_mode);
404 + weston_log("Output %s changed to %dx%d@%d for mode(%s)\n",
405 + output->base.name,
415 +drm_output_set_size(struct drm_output *output, const int w, const int h)
417 + struct drm_backend *b = to_drm_backend(output->base.compositor);
421 + if (output->base.fixed_size &&
422 + output->base.current_mode->width == w &&
423 + output->base.current_mode->height == h)
426 + wl_list_for_each(mode, &output->base.mode_list, link) {
431 + output->base.fixed_size = true;
433 + /* Freeze output when resizing */
435 + output->last_resize_ms = timespec_to_msec(&now);
437 + weston_output_set_transform(&output->base, output->base.transform);
440 + drm_output_fini_pixman(output);
441 + if (drm_output_init_pixman(output, b) < 0)
442 + weston_log("failed to init output pixman state with "
445 + drm_output_fini_egl(output);
446 + if (drm_output_init_egl(output, b) < 0)
447 + weston_log("failed to init output egl state with "
451 + drm_output_print_modes(output);
458 + struct drm_output *output;
461 + wl_list_for_each(output, &b->compositor->output_list, base.link) {
462 + if (!is_all && strcmp(name, output->base.name))
469 + b->compositor->prefer_output = &output->base;
472 + drm_output_rotate(output, rotate);
474 + drm_output_modeset(output, config + strlen("mode="));
476 + output->base.freezing = true;
478 + output->base.freezing = true;
479 + if (!output->virtual)
480 + drm_set_dpms(&output->base, WESTON_DPMS_OFF);
483 + if (!output->base.freezing)
486 + output->base.freezing = false;
488 + if (!output->virtual)
489 + drm_set_dpms(&output->base, WESTON_DPMS_ON);
491 + weston_output_damage(&output->base);
496 + if (down_scale == output->base.down_scale ||
500 + output->base.down_scale = down_scale;
501 + weston_output_damage(&output->base);
508 + drm_output_set_size(output, w, h);
515 + weston_output_move(&output->base, x, y);
516 + output->base.fixed_position = true;
527 + output->plane_bounds.x1 = x1;
528 + output->plane_bounds.y1 = y1;
529 + output->plane_bounds.x2 = x2;
530 + output->plane_bounds.y2 = y2;
531 + weston_output_schedule_repaint(&output->base);
533 + weston_output_bind_input(&output->base,
570 + * For example: "output:all:rotate90"
576 + if (!strcmp(type, "output"))
605 @@ -405,15 +405,19 @@ drm_output_add_mode(struct drm_output *output, const drmModeModeInfo *info)
614 + if (output->base.fixed_size) {
615 + mode->base.width = output->base.width;
616 + mode->base.height = output->base.height;
631 * @param current_mode Mode currently being displayed on this output
632 * @returns A mode from the output's mode list, or NULL if none available
637 struct drm_output *output,
642 wl_list_for_each_reverse(drm_mode, &output->base.mode_list, base.link) {
654 @@ -3372,6 +3372,11 @@ weston_output_repaint(struct weston_output *output)
656 weston_output_schedule_repaint_reset(struct weston_output *output)
658 + if (output->idle_repaint_source) {
659 + wl_event_source_remove(output->idle_repaint_source);
660 + output->idle_repaint_source = NULL;
663 output->repaint_status = REPAINT_NOT_SCHEDULED;
664 TL_POINT(output->compositor, "core_repaint_exit_loop",
665 TLP_OUTPUT(output), TLP_END);
666 @@ -3384,6 +3389,11 @@ weston_output_maybe_repaint(struct weston_output *output, struct timespec *n…
672 + if (output->freezing)
676 if (output->repaint_status != REPAINT_SCHEDULED)
678 @@ -3410,11 +3420,11 @@ weston_output_maybe_repaint(struct weston_output *output, struct timespec *…
679 * output. */
680 ret = weston_output_repaint(output);
686 - output->repainted = true;
688 + output->repainted = !ret;
692 weston_output_schedule_repaint_reset(output);
695 struct weston_output *output;
703 ret = weston_output_maybe_repaint(output, &now);
707 + repainted |= output->repainted;
716 wl_list_for_each(head, &output->head_list, output_link)
719 - if (!weston_output_valid(output))
720 + if (!weston_output_valid(output) || output->fixed_position)
724 @@ -7050,6 +7062,9 @@ weston_output_set_transform(struct weston_output *output,
726 weston_compositor_reflow_outputs(output->compositor);
728 + wl_signal_emit(&output->compositor->output_resized_signal,
729 + output);
731 /* Notify clients of the change for output transform. */
732 wl_list_for_each(head, &output->head_list, output_link) {
734 @@ -7288,6 +7303,8 @@ weston_output_init(struct weston_output *output,
736 output->transform = UINT32_MAX;
738 + output->down_scale = 1.0f;
740 pixman_region32_init(&output->damage);
741 pixman_region32_init(&output->region);
742 wl_list_init(&output->mode_list);
743 @@ -7420,7 +7437,6 @@ weston_output_enable(struct weston_output *output)
744 weston_output_transform_scale_init(output, output->transform, output->scale);
746 weston_output_init_geometry(output, output->x, output->y);
747 - weston_output_damage(output);
749 wl_list_init(&output->animation_list);
750 wl_list_init(&output->feedback_list);
761 +weston_output_bind_input(struct weston_output *output, const char *match)
763 + struct weston_compositor *compositor = output->compositor;
779 + strcmp(device->output_name, output->name))
795 + device->output_name = strdup(output->name);
806 @@ -193,6 +193,9 @@ weston_output_disable_planes_incr(struct weston_output *output);
808 weston_output_disable_planes_decr(struct weston_output *output);
811 +weston_output_bind_input(struct weston_output *output, const char *name);
820 @@ -1685,6 +1685,10 @@ gl_renderer_repaint_output(struct weston_output *output,
823 go->output_matrix = output->matrix;
826 + output->down_scale, output->down_scale, 1);
829 -(output->current_mode->width / 2.0),
830 -(output->current_mode->height / 2.0), 0);