1. 28 May, 2020 1 commit
    • Pekka Paalanen's avatar
      timeline: convert vblank timestamp to MONOTONIC · 50aa3a76
      Pekka Paalanen authored
      All timeline event timestamps are in CLOCK_MONOTONIC already. DRM KMS
      timestamps are practically guaranteed to be CLOCK_MONOTONIC too, even though
      presentation clock could theoretically be something else. For other backends,
      the presentation clock is likely CLOCK_MONOTONIC_RAW due to
      weston_compositor_set_presentation_clock_software().
      
      This patch ensures that the recorded vblank timestamp is in CLOCK_MONOTONIC.
      Otherwise interpreting the timeline traces might be difficult to do accurately,
      since it would be hard to recover the relationship between the presentation
      clock and timeline event timestamps.
      
      The time conversion routine is the simplest possible, I don't think we need any
      more accurate conversion for timeline purposes. Besides, DRM-backend is the
      only backend where the timings actually matter, the other backends are
      software-timed anyway.
      
      Since the clock domain of the "vblank" attribute potentially changes, the
      attribute is renamed. Wesgr never used this attribute.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      50aa3a76
  2. 25 May, 2020 2 commits
    • Michael Olbrich's avatar
      gl-renderer: query EGL to determine if GL_TEXTURE_EXTERNAL_OES should be used · 40c519a3
      Michael Olbrich authored
      Using the number of planes to determine if GL_TEXTURE_EXTERNAL_OES should be
      used is incorrect with some modifiers: For example RGBA with a
      I915_FORMAT_MOD_Y_TILED_CCS modifier has two planes.
      
      Use eglQueryDmaBufModifiersEXT() to query if the current format/modifier only
      supports GL_TEXTURE_EXTERNAL_OES.
      
      Use the current code as fallback of modifiers are not supported.
      Signed-off-by: Michael Olbrich's avatarMichael Olbrich <m.olbrich@pengutronix.de>
      40c519a3
    • Alexandros Frantzis's avatar
      xdg-shell: Allow fullscreen surfaces to not cover the whole screen · f6bd2129
      Alexandros Frantzis authored
      The wording of the xdg-shell protocol allows surfaces to not cover the
      whole screen when they are made fullscreen. From the description of the
      fullscreen state in xdg-shell:
      
        The window geometry specified in the configure event is a maximum; the
        client cannot resize beyond it. For a surface to cover the whole
        fullscreened area, the geometry dimensions must be obeyed by the
        client.
      
      The last sentence is the condition for fullscreen coverage, not a
      requirement.
      
      This commit updates the code to not flag size mismatches for fullscreen
      surfaces as a protocol error when the surface fits within the screen. In
      such cases, the shell is responsible for centering surfaces
      appropriately and also for obscuring other screen content as described
      in the xdg_toplevel.set_fullscreen request description (and, indeed,
      desktop-shell does all this).
      
      For reference, contrast with the corresponding, stricter wording in the
      obsolete xdg-shell-unstable-v6 protocol for the fullscreen state:
      
        The window geometry specified in the configure event must be obeyed by
        the client.
      Signed-off-by: Alexandros Frantzis's avatarAlexandros Frantzis <alexandros.frantzis@collabora.com>
      f6bd2129
  3. 14 May, 2020 1 commit
  4. 12 May, 2020 1 commit
  5. 07 May, 2020 2 commits
  6. 29 Apr, 2020 1 commit
    • Michael Olbrich's avatar
      compositor: fix endless recursion in scene-graph printing · ef5f3233
      Michael Olbrich authored
      If a surface has subsurfaces then the surface itself is in the subsurface
      list. To avoid printing it again there is a check to skip the child view,
      if it is the same as the current view.
      
      However, this fails when a surface with subsurfaces has two (or more) views:
      The check to skip the parent fails for the other view and the two views are
      printed again and again until a stack overflow occurs.
      
      So instead check if the parent view of the subsurface view is the current
      view. This way, any view that does not belong to a real subsurface is
      skipped.
      
      As a side effect, this ensures that each view of the subsurfaces is only
      printed once at the correct place in the hierarchy.
      Signed-off-by: Michael Olbrich's avatarMichael Olbrich <m.olbrich@pengutronix.de>
      ef5f3233
  7. 06 Apr, 2020 1 commit
  8. 30 Mar, 2020 1 commit
  9. 20 Mar, 2020 9 commits
  10. 18 Mar, 2020 1 commit
  11. 12 Mar, 2020 1 commit
    • Pekka Paalanen's avatar
      tests: add viewport test for repeat mode · 4505f811
      Pekka Paalanen authored
      This test ensures that
      	"pixman-renderer: half-fix bilinear sampling on edges"
      keeps on working.
      
      Unlike in the original report
      #373, here we use buffer
      scale 2 instead of output scale 2 to trigger bilinear filter. The effect is the
      same, the actual resulting image in the failing case is just a little
      different. This is so that it will be easy to add more viewport screenshooting
      tests in this program in the future.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      4505f811
  12. 11 Mar, 2020 4 commits
    • Pekka Paalanen's avatar
      tests: move fill_color into helpers · f26d17fe
      Pekka Paalanen authored
      There will be a new test program that wants to share this code.
      
      No behavioral changes.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      f26d17fe
    • Pekka Paalanen's avatar
      tests: move viewport creation into helpers · 9c267e5b
      Pekka Paalanen authored
      There will be a new test program using viewports and would like to share this
      bit of code.
      
      There are two behavioral changes:
      - Compositor wp_viewporter interface version is no longer checked.
      - client_create_viewport() does not leak the viewporter object.
      
      test_viewporter_double_create needs to call bind_to_singleton_global() itself
      so that the viewporter object still exists when the error event arrives.
      Otherwise error verification fails.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      9c267e5b
    • Pekka Paalanen's avatar
      pixman-renderer: half-fix bilinear sampling on edges · 9f53edd4
      Pekka Paalanen authored
      When weston-desktop-shell uses a solid color for the wallpaper, it creates a
      1x1 buffer and uses wp_viewport to scale that up to fullscreen. It's a very
      nice memory saving optimization.
      
      If you also have output scale != buffer scale, it means pixman-renderer chooses
      bilinear filter. Arguably pixman-renderer should choose bilinear filter also
      when wp_viewport implies scaling, but it does not. As w-d-s always sets buffer
      scale from output scale, triggering the bilinear filter needs some effort.
      
      What happens when you sample with bilinear filter from a 1x1 buffer, stretching
      it to cover a big area? Depends on the repeat mode. The default repeat mode is
      NONE, which means that samples outside of the buffer come out as (0,0,0,0).
      Bilinear filter makes it so that every sampling point on the 1x1 buffer except
      the very center is actually a mixture of the pixel value and (0,0,0,0). The
      resulting color is no longer opaque, but the renderer and damage tracking
      assume it is. This leads to the issue 373.
      
      Fix half of the issue by using repeat mode PAD which corresponds to OpenGL
      CLAMP_TO_EDGE. GL-renderer already uses CLAMP_TO_EDGE always.
      
      This is only a half-fix, because composite_clipped() cannot actually be fixed.
      It relies on repeat mode NONE to work. It would need a whole different approach
      to rendering potentially non-axis-aligned regions exactly like GL-renderer.
      
      Fixes: wayland/weston#373Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      9f53edd4
    • Daniel Stone's avatar
      compositor: Fail on invalid transform for headless · 5450456d
      Daniel Stone authored
      As in aaf35586, we want to fail when we are passed an invalid
      transform name, not just blindly configure on using the normal
      transform. The previous commit missed the callsite from the headless
      backend's command-line parsing.
      
      Fix this so that headless fails when an invalid transform is specified
      on the command line.
      Signed-off-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
      5450456d
  13. 10 Mar, 2020 1 commit
  14. 06 Mar, 2020 5 commits
  15. 05 Mar, 2020 2 commits
  16. 28 Feb, 2020 2 commits
    • Pekka Paalanen's avatar
      tests: add buffer transform tests · 147e67c4
      Pekka Paalanen authored
      This patch continues the buffer and output transforms testing by iterating
      through a representative selection of buffer transforms and scales.
      
      For more details, see the previous patch "tests: add output transform tests".
      
      wayland/weston#52Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      147e67c4
    • Pekka Paalanen's avatar
      tests: add output transform tests · 97359ba5
      Pekka Paalanen authored
      This goes through all output transforms with two different buffer transforms
      and verifies the visual output against reference images.
      
      This commit introduces a new test input image 'basic-test-card.png'. It is a
      small image with deliberately odd and indivisible dimensions to provoke bad
      assumptions about image sizes. It contains red, green and blue areas which are
      actually text that makes it very obvious if you have e.g. color channels
      swapped. It has a white thick circle to highlight aspect ratio issues, and an
      orange cross to show a mixed color. The white border is for contrast and a 1px
      wide detail. The whole design makes it clear if the image happens to be rotated
      or flipped in any way.
      
      The image has one pixel wide transparent border so that bilinear sampling
      filter near the edges of the image would produce the same colors with both
      Pixman- and GL-renderers which handle the out-of-image samples fundamentally
      differently: Pixman assumes (0, 0, 0, 0) samples outside of the image, while
      GL-renderer clamps sample coordinates to the edge essentially repeating the
      edge pixels.
      
      It would have been "easy" to create a full matrix of
      every output scale & transform x every buffer scale & transform, but that
      would have resulted in 2 renderers * 8 output transforms * 3 output scales *
      8 buffer transforms * 3 buffer scales = 1152 test cases that would have all
      ran strictly serially because our test harness has no parallelism inside one
      test program. That would have been slow to run, and need a lot more reference
      images too.
      
      Instead, I chose to iterate separately through all output scales & transforms
      (this patch) and all buffer scales & transforms (next patch). This limits the
      number of test cases in this patch to 56, and allows the two test programs to
      run in parallel.
      
      I did not even pick all possible scale & transform combinations here, but just
      what I think is a representative sub-set to hopefully exercise all the code
      paths.
      
      wayland/weston#52Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      97359ba5
  17. 27 Feb, 2020 5 commits
    • Pekka Paalanen's avatar
      tests: expand allowed pixel fuzz for GL · 20026a55
      Pekka Paalanen authored
      Running with Mesa 20.1.0-devel (git-c7617d8908) GL renderer:
      Radeon RX 550 Series (POLARIS11, DRM 3.27.0, 4.19.0-2-amd64, LLVM 8.0.1)
      
      I found output-tranform test (a future patch) to produce exactly this much more
      difference between Pixman and GL rendererers.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      20026a55
    • Pekka Paalanen's avatar
      tests: implement client_destroy() · 080d85b8
      Pekka Paalanen authored
      It turns out that if the client is not explicitly destroyed, it will remain
      connected until the compositor shuts down because there is no more a client
      process that would terminate.
      
      Usually this is not a problem, but if a test file has multiple screenshooting
      tests, the windows from earlier tests in the file will remain on screen. That
      is not wanted, hence implement client destruction.
      
      To properly destroy a client, we also need a list of outputs. They used to be
      simply leaked. This does not fix wl_registry.global_remove for wl_outputs, that
      is left for a time when a test will actually need that.
      
      This patch makes only ivi-shell-app test use the new client_destroy() to show
      that it actually works. The added log scopes prove it: destroy requests get
      sent. Sprinkling client_destroy() around in all other tests is left for a time
      when it is actually necessary.
      
      ivi-shell-app is a nicely simple test doing little else, hence I picked it.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      080d85b8
    • Pekka Paalanen's avatar
      tests: re-order test naming pattern · 444f1a8e
      Pekka Paalanen authored
      The string from get_test_name() can be used for writing screenshot files and
      others. Starting the name with the fixture number makes an alphabetized listing
      of output files look unorganized.
      
      Let's change the test name to begin with the test (source) name with fixture
      and element numbers as suffixes. That makes a file listing easier to look
      through, when you have multiple tests each saving multiple screenshot files.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      444f1a8e
    • Pekka Paalanen's avatar
      tests: add get_test_fixture_index() · 1eb30468
      Pekka Paalanen authored
      A future test wants to access the fixture data array for the currently running
      fixture index to log the test description. This patch provides access to the
      array index.
      
      Rather than adding more gloabl variables, I changed the type of the existing
      one which feels slightly cleaner.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      1eb30468
    • Pekka Paalanen's avatar
      tests: add scale and transform compositor options · 0ce5a19b
      Pekka Paalanen authored
      With these, a test can initialize the headless-backend with non-default scale
      and transform which allows testing output scales and transforms.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      0ce5a19b