Commit Graph

92 Commits

Author SHA1 Message Date
Carsten Haitzler ae45fd14c0 backlight - track x11 vt owner ship with root property added for vbox
this allows backlight to veto changes to backlight when the vt is not
owned.

fixes T8862

@fix
2020-12-01 20:27:23 +00:00
Carsten Haitzler c4e76ed593 backlight + ddc - fix and improve several small things
1. use max valu in the get and store it once a get has been done so it
will get backlight level right on unsuaul monitors that do not use
0->100
2. detect as an error dinfing 2 screesn with the same edid and log it
3. use ddca_enable_sleep_suppression() to try speed up things a bit to
sleep less inside ddcutil
2020-11-26 00:38:01 +00:00
Carsten Haitzler 9c116e6bb9 backlight - adjust debug so we get timestamps on bl changes always
was using this to see if these is lagf between wakeup form suspend and
fading the screen in - i see no lag. keep debug here for others to see
and reports what they say
2020-10-19 15:28:04 +01:00
Carsten Haitzler 63bc2a8093 backlight - support backlight on non-lid panels and bl_power too
i didn't know bl_ppower existed... i found a device that exposes this
sysfs node and it seems it's a good idea to swizzle it too in addition
to brightness. so fix that and also fix e's backlight handling to find
backlight devices for non-lid panels marked to have a backlight ... i
have such a device here. this makes backlight controls work in this
case.
2020-09-05 11:34:14 +01:00
Carsten Haitzler f6e4be1005 e wl screen dimming.blanking/timeouts/lock handling redo/fixup
so there was a fair bit of stick-tape and chewing gum in putting the
wl screensaving in e_Screensaver.c ... it thus was very different to
the x stuff. it SHOULd have had e_comp_wl handle idle timeout like the
xserver did and then glue in the same way the x code did to be
conistsent. instead of trying to fix the chewing gum ball there in
e_Screensver.c to find the logic holes ... i made it work like the
code as indicated above. this now makes it work reliably. dim
reliably. lock reliably. it even doesnt exit on ctrl+alt+backspace
once desklock is up now to allow locks to really lock... (dont use
locks during dev then if you need ctl+alt+backspace).

at least now all this dpms/screensavwr/brightness/backlight/lock goop
is consistent between wl and x11 and wl seems reliabkle now (to me).

knock this off as an annoyance fixed.

@fix
2020-06-28 15:06:37 +01:00
Carsten Haitzler c4ab23511e fix null edid more - found hole missed in last fix
adds more fix on top 80f92ee486
2020-06-14 14:00:48 +01:00
Carsten Haitzler ed1d9ea62c e backlight - fix initial restore of backlight after previous fix
no edid fix broke initial restore. fix it.
2020-06-10 12:34:21 +00:00
Carsten Haitzler 80f92ee486 e backlight - handle screens with no edid
this fixes backlight support on my pinephone...

@fix
2020-06-10 11:05:13 +00:00
Elyes HAOUAS 153f479d3f tree-wide: fix typos all over the place
Fix some typos

Differential Revision: https://phab.enlightenment.org/D11778
2020-05-14 12:04:51 +02:00
Carsten Haitzler 2b452e5db1 e - avoid segv's when zero screens are configured
at least backlight won't be applied now...
2020-04-22 20:46:59 +01:00
Carsten Haitzler 5d6424e3bc backlight - if bl devices not there yet for a zone then fix them later
if bl devices added later - sync them up to the desired backlight leave
when that happens and ensure we store the desired level...l
2020-04-21 01:35:57 +01:00
Carsten Haitzler 4749e1e065 backlight - fix string ptr leak
fix CID 1425215
2020-04-19 00:06:08 +01:00
Carsten Haitzler eba37f40a6 backlight - on get fails, also retry a few times
so sometimes i see gets fail, especially on wakeup, so retry.
2020-02-10 08:09:47 +00:00
Carsten Haitzler 346969eb90 todo - add magnifier 2020-02-09 13:59:12 +00:00
Carsten Haitzler fcacbe8a4f ddc - work around some probe fails, missing timer handle, etc.
beating on ddc support to make it solid. dealing with some bad screens
that don't respond, a libddcutil that was doing a printf messing up
the message stream from e_system to e .... and more.
2020-02-07 19:56:01 +00:00
Carsten Haitzler 78b73fb1a7 when backlight devices change, ensure they are restored to normal level
this ensures things like on login e setsup backlights fine - also on
monitor add/plug-in as when e's backlight init happens it may not see
all screens or devices yet.
2020-02-07 10:49:15 +00:00
Carsten Haitzler 1cfd1f4242 backlight - add workaround monitor wakeups silently ignoring val sets
so if monitor is buys waking up from dpms, it may not be bothering to
do what we asked... but the sets of the propety say they succeed, so
use the get at the end of a fade in run to see if we get the target
brightness within some delta and it's one of our standard brightnesses
(1.0, normal or dim) and retry a few times until we succeed or give
up. this ensures on wakupe your monitors end up at their target
brightness even with some hiccups as opposed to stay dim. not much we
can do about iffy hardware or libddcutil (not sure which is to blame)
other than do workarounds like this.

