Skip to content
Snippets Groups Projects
  1. Apr 14, 2021
    • Kenny Levinsen's avatar
      libweston/launcher: Allow VT switch without get_vt · 97d421a7
      Kenny Levinsen authored and Pekka Paalanen's avatar Pekka Paalanen committed
      
      get_vt is used to check if VTs are enabled, by verifying that a VT greater than
      0 is returned.
      
      libseat always implements switching, with switch to an active session
      currently being a noop in all backends. libseat does not currently have
      a get_vt implementation. Make get_vt errors more explicit, and allow VT
      switching anyway if the error is ENOSYS.
      
      Signed-off-by: default avatarKenny Levinsen <kl@kl.wtf>
      97d421a7
    • Kenny Levinsen's avatar
      libweston/launcher: libseat backend · 6c4a993a
      Kenny Levinsen authored and Pekka Paalanen's avatar Pekka Paalanen committed
      
      This adds support for libseat as a seat backend. libseat provides seatd,
      (e)logind and direct seat backends as compile-time and runtime options.
      
      The backend is currently disabled by default. It can be enabled through the
      launcher-libseat option.
      
      Signed-off-by: default avatarKenny Levinsen <kl@kl.wtf>
      6c4a993a
  2. Apr 12, 2021
  3. Apr 10, 2021
    • Marius Vlad's avatar
      backend-drm/state-propose: Check the surface buffer dimensions for cursor case · 7a465d85
      Marius Vlad authored and Daniel Stone's avatar Daniel Stone committed
      
      In some situations, like positioning a sub-surface that exceeds the
      output's dimensions we would adjust the plane state dimensions to some
      lower values to that of the buffer. That would ultimately trip the cursor
      update function because the buffer itself actually exceeds the maximum
      size/dimension of the cursor.
      
      The plane state destination co-ordinates is the area of the view which
      is visible on the output, which in some situations, would actually be
      smaller than the original buffer dimensions (making it so that it will
      pass the cropping/scaling check), but depending on of
      how large is the surface buffer, it would tripping the assert wrt to
      cursor width/height dimensions.
      
      This hasn't been seen so far due to the fact that until recently we had
      a cursor surface that always reached the cursor plane and that was
      already being set-up by default (with desktop-shell, which is no longer
      the case), and also because kiosk-shell, which doesn't set-up a cursor
      surface, was not available.
      
      This adds a check to skip placing the view in the cursor plane if the
      buffer dimensions exceed the cursor permitted width/height.
      (Suggested-by Daniel Stone).
      
      Signed-off-by: default avatarMarius Vlad <marius.vlad@collabora.com>
      7a465d85
    • Jonathan Marler's avatar
      launcher: fix socket message race condition · f153c494
      Jonathan Marler authored and Daniel Stone's avatar Daniel Stone committed
      
      fixes issue #484 (race condition with message to/from weston launch)
      
      The race condition occurs after weston sends the WESTON_LAUNCHER_OPEN
      message to weston-launch.  The race is between when weston-launch replies
      with the fd handle versus weston-launch sending an activation message.  If
      weston-launch sends an activation message before sending the fd handle,
      then weston will be in an invalid state.
      
      To fix this, I modified the fd handle reply that weston-launch sends to
      include a message id at the beginning, which I called
      WESTON_LAUNCHER_OPEN_REPLY.  Along with this, weston now inspects the
      first part of any reply to determine whether it is an activation message
      or a reply to the OPEN message.  In the newly handled case that it's an
      activation message, it tracks whether the latest result is a deactivate
      message and stores it in a flag to be handled once the open function has
      completed.
      
      Signed-off-by: default avatarJonathan Marler <johnnymarler@gmail.com>
      f153c494
  4. Apr 07, 2021
  5. Apr 04, 2021
  6. Apr 01, 2021
  7. Mar 22, 2021
  8. Mar 18, 2021
    • Pekka Paalanen's avatar
      doc: fix udev rule in calibration-helper.bash · 0b61620c
      Pekka Paalanen authored
      This used a cargo-culted form of the ACTION check. Kernel is allowed to
      invent new ACTIONs and IIRC there are already actions like bind and
      unbind.
      
      Udev events before rule processing always start with a clean property
      list. This means that if you only match ACTION==add to add some value to
      the event, then that value will not be present for ACTION==bind. Udev
      event consumers do not accumulate values, so inconsistent value setting
      may confuse them.
      
      Therefore one needs to match ACTION!=remove, not ACTION==add|change, to
      keep the device properties consistent for every event. It doesn't hurt
      to set them on remove either, but it's a habit to try to avoid
      processing when not strictly needed.
      
      This issue came up in
      #476 (comment 841430)
      
      For more information, see
      https://lists.freedesktop.org/archives/systemd-devel/2020-November/045570.html
      
      
      the part "KERNEL API INCOMPATIBILITY" near the beginning.
      
      Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
      0b61620c
  9. Mar 16, 2021
  10. Mar 12, 2021
  11. Mar 09, 2021
  12. Mar 08, 2021
    • Pekka Paalanen's avatar
      CI: work around Gitlab Cobertura parsing quirk · f6ff85b1
      Pekka Paalanen authored
      This should not be necessary, but my testing with fd.o Gitlab 13.9.1
      shows this is needed. Otherwise the coverage markings will not appear in
      a MR diff view.
      
      Apparently Gitlab has some problem with 'filename' attribute containing
      "../" in Cobertura XML files, even when that does result in a correct
      path. Or maybe the problem is is with the <source> path referring to the
      build dir which from Gitlab perspective does not exist in the project,
      even though builddir/../ is a good path.
      
      This sed hack removes the "../" part and the last element in the
      <source> path correspondingly.
      
      See !567
      
      
      for my testing.
      
      Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
      f6ff85b1
    • Pekka Paalanen's avatar
      CI: add test coverage results · e72119f1
      Pekka Paalanen authored
      This runs the coverage tools to produce HTML pages listing the code lines /
      functions / branches hit/totalled by the test suite.
      
      Nowadays Gitlab has some Cobertura support itself:
      https://docs.gitlab.com/ee/user/project/merge_requests/test_coverage_visualization.html
      
      
      
      lcov is needed for the HTML report, gcovr is needed for the Cobertura
      report. 'ninja clean' must be removed, otherwise it deletes the coverage
      files before they are analysed.
      
      Seeing the test suite code coverage is really interesting. It can guide
      designing tests. If Gitlab MRs show the coverage in diff view, it shows
      if new code actually gets executed in CI.
      
      Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
      e72119f1
  13. Mar 04, 2021
  14. Feb 28, 2021
  15. Feb 25, 2021
    • Pekka Paalanen's avatar
      gl-renderer: print use time with gl-shader-generator debug · f65ba188
      Pekka Paalanen authored
      
      This should help correlate which shaders were used in repainting outputs
      recently.
      
      Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
      f65ba188
    • Pekka Paalanen's avatar
      gl-renderer: garbage-collect old shaders · 1ed2cad8
      Pekka Paalanen authored
      
      This adds a heuristic for freeing shader programs that have not been
      needed for a while. The intention is to stop Weston accumulating shader
      programs indefinitely, especially in the future when color management
      will explode the number of possible different shader programs.
      
      Shader programs that have not been used in the past minute are freed,
      except always keep the ten most recently used shader programs anyway.
      The former rule is to ensure we keep shader programs that are actively
      used regardless of how many.  The latter rule is to prevent freeing too
      many shader programs after Weston has been idle for a long time and then
      repaints just a small area. Many of the shader programs could still be
      relevant even though not needed in the first repaint after idle.
      
      The numbers ten and one minute in the above are arbitrary and not based
      on anything.
      
      These heuristics are simpler to implement than e.g. views taking
      references on shader programs. Expiry by time allows shader programs to
      survive a while even after their last user is gone, with the hope of
      being re-used soon. Tracking actual use instead of references also
      adapts to what is actually visible rather than what merely exists.
      
      Keeping the shader list in most recently used order might also make
      gl_renderer_get_program() more efficient on average.
      
      last_repaint_start time is used for shader timestamp to avoid calling
      clock_gettime() more often. Adding that variable is an ABI break, but
      libweston major has already been bumped to 10 since last release.
      
      Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
      1ed2cad8
    • Pekka Paalanen's avatar
      gl-renderer: log shader deletions too · a8c4dfea
      Pekka Paalanen authored
      
      This is useful for seeing that the shader program garbage collection
      works in a future patch.
      
      Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
      a8c4dfea
    • Pekka Paalanen's avatar
      gl-renderer: add compositor shorthand pointer · 40c26a0b
      Pekka Paalanen authored
      
      One more thing is coming to need this, so add the compositor pointer and
      migrate existing places to use it where it simplifies things.
      
      Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
      40c26a0b
    • Pekka Paalanen's avatar
      gl-renderer: whitespace style clean-up · 768f07cb
      Pekka Paalanen authored
      
      Fix some deviations from the coding style.
      
      Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
      768f07cb
    • Pekka Paalanen's avatar
      gl-renderer: doc YCbCr-RGB conversion · 9a59303a
      Pekka Paalanen authored
      
      I have verified that the conversion here follows ITU-R BT.601 except for
      the offsets 16/256 and 128/256 which should be 16/255 and 128/255
      respectively.
      
      I used to following octave script to verify this:
      
      rf = 0.299;
      gf = 0.587;
      bf = 0.114;
      
      crdiv = 1.402;
      cbdiv = 1.772;
      
      M = [ rf, gf, bf ;
            -rf / cbdiv, -gf / cbdiv, (1 - bf) / cbdiv;
            (1 - rf) / crdiv, -gf / crdiv, -bf / crdiv ];
      
      YCbCr = [ 'Y'; 'Cb'; 'Cr' ];
      RGB = [ 'R'; 'G'; 'B' ];
      eq = [ ' '; '='; ' ' ];
      l = [ ' [ '; ' [ '; ' [ ' ];
      r = [ ' ] '; ' ] '; ' ] ' ];
      
      mat = [
      	sprintf('%9f %9f %9f', M(1,:));
      	sprintf('%9f %9f %9f', M(2,:));
      	sprintf('%9f %9f %9f', M(3,:));
      ];
      
      [ l YCbCr r eq l mat r l RGB r ]
      
      R = inv(M);
      
      mat = [
      	sprintf('%9f %9f %9f', R(1,:));
      	sprintf('%9f %9f %9f', R(2,:));
      	sprintf('%9f %9f %9f', R(3,:));
      ];
      
      [ l RGB r eq l mat r l YCbCr r ]
      
      [ R(:,1), R(:,2:3) .* (255/224) ]
      
      The final matrix printed is what the shader uses down to +/- one digit,
      so at least 7 correct decimals.
      
      Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
      9a59303a
    • Pekka Paalanen's avatar
      gl-renderer: move view alpha out of sample_input_texture() · 2b5a8639
      Pekka Paalanen authored
      
      Sampling input texture has nothing to do with view alpha. This clarifies
      the code structure.
      
      Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
      2b5a8639
Loading