Commit Graph

84 Commits

Author SHA1 Message Date
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
Mike Blumenkrantz bec5d1fe51 backlight update loop cleanups
* do null check before adding to device list

* use name length from ecore_x_randr_output_name_get()
2014-01-20 22:21:40 -05:00
Mike Blumenkrantz 0be9442140 only call ecore_x_randr_output_backlight_available() once in backlight 2014-01-20 21:30:38 -05:00
Mike Blumenkrantz a310de50c8 block backlight updating during animation
updating backlight in this context causes my backlight to never return to normal levels, and blocking it doesn't seem to be unreasonable here
2014-01-20 21:05:51 -05:00
Mike Blumenkrantz 81bb88896e make backlight wayland-friendly 2014-01-14 20:28:57 -05:00
Mike Blumenkrantz 86656e4df9 compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.

* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.

** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes

** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects

** protocol-specific window management and compositor functionality is now kept exclusively in backend files

** e_pixmap api provides generic client finding and rendering api

** screen/xinerama screens are now provided directly by compositor on startup and re-set on change

** e_comp_render_update finally replaced with eina_tiler

** wayland compositor no longer creates X windows

** compositor e_layout removed entirely

* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra

* e_manager is just for screensaver and keybind stuff now, possibly remove later?

* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor

** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.

*** do NOT set interceptors on a client's comp_object. seriously.

* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor

* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get

* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas

* deskmirror is (more) broken for now

* illume is totally fucked

* Ecore_X_Window replaced with Ecore_Window in most cases

* edge binding XWindows replaced with regular canvas objects

* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result

comp files and descriptions:

e_comp.c - overall compositor functions, rendering/update loop, shape cutting

e_comp_x.c - X window management and compositor functionality

e_comp_wl.c - Wayland surface management and compositor functionality

e_comp_canvas.c - general compositor canvas functions and utilities

e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems

additional authors: ivan.briano@intel.com

feature: new compositor

removal: e_border, e_container, e_popup
2014-01-14 20:22:02 -05:00
Mike Blumenkrantz 292bcf6e81 only allow backlight to go to 0.1, not 0.0
on some backlight devices, 0.0 is completely off, which can render the system unusable.

T651
2013-12-17 11:22:56 -05:00
Carsten Haitzler 1c5aa36ee9 backlight - fix dimming if normal level less than dim level
if dim level is set to 20% but normal level has been moved to 10%...
when we dim dont RAISE bl level to 20% - do nothing if dim > normal.
2013-10-22 11:26:59 +01:00
discomfitor 648a748cac reorder some backlight setting to make instant changes actually instant
backlight fading on logout is no longer permanent
2013-09-20 17:18:36 +01:00