summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-06-13 20:49:16 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-06-13 22:56:40 +0100
commit18c522fb2475920e7aa028253c8df794cd44fa20 (patch)
treea587d6bcd80536e57ba14c4f195f1810741595ec /src
parentb519c44c6716518f750984f7ff0540173fccbc00 (diff)
Revert "e randr - x - only apply/modify randr if xurrent config not the same"
This reverts commit cf0a43b844b15444bc8e3b0be92ec76dd11c3614. This seems to cause some issues on restore at startup.
Diffstat (limited to 'src')
-rw-r--r--src/bin/e_comp.h2
-rw-r--r--src/bin/e_comp_x_randr.c91
-rw-r--r--src/bin/e_comp_x_randr.h2
-rw-r--r--src/bin/e_randr2.c10
-rw-r--r--src/modules/wl_drm/e_mod_main.c2
5 files changed, 25 insertions, 82 deletions
diff --git a/src/bin/e_comp.h b/src/bin/e_comp.h
index e07022b84..ec8b80ea0 100644
--- a/src/bin/e_comp.h
+++ b/src/bin/e_comp.h
@@ -68,7 +68,7 @@ typedef struct E_Comp_Screen_Iface
68 /* gather screen info */ 68 /* gather screen info */
69 E_Randr2 *(*create)(void); 69 E_Randr2 *(*create)(void);
70 /* apply current config */ 70 /* apply current config */
71 void (*apply)(Eina_Bool can_skip); 71 void (*apply)(void);
72 /* set dpms (on, standby, suspend, off) */ 72 /* set dpms (on, standby, suspend, off) */
73 void (*dpms)(int); 73 void (*dpms)(int);
74 /* is key event eaten */ 74 /* is key event eaten */
diff --git a/src/bin/e_comp_x_randr.c b/src/bin/e_comp_x_randr.c
index 3b02af87b..da1b0759d 100644
--- a/src/bin/e_comp_x_randr.c
+++ b/src/bin/e_comp_x_randr.c
@@ -478,7 +478,7 @@ e_comp_x_randr_shutdown(void)
478} 478}
479 479
480E_API void 480E_API void
481e_comp_x_randr_config_apply(Eina_Bool can_skip) 481e_comp_x_randr_config_apply(void)
482{ 482{
483 Eina_List *l; 483 Eina_List *l;
484 E_Randr2_Screen *s; 484 E_Randr2_Screen *s;
@@ -580,13 +580,11 @@ e_comp_x_randr_config_apply(Eina_Bool can_skip)
580 { 580 {
581 Ecore_X_Rectangle *scrs = alloca(crtcs_num * sizeof(Ecore_X_Rectangle)); 581 Ecore_X_Rectangle *scrs = alloca(crtcs_num * sizeof(Ecore_X_Rectangle));
582 int scrs_num; 582 int scrs_num;
583 Eina_Bool do_it;
584 583
585 scrs_num = 0; 584 scrs_num = 0;
586 // set up a crtc to drive each output (or not) 585 // set up a crtc to drive each output (or not)
587 for (i = 0; i < crtcs_num; i++) 586 for (i = 0; i < crtcs_num; i++)
588 { 587 {
589 do_it = EINA_FALSE;
590 // XXX: find clones and set them as outputs in an array 588 // XXX: find clones and set them as outputs in an array
591 if (outconf[i]) 589 if (outconf[i])
592 { 590 {
@@ -610,6 +608,12 @@ e_comp_x_randr_config_apply(Eina_Bool can_skip)
610 screenconf[i]->config.geom.w, 608 screenconf[i]->config.geom.w,
611 screenconf[i]->config.geom.h, 609 screenconf[i]->config.geom.h,
612 orient, mode, outconf[i]); 610 orient, mode, outconf[i]);
611 if (!ecore_x_randr_crtc_settings_set
612 (root, crtcs[i], &(outconf[i]), 1,
613 screenconf[i]->config.geom.x,
614 screenconf[i]->config.geom.y,
615 mode, orient))
616 printf("RRR: failed to set crtc!!!!!!\n");
613 if (E_INSIDE(px, py, 617 if (E_INSIDE(px, py,
614 screenconf[i]->config.geom.x, 618 screenconf[i]->config.geom.x,
615 screenconf[i]->config.geom.y, 619 screenconf[i]->config.geom.y,
@@ -620,54 +624,12 @@ e_comp_x_randr_config_apply(Eina_Bool can_skip)
620 (screenconf[i]->config.geom.w / 2); 624 (screenconf[i]->config.geom.w / 2);
621 py = screenconf[i]->config.geom.y + 625 py = screenconf[i]->config.geom.y +
622 (screenconf[i]->config.geom.h / 2); 626 (screenconf[i]->config.geom.h / 2);
623 if (!can_skip) do_it = EINA_TRUE; 627 ecore_x_randr_crtc_panning_area_set
624 else 628 (root, crtcs[i],
625 { 629 screenconf[i]->config.geom.x,
626 Ecore_X_Randr_Crtc_Info *inf; 630 screenconf[i]->config.geom.y,
627 631 screenconf[i]->config.geom.w,
628 inf = ecore_x_randr_crtc_info_get(root, crtcs[i]); 632 screenconf[i]->config.geom.h);
629 if (inf)
630 {
631 // current setup differs
632 if ((inf->noutput == 0) ||
633 (inf->mode != mode) ||
634 (inf->x != screenconf[i]->config.geom.x) ||
635 (inf->y != screenconf[i]->config.geom.y) ||
636 (inf->width != (unsigned int)screenconf[i]->config.geom.w) ||
637 (inf->height != (unsigned int)screenconf[i]->config.geom.h) ||
638 (inf->rotation != orient))
639 {
640 if (inf->noutput != 1)
641 do_it = EINA_TRUE;
642 else
643 {
644 if (inf->outputs[0] != outconf[0])
645 do_it = EINA_TRUE;
646 }
647 }
648 ecore_x_randr_crtc_info_free(inf);
649 }
650 else do_it = EINA_TRUE;
651 }
652 if (do_it)
653 {
654 printf("RRR: crtc configure: %i ...\n", i);
655 if (!ecore_x_randr_crtc_settings_set
656 (root, crtcs[i], &(outconf[i]), 1,
657 screenconf[i]->config.geom.x,
658 screenconf[i]->config.geom.y,
659 mode, orient))
660 printf("RRR: failed to set crtc!!!!!!\n");
661 ecore_x_randr_crtc_panning_area_set
662 (root, crtcs[i],
663 screenconf[i]->config.geom.x,
664 screenconf[i]->config.geom.y,
665 screenconf[i]->config.geom.w,
666 screenconf[i]->config.geom.h);
667 }
668 else
669 printf("RRR: (SKIP) crtc configure: %i\n", i);
670
671 if (screenconf[i]->config.priority == top_priority) 633 if (screenconf[i]->config.priority == top_priority)
672 { 634 {
673 ecore_x_randr_primary_output_set(root, outconf[i]); 635 ecore_x_randr_primary_output_set(root, outconf[i]);
@@ -681,29 +643,10 @@ e_comp_x_randr_config_apply(Eina_Bool can_skip)
681 } 643 }
682 else 644 else
683 { 645 {
684 if (!can_skip) do_it = EINA_TRUE; 646 printf("RRR: crtc off: %i\n", i);
685 else 647 ecore_x_randr_crtc_settings_set
686 { 648 (root, crtcs[i], NULL, 0, 0, 0, 0,
687 Ecore_X_Randr_Crtc_Info *inf; 649 ECORE_X_RANDR_ORIENTATION_ROT_0);
688
689 inf = ecore_x_randr_crtc_info_get(root, crtcs[i]);
690 if (inf)
691 {
692 // it's somehow on - we need to turn it off
693 if (inf->noutput != 0) do_it = EINA_TRUE;
694 ecore_x_randr_crtc_info_free(inf);
695 }
696 // else -> already nort enabled
697 }
698 if (do_it)
699 {
700 printf("RRR: crtc off: %i\n", i);
701 ecore_x_randr_crtc_settings_set
702 (root, crtcs[i], NULL, 0, 0, 0, 0,
703 ECORE_X_RANDR_ORIENTATION_ROT_0);
704 }
705 else
706 printf("RRR: (SKIP) crtc off: %i\n", i);
707 } 650 }
708 } 651 }
709 ecore_x_root_screen_barriers_set(scrs, scrs_num); 652 ecore_x_root_screen_barriers_set(scrs, scrs_num);
diff --git a/src/bin/e_comp_x_randr.h b/src/bin/e_comp_x_randr.h
index db18a1264..41ca659a6 100644
--- a/src/bin/e_comp_x_randr.h
+++ b/src/bin/e_comp_x_randr.h
@@ -3,7 +3,7 @@
3 3
4E_API void e_comp_x_randr_init(void); 4E_API void e_comp_x_randr_init(void);
5E_API void e_comp_x_randr_shutdown(void); 5E_API void e_comp_x_randr_shutdown(void);
6E_API void e_comp_x_randr_config_apply(Eina_Bool can_ckip); 6E_API void e_comp_x_randr_config_apply(void);
7E_API Eina_Bool e_comp_x_randr_available(void); 7E_API Eina_Bool e_comp_x_randr_available(void);
8E_API E_Randr2 *e_comp_x_randr_create(void); 8E_API E_Randr2 *e_comp_x_randr_create(void);
9 9
diff --git a/src/bin/e_randr2.c b/src/bin/e_randr2.c
index 474708a5e..9b8f38357 100644
--- a/src/bin/e_randr2.c
+++ b/src/bin/e_randr2.c
@@ -9,7 +9,7 @@ static void _cb_delay_init_save(void *data);
9static Eina_Bool _cb_delay_timer(void *data); 9static Eina_Bool _cb_delay_timer(void *data);
10static Eina_Bool _cb_fade_animator(void *data); 10static Eina_Bool _cb_fade_animator(void *data);
11static void _animated_apply(void); 11static void _animated_apply(void);
12static void _do_apply(Eina_Bool at_init); 12static void _do_apply(void);
13static void _info_free(E_Randr2 *r); 13static void _info_free(E_Randr2 *r);
14static E_Config_Randr2 *_config_load(void); 14static E_Config_Randr2 *_config_load(void);
15static void _config_free(E_Config_Randr2 *cfg); 15static void _config_free(E_Config_Randr2 *cfg);
@@ -107,7 +107,7 @@ e_randr2_init(void)
107 if (_config_update(e_randr2, e_randr2_cfg, 1)) 107 if (_config_update(e_randr2, e_randr2_cfg, 1))
108 e_randr2_config_save(); 108 e_randr2_config_save();
109 } 109 }
110 _do_apply(EINA_TRUE); 110 _do_apply();
111 } 111 }
112 else 112 else
113 { 113 {
@@ -226,7 +226,7 @@ _cb_fade_animator(void *data EINA_UNUSED)
226 if (_target_to == 255) 226 if (_target_to == 255)
227 { 227 {
228 _apply_delay = ecore_timer_loop_add(1.0, _cb_delay_timer, NULL); 228 _apply_delay = ecore_timer_loop_add(1.0, _cb_delay_timer, NULL);
229 _do_apply(EINA_FALSE); 229 _do_apply();
230 } 230 }
231 else 231 else
232 { 232 {
@@ -263,7 +263,7 @@ _animated_apply(void)
263} 263}
264 264
265static void 265static void
266_do_apply(Eina_Bool at_init) 266_do_apply(void)
267{ 267{
268 // take current screen config and apply it to the driver 268 // take current screen config and apply it to the driver
269 printf("RRR: re-get info before applying..\n"); 269 printf("RRR: re-get info before applying..\n");
@@ -277,7 +277,7 @@ _do_apply(Eina_Bool at_init)
277 printf("RRR: eval config...\n"); 277 printf("RRR: eval config...\n");
278 _screen_config_eval(); 278 _screen_config_eval();
279 printf("RRR: really apply config...\n"); 279 printf("RRR: really apply config...\n");
280 e_comp->screen->apply(at_init); 280 e_comp->screen->apply();
281 printf("RRR: done config...\n"); 281 printf("RRR: done config...\n");
282} 282}
283 283
diff --git a/src/modules/wl_drm/e_mod_main.c b/src/modules/wl_drm/e_mod_main.c
index 17e915ce5..45f589361 100644
--- a/src/modules/wl_drm/e_mod_main.c
+++ b/src/modules/wl_drm/e_mod_main.c
@@ -574,7 +574,7 @@ _drm2_rotation_exists(Ecore_Drm2_Output *output, int rot)
574} 574}
575 575
576static void 576static void
577_drm2_randr_apply(Eina_Bool can_skip EINA_UNUSED) 577_drm2_randr_apply(void)
578{ 578{
579 Ecore_Drm2_Device *dev; 579 Ecore_Drm2_Device *dev;
580 Ecore_Drm2_Output **outconf, *out; 580 Ecore_Drm2_Output **outconf, *out;