summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* pixman-renderer: half-fix bilinear sampling on edgesPekka Paalanen2020-03-111-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: https://gitlab.freedesktop.org/wayland/weston/issues/373 Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* compositor: Fail on invalid transform for headlessDaniel Stone2020-03-111-1/+1
| | | | | | | | | | | | As in aaf35586f471, 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 <daniels@collabora.com>
* tests: print image difference statisticsPekka Paalanen2020-03-101-6/+38
| | | | | | | | | When a test fails and it produces a difference image, also compute the min/max per-channel signed difference statistics. These numbers can be used to adjust the fuzz needed for fuzzy_match_pixels() to pass. Otherwise one would have to manually inspect the reference and result images and figure out the values. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* compositor: Use weston_head transform for output defaultDaniel Stone2020-03-061-2/+7
| | | | | | | | | | | If the output only has a single weston_head attached to it, take its declared transform as the default transform. With the previous patches, this allows a device declaring the KMS 'panel orientation' property (e.g. through DeviceTree) to autoconfigure to the correct display rotation when running Weston. Signed-off-by: Daniel Stone <daniels@collabora.com>
* backend-drm: Parse KMS panel orientation property, apply to weston_headLucas Stach2020-03-063-0/+47
| | | | | | | | | | | The KMS 'panel orientation' property allows the driver to statically declare a fixed rotation of an output device. Now that weston_head has a transform member, plumb the KMS property through to weston_head so the compositor can make a smarter choice out of the box. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> [daniels: Extracted from one of Lucas's patches] Signed-off-by: Daniel Stone <daniels@collabora.com>
* libweston: Add transform to weston_headLucas Stach2020-03-063-0/+51
| | | | | | | | | | | | Like physical size, subpixel arrangement, etc, transform advises of a physical transform of a head, if present. This commit adds the transform member and setter to weston_head, however it is currently unused. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> [daniels: Extracted from one of Lucas's patches.] Signed-off-by: Daniel Stone <daniels@collabora.com>
* compositor: Fail output configuration on invalid transformDaniel Stone2020-03-061-8/+29
| | | | | | | | | | | If an invalid transformation is provided for an output, fail the output configuration rather than continuing on using whatever we chose as the default transform. After !383, this will result in configurations using the old definition failing and exiting, rather than continuing on the wrong way around. Signed-off-by: Daniel Stone <daniels@collabora.com>
* compositor: Fix default transforms when output section declaredDaniel Stone2020-03-061-3/+4
| | | | | | | | | | | | | | Regardless of the default transform passed in, weston_parse_transform would always return 'normal' if there was an output section. This is because, if a section was declared for that output, it would ask weston_config for the transform, with the default being 'normal'. Fix it so we return the passed-in default transform when we have a matching output section without a transform key. If the transform is declared but invalid, we can remove the line resetting to the default transform, because we've already set the default transform up top. Signed-off-by: Daniel Stone <daniels@collabora.com>
* backend-rdp: enable undefined functions errors.Guillaume Champagne2020-03-051-1/+0
| | | | | | | | | b_lundef was overriden for the RDP backend since it triggered linking errors due to functions that were defined in a missing dependency. This issue was fixed, so the override is removed. The global project's linker parameters are now applied to the RDP backend. Signed-off-by: Guillaume Champagne <champagne.guillaume.c@gmail.com>
* backend-rdp: fix unresolved symbols errorsGuillaume Champagne2020-03-051-0/+6
| | | | | | | | | | | | The RDP backend uses functions defined by the Windows Portable Runtime library (WinPR). The library's code is contained within FreeRDP repository, but it is packaged as its own library (seperate pkg-config file). WinPR is added as a dependency to the RDP backend. The version 2.0 is choosen as the version to on since the backend depends on FreeRDP 2.0. Signed-off-by: Guillaume Champagne <champagne.guillaume.c@gmail.com>
* tests: add buffer transform testsPekka Paalanen2020-02-2826-0/+138
| | | | | | | | | | | 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". https://gitlab.freedesktop.org/wayland/weston/issues/52 Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* tests: add output transform testsPekka Paalanen2020-02-2833-0/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. https://gitlab.freedesktop.org/wayland/weston/issues/52 Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* tests: expand allowed pixel fuzz for GLPekka Paalanen2020-02-271-1/+1
| | | | | | | | | | 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 <pekka.paalanen@collabora.com>
* tests: implement client_destroy()Pekka Paalanen2020-02-273-4/+91
| | | | | | | | | | | | | | | | | | | | | | | 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 <pekka.paalanen@collabora.com>
* tests: re-order test naming patternPekka Paalanen2020-02-271-7/+7
| | | | | | | | | | | | 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 <pekka.paalanen@collabora.com>
* tests: add get_test_fixture_index()Pekka Paalanen2020-02-272-7/+33
| | | | | | | | | | | 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 <pekka.paalanen@collabora.com>
* tests: add scale and transform compositor optionsPekka Paalanen2020-02-272-0/+38
| | | | | | | 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 <pekka.paalanen@collabora.com>
* compositor: add scale cmdline option for headlessPekka Paalanen2020-02-271-0/+2
| | | | | | | The test suite wants to start using different output scales, and this is the easiest API to configure it. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* tests: allow verify_screen_content() w/o ref imagePekka Paalanen2020-02-271-15/+27
| | | | | | | | | | Allow the reference image to be NULL or missing so that it does not even attempt to load a reference image or compare it. You cannot just point the reference image to an arbitrary image because the comparison functions can abort due to size mismatch. This makes bootstrapping new tests easier when you do not yet have a reference image. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* tests: rename check_screen() to verify_screen_content() + docPekka Paalanen2020-02-273-14/+53
| | | | | | | | The old name felt too... short. The return type is changed to bool; fits better for a success/failure. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* tests: move check_screen() into client helpersPekka Paalanen2020-02-273-65/+73
| | | | | | | | | | This will be useful in more tests. No changes to the code, aside from dropping one 'static'. Copyright 2017 is taken from git-blame of the moved code. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* Redefine output rotationsPekka Paalanen2020-02-278-84/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was discovered in issue #99 that the implementations of the 90 and 270 degree rotations were actually the inverse of what the Wayland specification spelled out. This patch fixes the libweston implementation to follow the specification. As a result, the behaviour of the the weston.ini transform key also changes. To force all users to re-think their configuration, the transform key values are also changed. Since Weston and libweston change their behaviour, the handling of clients' buffer transform changes too. All the functions had their 90/270 cases simply swapped, probably due to confusion of whether WL_OUTPUT_TRANSFORM_* refers to rotating the monitor or the content. Hint: a key to understanding weston_matrix_rotate_xy(m, c, s) is that the rotation matrix is formed as c -s s c that is, it's column-major. This fooled me at first. Fixing window.c fixes weston-terminal and weston-transformed. In simple-damage, window_get_transformed_ball() is fixed to follow the proper transform definitions, but the fix to the viewport path in redraw() is purely mechanical. The viewport path looks broken to me in the presence of any transform, but it is not this patch's job to fix it. Screen-share fix just repeats the general code fix pattern, I did not even try to understand that bit. https://gitlab.freedesktop.org/wayland/weston/issues/99 Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* libweston: document weston_transformed_*()Pekka Paalanen2020-02-271-0/+53
| | | | | | | Clarifies which direction the transformation happens. All exported function need documentation. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* clients: transformed does not recognize -dPekka Paalanen2020-02-271-1/+0
| | | | | | It has no such command line option. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* ivi-application: fix grammarVeeresh Kadasani2020-02-261-6/+6
| | | | Signed-off-by: Veeresh Kadasani <external.vkadasani@jp.adit-jv.com>
* fullscreen-shell/fullscreen-shell.c: prevent seat_created() from being ↵ahe2020-02-261-1/+1
| | | | called with l == NULL
* Revert "CI: do not attempt to test GL-renderer"Pekka Paalanen2020-02-181-1/+0
| | | | | | | | | | This reverts commit 1eae54714fd2ae38756b24ddc58a7d55bec5d14d. We install a fixed Mesa into the CI image, so these tests can pass now. Fixes: https://gitlab.freedesktop.org/wayland/weston/issues/358 Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* CI: build a Mesa shapshot for getImage/putImage on pbuffer swrastPekka Paalanen2020-02-182-1/+32
| | | | | | | https://gitlab.freedesktop.org/mesa/mesa/commit/c7617d8908a970124321ce731b43d5996c3c5775 is necessary for running GL-renderer with llvmpipe in Gitlab CI. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* gl-renderer: Move EGL display creation to egl-glue.cScott Anderson2020-02-183-23/+40
| | | | | | It makes more sense for it to be there instead. Signed-off-by: Scott Anderson <scott.anderson@collabora.com>
* gl-renderer: Move platform extension checks to EGL client setupScott Anderson2020-02-183-101/+71
| | | | | | This removes the duplicate checks for EGL_EXT_platform_base. Signed-off-by: Scott Anderson <scott.anderson@collabora.com>
* gl-renderer: Move get_platform_display to EGL client setupScott Anderson2020-02-183-21/+14
| | | | | | | | This is to put more of the EGL client extension handling in the same place. This also adds a boolean to check if EGL_EXT_platform_base is supported, similar to other extensions we check. Signed-off-by: Scott Anderson <scott.anderson@collabora.com>
* gl-renderer: Move EGL client extension handling earlierScott Anderson2020-02-183-4/+7
| | | | | | | | | EGL client extensions are not tied to the EGLDisplay we create, and have an effect on how we create the EGLDisplay. Since we're using this to look for EGL_EXT_platform_base, it makes more sense for this to be near the start of the GL renderer initialization. Signed-off-by: Scott Anderson <scott.anderson@collabora.com>
* clients/window: fail earlier when frame_create failsSimon Ser2020-02-101-0/+4
| | | | | | | This adds a new NULL check to fail earlier when frame_create fails. This can happen because PNG files couldn't be loaded from the data directory. Signed-off-by: Simon Ser <contact@emersion.fr>
* weston-log-wayland: make stream_destroy() use weston_log_subscriber_release()Leandro Ribeiro2020-02-103-40/+5
| | | | | | | | | | | | | | | | | Make stream_destroy() use weston_log_subscriber_release(). This avoids code duplication and allow us to destroy weston_log_subscriber_get_only_subscription(), since it's being used only in this case and it's internal. Calls for weson_log_subscriber_release() leads to weston_log_debug_wayland_to_destroy(), which should not send an error event when the stream has already been closed. Also, stream_destroy() shouldn't lead to an event error, as it is a wl_resource destroy handler. So close the stream before calling weston_log_subscriber_release() in stream_destroy() Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
* compositor: destroy log context only after the destruction of subscribersLeandro Ribeiro2020-02-101-1/+1
| | | | | | | | | | | | | Before commit "weston-log: destroy subscriptions with destruction of subscribers", we had to destroy subscribers before the log context. Currently there's no required order, both are valid. But since we've created log context before the subscribers, we can destroy it after them. This is a style change and also a prove that now this order is valid as well. Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
* weston-log: share code between weston_log_scope_destroy() and ↵Leandro Ribeiro2020-02-101-13/+5
| | | | | | | | | | | weston_log_subscriber_release() Both weston_log_scope_destroy() and weston_log_subscriber_release() have calls for destroy_subscription(). We can move this call to weston_log_subscription_destroy() without losing anything and avoiding repetition. Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
* weston-log: destroy subscriptions with destruction of subscribersLeandro Ribeiro2020-02-104-0/+21
| | | | | | | | | | | | The subscription is directly related to both the log scope and the subscriber. It makes no sense to destroy one of them and keep the subscriptions living. We only had code to destroy subscription with the destruction of log scopes. Add code to destroy subscriptions with destruction of subscribers. Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
* weston-log: merge functions that destroy different types of subscribersLeandro Ribeiro2020-02-107-45/+49
| | | | | | | | | | | | | | Log subscriber API is not type-safe. File and flight recorder subscribers are created with functions that return weston_log_subscriber objects. But there's a problem: to destroy these objects you have to call the right function for each type of subscriber, and a user calling the wrong destroy function wouldn't get a warning. Merge functions that destroy different types of subscribers, making the log subscriber API type-safe. Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
* weston-log: rename weston_log_subscriber::destroy to destroy_subscriptionLeandro Ribeiro2020-02-105-6/+6
| | | | | | | | | | | | | weston_log_subscriber has a member named destroy. There are other structs (weston_output, for instance) that have this member, and by convention it is a pointer to a function that destroys the struct. In weston_log_subscriber it is being used to destroy subscriptions of the debug protocol, and not the subscriber, so this name is misleading. Rename it to destroy_subscription. Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
* build: add rpath to modules that use symbols from libexec_westonPhilipp Zabel2020-02-063-5/+10
| | | | | | | | | | | | | | | The cms-static, desktop-shell, hmi-controller, ivi-shell, and screen-share modules use symbols from libexec_weston, e.g.: $ ldd /usr/lib/x86_64-linux-gnu/weston/desktop-shell.so | grep "not found" libexec_weston.so.0 => not found Loading these modules from weston happens to work because the weston executable itself links against libexec_weston, and has an rpath set. Still, these modules depend on a library in a non-standard location. Adding an rpath could help static checkers to make sure all shared objects' dependencies are present. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
* tests: run subsurface-shot on GL tooPekka Paalanen2020-02-051-8/+6
| | | | | | | | | | | | | | | | | This adds the necessary fuzz to image matching to let GL-renderer pass. The difference is due to rounding. weston-test-desktop-shell.c uses weston_surface_set_color(dts->background_surface, 0.16, 0.32, 0.48, 1.); to set the background color. Pixman-renderer will truncate those to uint8, but GL-renderer seems to round instead, which causes the +1 in background color channel values. 0.16 * 255 = 40.8 0.32 * 255 = 81.6 0.48 * 255 = 122.4 Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* CI: do not attempt to test GL-rendererPekka Paalanen2020-02-051-0/+1
| | | | | | | | | Because of https://gitlab.freedesktop.org/mesa/mesa/issues/2219 it would crash, so disable GL-renderer. https://gitlab.freedesktop.org/wayland/weston/issues/358 shall revert this. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* build: add test-gl-renderer optionPekka Paalanen2020-02-053-0/+15
| | | | | | | | | This shall be used by CI due to https://gitlab.freedesktop.org/mesa/mesa/issues/2219 It defaults to true, meaning that people by default will be running the GL-renderer tests. It works fine on hardware drivers, just not llvmpipe. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* tests: add range argument for fuzzy image matchingPekka Paalanen2020-02-054-12/+71
| | | | | | | | | The fuzzy range will be used with GL-renderer testing, as it may produce slightly different images than Pixman-renderer yet still correct results. Such allowed differences are due to different rounding. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* weston-log-flight-rec: allow re-running a compositorPekka Paalanen2020-02-051-1/+8
| | | | | | | | | | | | weston_primary_flight_recorder_ring_buffer needs to be cleared on destruction of the subscriber it was assigned from so that a compositor and be re-executed in-process (static variables do not get re-initialized automatically). This will be used by the test harness when it will execute wet_main() multiple times in the same process. Otherwise it would hit the assert in weston_log_subscriber_create_flight_rec(). Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* shared: guard all the seal logic behind HAVE_MEMFD_CREATESebastian Wick2020-02-051-6/+9
| | | | | | | | | | The initial version of os_ro_anonymous_file missed two guards around the seal logic which leads to a compilation error on older systems. Also make the check for a read-only file symmetric in os_ro_anonymous_file_get_fd and os_ro_anonymous_file_put_fd. Signed-off-by: Sebastian Wick <sebastian@sebastianwick.net>
* tests: release resources on compositor destructionGuillaume Champagne2020-02-041-1/+7
| | | | | | | Releases touch devices and seat if they were allocated, clean up the layers and free the weston_test structure. Signed-off-by: Guillaume Champagne <champagne.guillaume.c@gmail.com>
* headless: fix uninitialized variableGuillaume Champagne2020-02-041-1/+1
| | | | | | | `no_outputs` is declared on the stack and left uninitialized if no weston option changing its value is provided. Signed-off-by: Guillaume Champagne <champagne.guillaume.c@gmail.com>
* gl-renderer: Avoid double-free on init failureDaniel Stone2020-02-031-0/+1
| | | | | | | | | | | If gl-renderer fails its initialisation, we return to compositor teardown, which will try to free the renderer if ec->renderer was set. This is unfortunate when we've already torn it down whilst failing gl-renderer init, so just clear the renderer member so we don't try to tear down twice. Signed-off-by: Daniel Stone <daniels@collabora.com> Reported-by: Emil Velikov <emil.velikov@collabora.com>
* gl-renderer: Fail earlier if shader compilation failsDaniel Stone2020-02-031-0/+4
| | | | | | If we can't compile our shaders, there's no point trying to link them. Signed-off-by: Daniel Stone <daniels@collabora.com>