Commit Graph

143 Commits

Author SHA1 Message Date
Sebastian Dransfeld 27c1f17984 randr: improve code readability in lid update
Be sure we have active non-lids before deactivating lids.
2014-12-17 11:39:19 +01:00
Sebastian Dransfeld 0ec2bdfd52 randr: fix bad copy paste error 2014-12-17 11:35:23 +01:00
Sebastian Dransfeld d69848f63c randr: add error print 2014-12-17 11:19:25 +01:00
Sebastian Dransfeld e7e51c9c12 Revert "randr: always call _e_randr_output_active_set"
This reverts commit 7f14d81e6a.

Broke LID open/close for me, note to self, more testing before commit.
2014-12-17 11:18:13 +01:00
Sebastian Dransfeld f92f1ff4cc randr: TODO++ and error print 2014-12-17 10:35:54 +01:00
Sebastian Dransfeld 9b4bace831 randr: don't try to enable crtc with no outputs 2014-12-17 10:35:12 +01:00
Sebastian Dransfeld 7f14d81e6a randr: always call _e_randr_output_active_set
_e_randr_output_active_set should handle if we set active on an active
output
2014-12-17 10:29:27 +01:00
Sebastian Dransfeld 7ddc9d73ff randr: handle (x, y) > 0
x and y can be larger than 0, so we must set a high start value.
2014-12-17 10:22:48 +01:00
Sebastian Dransfeld 9844c738f7 randr: remove weird code
If we do E_Randr_Output *out2 = _e_randr_output_find(output->xid), then
output should be equal to out2, else we have several output variables per
output xid which should be fixed correctly.
2014-12-17 08:56:24 +01:00
Sebastian Dransfeld 399fd22c36 randr: cleanup try 2
This does not change any behaviour, just moves code:

1. We only try to locate a crtc for an output in _e_randr_output_active_set

And we only do this when we set active.

2. We only search for a crtc in _e_randr_output_crtc_find

This includes looping known crtcs without querying X if it matches.

Please don't revert, but help cleaning. As the current code does not
work for me...
2014-12-17 08:49:40 +01:00
Carsten Haitzler 43f1dc012d Revert "Randr: Fix null dereference."
This reverts commit 4aef218d28.

Revert "randr: remember crtcid for fast lookup on reconnect"
This reverts commit 55b4ad41d1.

Revert "randr: further cleanup"
This reverts commit 3e02824663.

these make nvidia randr resolution changing work again. sorry seb.
even though cleanups might be nice... this code is FIDDLY and every
driver seems to work differently, so take it easy and be very careful
- make no assumptions. i know it works on my intel desktop and nvidia
deskop atm. once i get a vga cable i'll fix up intel laptop with
external display that has problems. i can try radeon too later. but
right now - this stuff needs to work. being clean is far less
important than working. :)
2014-12-17 09:40:41 +09:00
Carsten Haitzler 9677b71902 Revert "randr: Don't track active outputs"
This reverts commit 01f43e3618.

this broke nvidia randr - i cant tunr my screens on or off anymore.
2014-12-17 09:12:32 +09:00
Tom Hacohen 4aef218d28 Randr: Fix null dereference.
CID1181926
2014-12-16 14:56:10 +00:00
Sebastian Dransfeld 01f43e3618 randr: Don't track active outputs
Remove tracking of active outputs to reduce code complexity.
2014-12-16 10:13:55 +01:00
Sebastian Dransfeld d265a1b289 randr: TODO++ 2014-12-16 09:56:02 +01:00
Sebastian Dransfeld 55b4ad41d1 randr: remember crtcid for fast lookup on reconnect
When an output is set inactive, it is disconnected from a crtc. Now we
remember the id of the last crtc it was connected to, so we get a faster
lookup on reconnect.
2014-12-16 09:21:02 +01:00
Carsten Haitzler 5180b69e33 e randr - restore edp checks
the dp checks were looking for edp stuff. but due to naming they appeard as
eDP or maybe edp or EDP - thus were simplified to dp. put more explicit
checks there.
2014-12-16 11:31:00 +09:00
Sebastian Dransfeld 074779b460 randr: Don't match DP as LID
On my intel laptop DP are my DisplayPort connections, not LID.
2014-12-15 12:52:25 +01:00
Sebastian Dransfeld 3e02824663 randr: further cleanup
Primarly two things removed:
1. crtc->outputs should only contain outputs which should be enabled
So looping them twice in e_randr_apply is definitly wrong.

