summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-11-27screenshooter: stop using frame_signal void *data parameter to get weston_outputLeandro Ribeiro1-2/+4
Instead of getting weston_output from the frame_signal argument 'void *data', add weston_output in the private data struct of the users that are listening to frame_signal. With this change we are able to pass previous_damage as the data argument. Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2019-11-27move frame_signal emission to weston_output_repaint()Leandro Ribeiro3-2/+1
In order to remove duplication and make the code easier to follow, move frame_signal emission from renderers to weston_output_repaint(). This should have no observable effect. Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2019-11-25gl-renderer: Add support for XYUV format (v2)Vivek Kasireddy2-1/+39
Accept XYUV dmabuf buffers that a client application such as weston-simple-dmabuf-v4l might submit. v2 (Daniel): Add XYUV to yuv_formats array to have the compositor color convert with a shader if GL_TEXTURE_EXTERNAL_OES does not work. Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
2019-11-25gl-renderer: Replace EGL_*_WL macros with locally defined enumsVivek Kasireddy1-8/+14
Instead of using the EGL_*_WL macros imported from EGL headers, start using enums that would be defined locally. This is needed as there are limited number of macros defined in EGL headers and adding new ones is not practically feasible when adding a new texture type. (suggested by Daniel Stone) Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
2019-11-25desktop-shell: Set 1x1 buffers for solid-color backgroundsHarish Krupo1-0/+6
When we are going to set a solid color for the background, use a 1x1 buffer and set the viewport to the full size. This avoids un-necessary allocation of buffer memory. Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
2019-11-25clients/window: Add viewport destination supportHarish Krupo3-4/+82
Add support for setting the widget's destination wp viewport. Setting it in the widget instead of being set directly by the client ensure that the widget can be identified in widget_find_widget. v2: Return -1 on error (Pekka) Scale allocated x and y when viewport is set (Pekka) Allow user to set -1 for viewport width and height (Pekka) v3: Use NULL instead of 0 (Daniel) return 0 if width and height are -1 (Daniel) Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
2019-11-25clients/fullscreen: Refuse to resize the surface size when fullscreen'edMarius Vlad1-0/+3
This would be causing a protocol error in which the buffer size needs to match the one provided in the configure event. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-11-25doc/scripts/gdb: Added gdb script to dump contents of the flight recorderMarius Vlad1-0/+103
Mimics the C version that displays the contents of the flight recorder. With a core-dump in place source the python file then call 'display_flight_rec' to dump the data. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-11-25weston-log-flight-rec: Fix useless comparison when displaying theMarius Vlad1-1/+1
contents of the flight recorder The overlap variable is sufficient to determine from where to start displaying the contents of the ring buffer. Also redundant to verify if the position in the buffer went over the maximum size. Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Reported-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-25weston-log-flight-rec: Don't allow more than one flight recorder to beMarius Vlad1-0/+3
created Having a (single) global variable which others depend on it implies having a single flight recorder present. Until we have a reason to support multiple flight recorders limit the amount to a maximum of one. Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Reported-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-25weston-log-flight-rec: Add a global variable to access the ring bufferMarius Vlad2-9/+47
With it add also a function which can be used in an assert()-like situation to display the contents of the ring buffer. Within gdb this call also be called if the program is loaded/still loaded into memory. The global variable will be used in a later patch to be accessed from a python gdb script. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-11-25simple-dmabuf-egl: make application genericVeeresh Kadasani1-5/+26
Don't exit if EGL_KHR_no_config_context extension is not supported Signed-off-by: Veeresh Kadasani <external.vkadasani@jp.adit-jv.com>
2019-11-25config-parser: Export get_full_path and destroyDaniel Stone1-0/+2
Make sure we export the get_full_path() accessor (declared in the header, used by Weston itself) and the parser's destroy function. Signed-off-by: Daniel Stone <daniels@collabora.com>
2019-11-25libweston: do not include weston.hPekka Paalanen1-1/+0
Libweston is not allowed to depend on Weston. Fortunately this include is unnecessary and can be simply removed. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-23backend-drm: remove unnecessary ifdefsLeandro Ribeiro1-4/+0
Remove unnecessary ifdefs for DRM_MODE_CONNECTOR_DSI, DRM_MODE_CONNECTOR_DPI. They are both provided by libdrm and were introduced long before 2.4.83 (the lowest version we currently support). Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2019-11-23backend-drm: remove unecessary ifdef checksLeandro Ribeiro3-40/+0
Since commit 28d26483 ("build: bump libdrm requirement to newer version (2.4.83)"), all supported libdrm versions provide modifier formats, atomic API and blob formats. Remove ifdef checks (HAVE_DRM_ADDFB2_MODIFIERS, HAVE_DRM_ATOMIC, HAVE_DRM_FORMATS_BLOB) to improve the code and make it simpler. Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2019-11-23build: bump libdrm requirement to newer version (2.4.83)Leandro Ribeiro1-1/+1
There are some features that are available only if the user's libdrm version is not too old: format modifiers require at least libdrm 2.4.71, atomic API at least 2.4.78 and blob formats at least 2.4.83. Bump libdrm to 2.4.83 (the oldest version that support these features) in order to be able to remove ifdef checks and simplify the code. Major distributions already support libdrm 2.4.91, so it's safe to apply this commit. Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2019-11-22backend-drm: Further checks to skip plane assignment to HW planesMarius Vlad1-0/+18
Mode change from mixed-mode to renderer-only means we should no longer try to place views in HW planes (as we composite everything into the primary plane) thus we should avoid that whenever that happens. In the same time we need to be able to place in mixed-mode/renderer-only mode the cursor view into the cursor plane (if one is available). This patch adds a further check to skip plane assignment when disabling overlay support (when we switch to renderer-only mode), when drivers do not have atomic-modeset or it has been disabled intentionally. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-11-22backend-drm: Turn zpos duplicate check into an hard assertMarius Vlad1-16/+5
This way we make sure we find out (if we have assigned invalid zpos values) much faster. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-11-22backend-drm: Skip testing plane state if plane is not enabledMarius Vlad1-0/+6
Adds a further assert() to make sure we're not checking against invalid values. This was seen in the wild when the kernel rejects the commit for overlay resulting in a check for invalid zpos values. Fixes: #304 Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-11-22backend-drm: Assign the primary plane the lowest zpos valueMarius Vlad1-0/+19
when switching to mixed-mode of compositing This way we avoid an (incorrect) duplicate check of zpos values. Also, this would be needed because the renderer needs have the lowest zpos value available as we don't (yet) properly support underlays, the primary plane serves as our renderer. Adds also a check to see if we try to assign a view to a plane with a lower zpos value than the one assigned to the primary when switching to mixed-mode of compositing. Fixes: #304 Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-11-22tests: drop FAIL_TESTPekka Paalanen2-14/+8
Nothing is using FAIL_TEST or FAIL_TEST_P and that is good. Remove them to not encourage using them. If we need a test that should fail, it always needs to fail in a very specific way which needs to be checked. For this we have e.g. expect_protocol_error(). We never want a fail-test to pass because it failed in a way we did not expect. Therefore these macros are useless. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-22tests/ivi: rename test_sectionPekka Paalanen1-4/+5
Use a different section name to make sure that if this plugin is loaded into the same process as where weston-test-runner.h is used, the two different sections cannot get mixed up. This is just a precaution, but it removes a bit of reader confusion as well. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-22tests: rename struct weston_test to weston_test_entryPekka Paalanen2-10/+11
This avoids confusing it with the opaque struct weston_test from protocol/weston-test.xml. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-22tests/xwayland: do not call exit(SUCCESS)Pekka Paalanen1-1/+0
Successful tests should just return, not call exit() which breaks the new test harness when it uses TAP. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-22tests: replace fprintf() with testlog()Pekka Paalanen12-71/+78
When we move on to TAP, stdout will be reserved for TAP and stderr is for free chatter. Set up an example that tests should use testlog() instead of fprintf or printf to chat in the right place. Most statements were already printing to stderr, so this just makes then a little shorter. There are also some statements that printed to stdout and are now corrected. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-22tests/subsurface-shot: hardcode reference image namesPekka Paalanen1-6/+5
Using the test name for the reference images will stop working when the new test harness starts using fixtures. Fixtures allow running the same tests in varying environments, so the test results file names will include fixture index. However the reference images will remain the same for all fixtures. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-22tests: write image to current directory by defaultPekka Paalanen1-1/+1
This reverts 50b7b708352dbf0d6670d9ae5668e3c215e28662. We didn't make Meson create a logs directory, so writing the images fails because the directory does not exist. If you run a test without Meson, there is even less expectation that it would write somewhere else than CWD by default. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-21clients: Add more sanity checks to catch destroyed windowJeffy Chen1-0/+10
Add a sanity check to touch_handle_down() and data_device_enter() as what we did for pointer and keyboard. Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2019-11-21clients: Drop corresponding touch points when destroying windowsJeffy Chen1-1/+11
This is to avoid memory leaking of these touch points. Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2019-11-21xwm: Use Xwayland allow commits for repaintOlivier Fourdan1-1/+11
Initially, `_XWAYLAND_ALLOW_COMMITS` was introduced in commit 7ace831ca to avoid drawing the window content before it's ready to be shown. But a repaint might also be triggered by the client damages before the XWM has finished drawing its window decorations and drop shadows, which previously was not too much of an issue since the XWM could still finish updating the X11 window after the buffer was submitted. However, with the addition of multiple window buffers in Xwayland [1] which are aimed at preventing the X11 clients from updating the buffer after it's been committed, this is no longer possible. As a result, the use of multiple window buffers in Xwayland can cause ugly repainting effects of the decorations if the buffer is submitted before the XWM has finished painting its decorations. Use the X11 property `_XWAYLAND_ALLOW_COMMITS` can be used to avoid this, by controlling when Xwayland should commit changes to the Wayland surface. [1] https://gitlab.freedesktop.org/xorg/xserver/merge_requests/316 Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2019-11-21compositor: allow double-loading modulesPekka Paalanen1-9/+7
This is necessary for the test harness to be able to execute the compositor multiple times in the same process. As we never unload opened modules, the first compositor iteration will leave them all loaded and following compositor iterations will then have them already loaded. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-21libweston: allow double-loading modulesPekka Paalanen1-9/+7
This is necessary for the test harness to be able to execute the compositor multiple times in the same process. As we never unload opened modules, the first compositor iteration will leave them all loaded and following compositor iterations will then have them already loaded. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-21Use weston_compositor_add_destroy_listener_once() in pluginsPekka Paalanen15-30/+125
This introduces a new convention of checking through the compositor destroy listener if the plugin is already initialized. If the plugin is already initialized, then the plugin entry function succeeds as a no-op. This makes it safe to load the same plugin multiple times in a running compositor. Currently module loading functions return failure if a plugin is already loaded, but that will change in the future. Therefore we need this other method of ensuring we do not double-initialize a plugin which would lead to list corruptions the very least. All plugins are converted to use the new helper, except: - those that do not have a destroy listener already, and - hmi-controller which does the same open-coded as the common code pattern did not fit there. Plugins should always have a compositor destroy listener registered since they very least allocate a struct to hold their data. Hence omissions are highlighted in code. Backends do not need this because weston_compositor_load_backend() already protects against double-init. GL-renderer does not export a standard module init function so cannot be initialized the usual way and therefore is not vulnerable to double-init. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-21colord: remove destroy listener on clean-upPekka Paalanen1-0/+1
This was forgetting to remove the compositor destroy listener, which would lead to use-after-free on compositor tear-down especially on cms-colord init failure paths. Found by inspection. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-21ivi-shell: fix init error pathPekka Paalanen1-0/+1
This was forgetting to remove the compositor destroy listener if init failed, which would lead to use-after-free on compositor tear-down. Found by inspection. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-21tests: fix test-shell init error pathPekka Paalanen1-0/+1
This was forgetting to remove the compositor destroy listener if init failed, which would lead to use-after-free on compositor tear-down. Found by inspection. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-21tests: remove static data from presentationPekka Paalanen1-7/+8
While get_presentation() will only ever be called once (making the caching of the return value moot), it is good to stop using the static variable as it would cause surprising problems if anyone adds more tests here and runs it under the new test harness. It was leaked before and continues to be so. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-21tests: remove static data from ivi-layout-test-clientPekka Paalanen1-28/+57
Using static data will mess things up when the test harness no longer fork()'s each sub-test. Hence it needs to be converted to "normal" data. Unfortunately here the cached value was actually used, so keeping that behaviour is a handful. Yes, it was all leaked also before. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-21tests: remove static data from ivi-shell-app-testPekka Paalanen1-4/+1
Just one test call this only once, so the cached value will never be useful. Stop using static data, it sets a bad example. If more tests were added, things would start failing when forking is removed from the test harness. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-21tests: remove static data from ivi-layout-test-pluginPekka Paalanen1-19/+24
I cannot see any reason why this should be static data. But if it is static data, it will prevent re-entering wet_main() to run tests with this plugin, so replace it with "normal" data. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-21tests: remove static data from viewporterPekka Paalanen1-4/+1
This caching is actually never hit. I tested by making the early return abort() instead and all works just fine. Remove the caching. The static variable will cause problems when we stop fork()'ing for each test case. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-21clients/simple-dmabuf-drm: Make use of direct-displayMarius Vlad2-2/+22
Uses weston-direct-display extension. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-11-21clients/simple-dmabuf-egl: Make use of direct-displayMarius Vlad2-5/+27
Uses weston-direct-display extension. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-11-21renderer-gl: Display a solid shader color when direct-display is in useMarius Vlad1-1/+10
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-11-21renderer-gl: Avoid retrieving the EGL image it direct_display flag was setMarius Vlad1-5/+14
As we avoid importing the buffer in the GPU, when attaching the buffer we'll not have a valid image to retrieve it from, and as such we'll avoid touching and setting the surface state shader. This adds also 'direct_display' to the surface state and with it, sets the surface state 'direct_display' member whenever the imported buffer will have the direct-display member set. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-11-21backend-drm: Add dmabuf scan-out check for DRM-backendMarius Vlad3-0/+28
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-11-21libweston: Add the ability to determine if a dmabuf is scanout-capableMarius Vlad4-0/+37
Adds a new callback 'can_scanout_dmabuf' in weston_backend, which can be set by the back-end do determine if the buffer supplied can be imported directly by KMS. This patch adds a wrapper over it, 'weston_compositor_dmabuf_can_scanout' which is called before importing the dmabuf in the GPU if the direct_display dmabuf is being set. If that's true and the check failed, we refuse to create a wl_buffer. This patch avoids importing in the GPU. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-11-18libweston: Add weston-direct-display server side implementationMarius Vlad4-0/+104
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-11-18protocol: Add weston-direct-display extensionMarius Vlad2-0/+84
Weston extension to assure clients that the dmabuf buffer will be forwarded directly to the display controller. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>