also add logging so you can see what is being asked and if it succeeds
or fails according to libddcutil.
2020-02-07 10:24:59 +00:00
Carsten Haitzler eab2a34ef3 backlight - add ddc support via libddcutil
This adds ddc monitor control and glues it into the backlight system.
A result of this is now backlgiht control gadgets work screen by
screen and even on desktop monitors as well as on a laptop panel. If
you now put a backlight gadget on a shelf on each screen... it will
control THAT screen's backlight.

This requires libddcutil to be installed. That will require i2c
modules (i2c-dev specifically). This means that this is likely not
going to do anything useful on bsd's... unless libddcutil happens to
work there by chance.

so install ddcutil/libddcutil. ensure it's in ld.so.conf so setuid
root processes find it (as LD_LIBRARY_PATH won't help) and enjoy your
new funcky per-screen backlight controls... :)

@feature
2020-02-06 18:41:23 +00:00
Carsten Haitzler ee393a201f e backlight - restructure to have real per screen backlight
now it really does look for the right way to control per screen and
only use the new e_system back-end to query/list devices etc. ...

this now opens the door to adding ddc support to e_system then using
it from e_backlight.

i can't test this... yet - but this means in theory the backlight
gadget will control the backlight of the screen it is on...
2020-02-01 11:29:38 +00:00
Carsten Haitzler f277ab71e7 e backlight - move to the new e system tool for backlight
no improvements like per screen brightness... but a straight
conversion to the new system tool which simplifies e backlight a lot.

it'd be betetr to use the new system also to read backlight value and
list lightss etc ... but for now this is a good first stage.
2020-01-15 11:33:55 +00:00
Mike Blumenkrantz e33c01cdce add new explicit method for enabling backlight depending on output type
ensure that nested compositors don't mess with backlight
2017-02-24 14:15:38 -05:00
Mike Blumenkrantz 18b452778a block backlight changing for nested/buffer compositors 2017-02-24 14:15:38 -05:00
Derek Foreman 73aecd73ab Replace all timer_add with timer_loop_add
So yeah, I've literally used sed to replace every occurrence of
ecore_time_add() with ecore_timer_loop_add() because I'm reasonably
confident that no part of E has a legitimate need for timer based on the
exact current time.

It would be really nice if I'm not wrong. :)

The reason for this is the incredible spew of clock_gettime() calls I'm
seeing on an ARM system (that should have a vdso for gettime, but...)
This can amount to thousands of system calls per second.

 #YOLO
2017-02-03 15:52:28 -06:00
Mike Blumenkrantz bd5df00f4c block input devices from backlight list
I guess this is a thing in newer kernel versions?

ref T1497
2015-12-28 16:00:05 -05:00
Chris Michael 8554024cba Fix xbl_avail variable being used when it could be undefined
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2015-12-28 14:30:56 -05:00
Carsten Haitzler 47f26b5b08 e backlight - avoid seg when comp is shut down and backlight updated
if comp is already shut down, then backlight can't do shutdown things
assuming comp is around, thus handle null e_comp. this fixes segv's
waiting to happen as backlight is shut down after comp and thus e_comp
is a garbage pointer of course

@fix
2015-12-07 19:52:13 +09:00
Mike Blumenkrantz 4e811057f3 add eeze watch for backlight events
when using "system" backlight mode, ensure that events are processed
as they occur so that the available backlight level is in sync with
the actual backlight level

fix T2255
2015-09-21 17:22:44 -04:00
Mike Blumenkrantz 75fb072dc3 fix backlight init value
in the case where xrandr is not used, setting backlight to very dim on init
will result in the backlight remaining at a very dim level when the backlight
normal level is 1.0 since backlight values will not successfully update until
at least 0.05s after the main loop starts

ref T1333
2015-07-22 13:56:19 -04:00
Chris Michael 0a94e8ba71 enlightenment: Make E build again with EFL from git
sed -i 's/EAPI/E_API/g'

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-07 15:13:10 -04:00
Conrad Meyer 4fc5495f4e backlight: Use basic ACPI sysctl knob on FreeBSD (kernel)
Summary:
Unconditionally build the suid-helper _backlight program; conditionalize
behavior on Eeze, FreeBSD (doing nothing on neither). Add logic to set
the FreeBSD sysctl in a similar manner to udev devices on Linux.

Add _bl_sys_find/_get helpers for FreeBSD that check for and consult the
video ACPI sysctl.