2. _e_randr_crtc_find should find a crtc for an output
So looping our crtcs again in _active_set is definitly wrong. If
_e_randr_crtc_find does not find us a crtc, it should be fixed there.
2014-12-15 12:31:14 +01:00
Carsten Haitzler 95b4f14098 e randr - make it work on nvidia - lots of "wrong" things fixed
i've spent a while testing randr on my nvidia box and drviers. it now
works - i can turn screens on and off. i couldn't before. e_randr was
trying to be too smart for its own good. it wasnt matching up outputs
to crtcs, was thinking outputs active when they were not, etc. etc.
etc. - reality is e_randr could do witha  lot of simplification, but
at this stage i'm just going to hammer it into shape to work across as
many drivers and setups as i can test against.
2014-12-15 07:43:25 +09:00
Carsten Haitzler 48023b9ce3 e randr - fix warning (signed vs unsigned cmp) 2014-11-29 16:44:41 +09:00
Carsten Haitzler 70753a7903 e - randr - stop saving config using XID - this is utterly WRONG
so e was storing randr config using XIDs to match outputs etc. this is
all kinds of wrong. XIDs are NOT STATIC. they change from xserver to
xserver and from run to run. they MAY be the same. they may not. so
this was just broken.

use output name + edid as a big "string" (name.edid) as a way ofr
identifying config for a specific combination of output plus monitor
and to find/identify the corrent output+monitor to apply it to (of
course missing edid gets replaced with ??? and missing output name is
??? too - i have never seen a missing output name so you get this at
least).

so this FIXES "restore" of screen mode on login for starters. this
does nothing to "fix" the screen setup dialog in any way. there are
separate issues there.

this also breaks e_randr config compat so i bumped epoch so your old
config is rejected. i don't see a sensible way of porting the config
forward.
2014-11-29 10:05:36 +09:00
Sebastian Dransfeld 23ade9f630 randr: fix formatting
tab to spaces
2014-11-19 11:58:50 +01:00
Mike Blumenkrantz 0cf20e5407 fix e_randr double comparison warnings 2014-09-07 23:02:38 -04:00
Sebastian Dransfeld b6032b1fbd e_randr: position unknown monitors far right 2014-08-14 12:46:31 +02:00
Sebastian Dransfeld 0cb5704016 e_randr: better initial loading of x config
On first creation of randr config, get output position from crtc and
save config afterwards.
2014-08-14 09:55:02 +02:00
Sebastian Dransfeld 4a59642438 e_randr: update TODO 2014-08-14 09:54:10 +02:00
Sebastian Dransfeld fd5f178c21 e_randr: narrower scoping of variables 2014-08-14 09:51:40 +02:00
Sebastian Dransfeld 81e5bac915 e_randr: remove debug 2014-08-14 09:50:29 +02:00
Sebastian Dransfeld 30846ee4ea randr: Update lid status when outputs change
If we only have lid, it will be active even though lid is closed. If we
connect a monitor we want the lid to deactivate.
2014-03-19 13:37:34 +01:00
Sebastian Dransfeld 8c3b7800c9 randr: TODO++ 2014-03-06 15:18:15 +01:00
Sebastian Dransfeld c0d0afad32 randr: function to apply current config 2014-03-06 15:18:14 +01:00
Sebastian Dransfeld f6a0ec2753 randr: only activate outputs we want to connect 2014-03-06 15:18:14 +01:00
Sebastian Dransfeld 52751092f5 randr: store connection status in output 2014-03-06 15:18:14 +01:00
Sebastian Dransfeld 2e7964794b randr: make current setup extern 2014-03-06 15:18:14 +01:00
Sebastian Dransfeld 9bd18c6272 randr: same param name in prototype and function 2014-03-06 15:18:14 +01:00
Sebastian Dransfeld d6cec482d4 randr: don't let crtc changes change our config 2014-03-06 15:18:14 +01:00
Sebastian Dransfeld ff750b2bb9 randr: add match for refresh rate
Store output config with refresh rate, so we don't just get correct
geometry for outputs.
2014-03-06 15:18:14 +01:00
Sebastian Dransfeld f32426878c randr: common function for fetching output name
Add a common function to get output name, and also check edid if no name
is set by randr.
2014-03-06 15:18:14 +01:00
Sebastian Dransfeld 82e7d1184c randr: remember crtc in output struct 2014-03-06 15:18:14 +01:00
Sebastian Dransfeld 5c6eed2307 randr: allocate hot-plugged outputs 2014-03-06 15:18:14 +01:00
Sebastian Dransfeld 11e21fd1ff randr: allocate hot-plugged crtcs 2014-03-06 15:18:14 +01:00
Sebastian Dransfeld 8b5153130a randr: Use already fetched root window 2014-03-06 15:18:14 +01:00
Sebastian Dransfeld 43aed04241 randr: check NULL before dereference
Fixes CID 1181926
2014-02-24 09:17:25 +01:00
Sebastian Dransfeld 60483a11a0 randr: split config and current setup
This is so the current config does get changed unless the user requests
it, and makes it possible to have several configs.
2014-02-17 08:44:56 +01:00
ChunEon Park 7474036140 enlightenment - removed warnings. 2014-01-18 19:37:02 +09:00
Sebastian Dransfeld 227072c553 randr: remove debug output 2014-01-15 07:06:14 +01:00
Sebastian Dransfeld 93cf4d877d randr: remove unused variable 2014-01-15 07:06:13 +01:00
Sebastian Dransfeld e215a3951e randr: Enable output from settings 2014-01-15 07:06:13 +01:00
Sebastian Dransfeld b140a13314 e_randr: rework 2014-01-15 07:06:13 +01:00