1. 18 May, 2021 1 commit
    • Simo Piiroinen's avatar
      [display] Normalize placeholder topmost window pid values. Fixes JB#54297 · 13259837
      Simo Piiroinen authored
      It used to be that lipstick reported topmost window pid with value -1
      when there was no application windows on screen. However due to some
      recent change nowadays (also) pid value zero seems to be used in such
      situations. As the pid value is used by mce for detecting situations
      where some application window is on screen despite lockscreen being
      active, there are subtle problems with for example blanking timers and
      fingerprint wakeup handling.
      Normalize pid values within mce so that -1 is used whenever lipstick
      reports value that is less than or equal to zero.
      Signed-off-by: default avatarSimo Piiroinen <simo.piiroinen@jolla.com>
  2. 25 Jun, 2020 3 commits
    • spiiroin's avatar
      [battery-udev] Refresh all udev properties on heartbeat. Fixes JB#48324 · 2261f932
      spiiroin authored
      There might not be udev notification about every battery capacity
      percent value change. While this is usually harmless when battery
      is sufficiently full, it can cause issues like missed battery low
      notifications and/or delay battery empty shutdown so much that
      battery gets too depleted for regular bootup.
      Poll power supply device properties in process watchdog heartbeat
      pace i.e. about every 36 seconds of uptime not spent in suspend.
      Periodic udev polling is enabled by default, but can be disabled
      via mce configuration.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
    • spiiroin's avatar
      [battery-udev] Enablers for forced udev property refreshing. JB#49693 · a01dacd6
      spiiroin authored
      For example pinephone sends udev notification about charger disconnect, but
      not about battery making related transition to discharging state - which
      leaves system believing battery is still getting charged.
      Add enablers for optionally refreshing properties of all power supply
      devices whenever at least one device is reporting changes.
      Forced refresh is disabled by default. Enabling should be done only
      on those devices where it is needed, via hw specific mce configuration.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
    • spiiroin's avatar
      [battery-udev] Enablers for configurable charger types. JB#49693 · d387d08c
      spiiroin authored
      For example pinephone exposes charger devices in a manner where the
      name is prefixed with chiptype (e.g. "axp813-ac" / "axp20x-usb").
      As mce does not recognize these, both wall charger and pc connection
      gets treated as "other" type charger - which works to some extent but
      triggers incorrect UI actions.
      If direct match for power supply device type / name is not found, try
      to eliminate chipname prefix so that for example names such as
      "axp20x-usb" get treated as plain "usb".
      To future proof things, make it possible to override build-in
      defaults and heuristics via mce configuration files.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
  3. 23 Jun, 2020 1 commit
    • spiiroin's avatar
      [battery-udev] Handle initial probe from idle callback · f4dbf7e1
      spiiroin authored
      In some devices initial power supply device probing can block mce for
      several seconds. As this happens during mce startup, it also delays
      readiness of mce systemd service. Which in turn can cause unnecessary
      waiting during bootup.
      Handle time-consuming udev property scanning from idle callback so
      that it happens after systemd has been notified that mce is ready.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
  4. 04 Feb, 2020 2 commits
    • spiiroin's avatar
      [display] Reset blanking timers on compositor start/stop. Fixes JB#47904 · 62b7d078
      spiiroin authored
      Whenever either compositor or lipstick service startup is detected,
      a display unblank is scheduled within mce. If display is already on,
      these requests end up being ignored and leaves previously programmed
      dimming / blanking timers active - which then can cause display to
      blank unexpectedly e.g. during bootup.
      Make sure dimming / blanking timers are reprogrammed whenever either
      compositor or lipstick service availability on D-Bus changes.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
    • spiiroin's avatar
      [battery] Do not report 100% when battery level is unknown. JB#48562 · 3e41f3d2
      spiiroin authored
      Using 100% as default initial value can lead to clients seeing what
      looks like genuine battery level drop during mce startup.
      Use MCE_BATTERY_LEVEL_UNKNOWN (-1) - which is documented in mce-dev
      headers as placeholder value used while battery level is unknown.
      Adapt battery level tracking withing mce to expect and deal with
      unknown/negative initial state.
      To allow debugging of battery level unknown states, expand value
      range allowed by mcetool --set-battery-level=<percent> to include
      also -1.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
  5. 30 Jan, 2020 1 commit
    • spiiroin's avatar
      [systemd] Add capabilities required by compositor killer. Fixes JB#48754 · d9f65fc6
      spiiroin authored
      The intent is that (devel flavor) mce will make an attempt to
      coredump / kill compositor process that stops responding to
      display blank/unblank control ipc - when it is unlikely that
      compositor is unresponsive because it has been stopped in
      debugger. This feature stopped working after systemd sandboxing
      features were taken in use.
      Add CAP_SYS_PTRACE - required by debugger detection.
      Add CAP_KILL - required for sending signals to unrelated processes.
      Add diagnostic logging in error paths of related code.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
  6. 24 Oct, 2019 1 commit
    • spiiroin's avatar
      [fingerprint] Use gesture actions for fingerprint wake up. Fixes JB#47437 · 64e71c69
      spiiroin authored
      Originally fingerprint wake up was modeled to:
      - wake up display like double tap does
      - exit from lockscreen when device is not locked, or
      - indicate need to unlock when device is locked
      i.e. behave as if double power key press were made.
      This however means that fingerprint wake up never ends up showing
      lockscreen where things like date and time would be visible.
      Switch from handling fingerprint wake up as something explicit into
      treating it as just another gesture with configurable actions.
      Add "tkunlock2" gesture action, which behaves like "tkunlock" when
      device is unlocked and does nothing when device is locked.
      After which users can tweak fingerprint behavior with mcetool.
      mcetool --set-touchscreen-gesture-actions=fpwakeup,unblank,tkunlock
        The default behavior.
      mcetool --set-touchscreen-gesture-actions=fpwakeup,unblank,tkunlock2
        Exits from lockscreen only if device is not locked.
      mcetool --set-touchscreen-gesture-actions=fpwakeup,unblank
        Just wakes up display, leaving lockscreen status as it is.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
  7. 23 Oct, 2019 1 commit
    • spiiroin's avatar
      [display] Handle compositor exit during setUpdatesEnabled call. JB#47846 · f2f8b1a3
      spiiroin authored
      Once mce has issued a setUpdatesEnabled method call, it expects to get a
      reply even if compositor service drops from SystemBus. While the situation
      does self correct when a fresh compositor instance shows up, hiccups like
      unwarranted ipc panic led pattern triggering can occur before that.
      Explicitly wake up display state machine also when compositor service
      drops from system bus.
      Do not treat compositor service stopped state as "ipc pending".
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
  8. 16 Oct, 2019 1 commit
    • spiiroin's avatar
      [display] Retry failing brightness adjustments. Fixes JB#47450 · 2783a90d
      spiiroin authored
      Display brightness control logic has been written with framebuffer
      interface in mind and consequently devices utilizing drm/dri are
      suffering from diagnostic logging noise from incorrectly timed
      adjustment attempts and outright failures to set desired brightness.
      Store desired and successfully activated brightness levels separately
      to ease adjustment failure handling and avoiding unwanted brightness
      pumping for example during compositor switchovers.
      Adjust display state machine so that it performs brightness level
      checkups during unblank also in states relevant for drm/dri logic.
      If brightness adjustment fails after unblank, retry periodically.
      Reduce amount of repetitive diagnostic noise caused by differing
      timing requirements between framebuffer and drm/dri interfaces.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
  9. 07 Oct, 2019 1 commit
  10. 12 Sep, 2019 1 commit
    • spiiroin's avatar
      [display] Add wait state to compositor switchover. JB#46746 · d42285d6
      spiiroin authored
      While ownership of well known compositor D-Bus name acts logically
      as mutual exclusion lock that allows only one compositor instance,
      timing wise name ownership change does not mean that underlying
      resources used by previous compositor instance would already be
      available for the current one - which can lead to resource allocation
      failures and crashes for example when switching from one minui
      based ui (unlock ui) to another one (upgrade ui).
      Allow previous compositor instance up to five seconds to exit before
      giving the current one permission to draw.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
  11. 11 Sep, 2019 2 commits
  12. 10 Sep, 2019 1 commit
    • spiiroin's avatar
      [display] Trigger extra blanking delay during bootup. Fixes JB#47170 · 04d806cf
      spiiroin authored
      Originally init_done was tracked as a boolean true/false value. Later on
      it was changed into a unknown/true/false tristate value. While making
      these changes, the triggering condition for extra blanking delay used
      immediately after bootup got broken in a way that did not manifest
      itself for a long time.
      Instead of waiting for init done before triggering extra blank delay,
      disable the extra delay altogether if mce has been (re)started after
      init done.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
  13. 28 Aug, 2019 1 commit
    • spiiroin's avatar
      [battery-udev] Make charger type available on D-Bus. JB#38667 · a80fd7ea
      spiiroin authored
      Battery notifier in lipstick needs charger type information.
      Add charger type evaluation to udev power supply device tracker and
      broadcast changes internally within mce via a datapipe.
      Reflect datapipe changes as D-Bus signals, and add D-Bus methods for
      querying the current state.
      For development builds enable charger type simulation and appropriate
      mcetool options for controlling it.
      The required D-Bus constants are available in mce-dev >= 1.27.0.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
  14. 13 Jun, 2019 1 commit
    • spiiroin's avatar
      [display] Reject LPM mode when lockscreen is not on screen. Fixes JB#21043 · 323e412f
      spiiroin authored
      When LPM is in use and gets triggered immediately after ending a call,
      display gets dimmed and coloring changes but call ui is still shown on
      screen (and can't be interacted with).
      Reject attempts to invoke LPM state if it is expected that call or
      alarm ui - which are layered above locksreen - are on screen.
      When LPM state is activated, allow UI side some time to hide any
      active applications. But if that does not happen, exit from LPM by
      blanking screen.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
  15. 11 Jun, 2019 2 commits
  16. 17 May, 2019 1 commit
    • spiiroin's avatar
      [mce] Unify license blurbs. JB#33684 · 091d6e7e
      spiiroin authored
      MCE uses LGPL v2.1 (without "or later") license, but due to missing / use
      of different license blurbs this is not always clear enough.
      Replace blurbs referring to "LGPLv2" short form which could be either
      LGPL v2.0 or v2.1 without "or later" with the same blurb that is used
      in mce.c file.
      Similarly add blurb to source files that are missing one altogether.
      Add all authors that can be derived from git logs.
      Update Jolla Ltd. copyright statements to match git activity.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
  17. 15 Mar, 2019 6 commits
  18. 13 Mar, 2019 4 commits
  19. 08 Mar, 2019 2 commits
    • spiiroin's avatar
      [dbus] Fix peerinfo tracking on mce startup · f5deaf81
      spiiroin authored
      Tracked services that are not running when mce starts up are left hanging in
      undefined state instead of getting declared as stopped. This happens because
      service is considered stopped when peerinfo makes transition away from
      running state - which is not possible before the service has been up at
      least once.
      Drop stale and deleted peerinfo states as they are not really needed and
      just add complexity.
      Handle state transitions resulting from name owner changes explicitly
      instead of doing them implicitly from within the setter function.
      Declare service as stopped when peerinfo enters stopped state rather than
      leaving running state.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
    • spiiroin's avatar
      [datapipe] Add enablers for logging datapipe value changes · e2f29495
      spiiroin authored
      A lot of mce functionality is based on pushing events through datapipes,
      which then causes cascade of activity on other datapipes. Tracing this
      can be cumbersome at times.
      Add logging hooks to datapipe structure to allow generic value tracing,
      and modify datapipe initialization so that data type specific hooks are
      bound to all datapipes so that all datapipe activity can be tracked by
      invoking mce with logging options such as:
        mce -T -ldatapipe.c:*_pipe
      Also fix couple of cases where incorrect data type were used for datapipe
      value tracking.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
  20. 07 Mar, 2019 1 commit
  21. 29 Jan, 2019 1 commit
  22. 24 Jan, 2019 1 commit
  23. 21 Dec, 2018 4 commits