Test Plan:
Seems to work okay on my laptop (with EINA_CPU_FAKE=1 to workaround a threadq
race that I believe is unrelated -- T2287).

Reviewers: zmike, q66

Reviewed By: q66

Subscribers: cedric, seoz

Differential Revision: https://phab.enlightenment.org/D2337
2015-04-14 14:20:33 +01:00
Mike Blumenkrantz 58447e9508 completely remove E_Manager
the final step in flattening all the canvas/screen apis
2015-03-19 16:53:32 -04:00
Mike Blumenkrantz 471dcb24cb __UNUSED__ -> EINA_UNUSED
this has been bugging me forever. __UNUSED__ is no longer a valid macro here.
2015-03-18 18:09:09 -04:00
Mike Blumenkrantz 09ec213a31 remove e_util_zone_current_get() usage 2015-03-13 17:58:45 -04:00
Mike Blumenkrantz ba7c1ac49c remove E_Zone->comp member 2015-03-13 17:44:24 -04:00
Stefan Schmidt f64b07bb8e e_backlight: de-e_comp_get()ify 2015-01-23 13:37:59 +01:00
Mike Blumenkrantz 922af2c52f remove e_comp_list(), deprecate all related functions for pending removal
there is only one E_Comp which can now be accessed by the e_comp global.

if you're editing a file with some uses of these deprecated functions, replace their usages with appropriate references to this variable

pass -Wno-deprecated-declarations to ignore these warnings during build
2015-01-05 15:39:15 -05:00
Carsten Haitzler c621f82b51 e backlight - limit min to 0.05 to avoid totally off backlight
this seems new, but if you set backlight to 0 it isnt at minimum, but
is entirely off on my intel laptop and this is not what was desired
with bl level of 0, so limit to 0.05 for now to avoid accidentally
turning your screen off. might fix this later to allow explicit off -
but this should use dpms etc. to turn the screen off as well as
possible scanout etc.
2014-09-17 15:04:32 +09:00
Mike Blumenkrantz 7448e3706c simplify eeze backlight detection 2014-09-07 09:25:16 -04:00
Mike Blumenkrantz 1c9d1b2de1 only default to led subsystem backlight if it isn't a mail or kbd device
fix T1497

do backlights with subsystem=leds still exist or have they fixed that yet?
2014-09-07 09:25:16 -04:00
Chris Michael 18f5337fa3 fixed backlight compiler warnings when building for wayland-only
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-08-28 12:33:10 -04:00
Chris Michael 46e960397d fix unused variable if building for wayland-only
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-08-28 12:22:09 -04:00
Carsten Haitzler 217bc3347f e backlight - fix updae fetching at end of balckight fade anim
this helps keep the bl gadget in sync with actual backlight
2014-07-07 23:53:46 +09:00
Sebastian Dransfeld 25741f93fa backlight: Only check output name if sysdev is set
We only have an action inside the for loop if sysdev is set, so move the
check outside the for loop.
2014-06-11 11:08:26 +02:00
Mike Blumenkrantz a963666656 use separate variable for backlight animator value
using e_bl_val here is wrong now since this needs to calculate against the starting and ending backlight values, neither of which are represented accurately by e_bl_val in some cases.

this fixes the gradually decaying backlight which occurs over repeated screen blanks

probably fixes T1152
2014-05-07 15:28:08 -04:00
Mike Blumenkrantz 572760ae0e only update e_bl_val directly in backlight_level_set if not using randr backlight
this is the "real" backlight value, so it needs to always be accurate. since randr backlight sets this value elsewhere, only use those real updates to ensure genuine values
2014-05-07 15:26:42 -04:00
Mike Blumenkrantz c04d754ac5 enabling drm output module should NOT require X-less build.
these defines all need to be changed from HAVE_WAYLAND_ONLY to something like WITH_X or we're going to have lots of problems with xwayland later on
2014-03-18 16:14:04 -04:00
Chris Michael 915f8f0613 @bugfix: Fix building for WAYLAND_ONLY by using the proper define
sed -i 's/WAYLAND_ONLY/HAVE_WAYLAND_ONLY/g'

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-03-18 07:43:04 +00:00
Mike Blumenkrantz 3ccdd6ab32 bugfix: backlight double comparison now less likely to fail 2014-01-21 17:08:49 -05:00
Mike Blumenkrantz 84a3eb7af0 make current backlight value internally exported
display system backends should be handling this in the event of changes, and being able to set it directly makes that easier
2014-01-21 17:06:27 -05:00
Mike Blumenkrantz 215c0409e0 feature: handle xrandr backlight using a single, accurate handler
there's an event from ecore-x which tells us when this property has changed, which means we no longer have to be constantly checking to see if other apps have changed it
2014-01-21 16:48:09 -05:00