- 26 Apr, 2018 1 commit
-
-
Pekka Paalanen authored
Looking at the diff statistics of the changes authored by me and landed since 4.0.0 release points out these files as having major changes. Update the copyright holders accordingly, as both clone mode and touchscreen calibration related patches are copyright both Collabora and GE. I have kept the redundant "Copyright ©" form only to keep things consistent, even when either the word or the mark would be enough. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Acked-by:
Ian Ray <ian.ray@ge.com> Reviewed-by:
Daniel Stone <daniels@collabora.com>
-
- 20 Apr, 2018 11 commits
-
-
Pekka Paalanen authored
Add test_seat_release() as the counterpart of test_seat_init() instead of open-coding it. This helps adding more code to test_seat_release() later. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Pekka Paalanen authored
Commit c81c4241 added this environment variable. Document it. It applies also to the fbdev-backend but that has no man page. v2: - Rewording by Peter Hutterer. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Pekka Paalanen authored
If an input device is associated to an output that then gets disabled, there is no case where associating to a different output would be correct. The output association is used for absolute positioned input devices, and an input device like a touchscreen cannot ever be automatically valid for more than one possible output - the touchscreen display device. Therefore do not automatically reassing implicitly associated input devices to another output. This removes some log spam on shutdown. In fact, if there can be more than one output at any time, absolute input devices must be explicitly configured to associate with the correct output, or the results are essentially undefined in any case. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Pekka Paalanen authored
The use case driving this change is a clone mode setup, where the user is hotplugging or unplugging a cloned touchscreen. Even if the output and head are force-enabled, the touch device should still follow the connector connection status. If there is no video signal for the touchscreen (disconnected connector), then the touch input should be ignored as well. When the output is force-enabled, we need to trigger output_heads_changed from connector status changes. If the head or output are not force-enabled, the compositor will likely attach and detach the head as appropriate. In clone mode, the attach or detach needs to trigger output_heads_changed directly. In other cases, it may be handled through the output getting enabled or disabled which are different signals. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Pekka Paalanen authored
Associating input devices with weston_outputs by the output name fails when one output has several heads. We need to match against head names instead of output names to be able to find all names. This fixes touchscreen output association in shared-CRTC clone mode when outputs or input devices appear or disappear. Even though notify_output_create() is called only when new outputs appear, the implementation is prepared to also remove output associations. This will be handy in the future when this function will handle also head detaching from an output that remains enabled. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Pekka Paalanen authored
Removing the output association from an evdev_device is more than just setting the pointer to NULL, one also needs to remove the destroy listener and flag the destroy listener as unused (notify == NULL). evdev_device_set_output() can already remove associations, so let it also handle an assignment to NULL output. Fix notify_output_destroy() to handle removing an association correctly. Previously, the listener was left "used", which would mean the next call to evdev_device_set_output() would have wl_list_remove()'d, accessing freed memory. This could be triggered by having a touchscreen with a specified output association, and unplugging then re-plugging the corresponding output. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Pekka Paalanen authored
In the future evdev_device_set_output() will start getting called more often, redundantly. Short-circuit the setting if the chosen output is already set for an input device. This reduces churn in the logs. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Pekka Paalanen authored
Helps admins ensure the configuration is correct. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Pekka Paalanen authored
The udev property WL_CALIBRATION is an old way of giving Weston a touchscreen calibration matrix. It is Weston-specific. The recommended way of setting up a calibration is to use the udev property LIBINPUT_CALIBRATION_MATRIX, which libinput will load automatically and therefore applies to all libinput using display servers and applications. The syntax of WL_CALIBRATION and LIBINPUT_CALIBRATION_MATRIX is different as well: WL_CALIBRATION uses pixels as the translation part units, which makes the values depend on the output resolution. LIBINPUT_CALIBRATION_MATRIX on the other hand uses normalized units. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Pekka Paalanen authored
Print a note that calibration got skipped if the input device supports a calibration matrix but there is no associated output to compute it from. Helps with debugging touchscreen calibration issues. The code is reorganized and commented a bit, but this does not change the behaviour. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Pekka Paalanen authored
Struct 'evdev_device' has field 'devnode' which is initialized to NULL, never assigned, and finally free()'d. Therefore it is useless. Remove the dead field. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
- 18 Apr, 2018 17 commits
-
-
Pekka Paalanen authored
The head was just zalloc()'d, there is no need to memset it to zero. If a function fails, it is preferable it leaves the output arguments untouched. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
Pekka Paalanen authored
Rename connector_get_current_mode() because it will be useful for storing not just the current mode on creating a head. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
Pekka Paalanen authored
Stop using a head for printing the mode list, because there could be multiple heads. We already gather the mode list from all heads. No need to print the connector id here, because it is logged with DRM heads, and core prints the head names on output enable. The "built-in" flag seemed dead, because it could only be printed if the kernel provided no modes. If we want more detailed info on where modes come from, we would need to inspect mode_info or add new flags to drm_mode or weston_mode. Add printing the pixel clock, because that is used by the video mode duplicate removal code. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
Pekka Paalanen authored
If an output has multiple (cloned) heads, it should be enough for any head to support backlight control for DRM-backend to expose it. Inspect all attached heads for backlight control and improve the logging. Pick the initial backlight level from whatever happens to be the "first" head, because it's simple. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
Pekka Paalanen authored
A single list of modes needs to be combined from the mode lists in each attached head. We could just concatenate the lists, but that might introduce duplicates. Try to avoid duplicates instead by using partially fuzzy matching. When a duplicate is found, try to figure out which is more suitable to use in place of both. If one has the preferred flag and the other doesn't, take the preferred one. Otherwise use the one already in the list. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
Pekka Paalanen authored
Previously the log contained one line for EDID data and another line for the head, and you just had to know they belong together. Make it more obvious to read by putting both head and EDID info on the same line. We no longer print EDID data every time it is parsed (on every hotplug event), but only if it changes. I did take a shortcut here and use weston_head::device_changed as the print condition which relies on the compositor clearing it, but a failure to do so just means we print stuff even if it didn't change. Head info updates also print the head info and not just the EDID data. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
Pekka Paalanen authored
Fix this function to support more than one head per output. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
Pekka Paalanen authored
Fix this function to support more than one head per output. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
Pekka Paalanen authored
Fix this function to support more than one head per output. v9: - Change { connectors, 0 } to { NULL, 0 } in drmModeSetCrtc() args. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
Pekka Paalanen authored
Replace the unused_connectors array by iterating through the head list instead. A head that is not enabled (attached to an enabled output) is basically an unused connector. All connectors regardless of their status have a drm_head. This has the nice effect that drm_pending_state_apply_atomic() does not need to re-query the connector properties every time, they can be simply looked up in the drm_head. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
Pekka Paalanen authored
In previous patches, all the appropriate fields from drm_output have been moved into drm_head, and resource allocation has been moved away from drm_output creation. It is time to throw the switch: this patch disconnects the drm_output and drm_head lifetimes. Previously a drm_output was created for a connected connector and destroyed on disconnection. A drm_head was tied to the drm_output lifetime just to accommodate the head-based output configuration API temporarily. Now all connectors will get a head created regardless of their connection status. Heads are created and destroyed as connectors appear and disappear (MST), not when they get connected or disconnected. This should allow the compositor to force-enable a disconnected connector. An "empty" drm_output is created with weston_backend::create_output() hook. This now follows the intent of the head-based output configuration API. On hotplug events, all connectors' information is updated regardless of their connection status changes. It is theoretically possible for a monitor to change without going through a disconnected state in between. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
Pekka Paalanen authored
Move the initialization of the drm_output mode list to drm_output_set_mode() time. Once we stop creating the drm_head with the drm_output, there will not be a head to get the mode list from at drm_output creation time. Furthermore, once DRM-backend starts supporting more than one head per output, the combined mode list to be exposed to clients (and the compositor?) must be constructed with all heads attached. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
Pekka Paalanen authored
The inherited mode is the video mode on the connector when we have not yet reconfigured the connector, if set. Get the inherited mode the moment we create a drm_head, not when we determine the mode for a drm_output. This way we are sure to read all inherited modes before we reconfigure a single CRTC. Enabling one output may grab the CRTC from another connector, overwriting whatever mode that connector might have had. The inherited mode is stored in drm_head, where we can keep it for the lifetime of the head, rather than relying on re-loading it from the kernel at set_mode() time. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
Pekka Paalanen authored
As these planes are allocated on output enable and freed on output disable, there cannot be a match in the pending_output_list. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
Pekka Paalanen authored
As CRTC is allocated on output enable and deallocated on output disable, there cannot be any matches in find-by-crtc from the pending_output_list. Remove the loop over pending_output_list as never finding anything by definition. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
Pekka Paalanen authored
A drm_output needs a CRTC only when it is in use. Allocating a CRTC on creation of drm_output will reserve the CRTC regardless of whether the output is actually used or not. This may cause creating other drm_outputs to fail if there are not enough CRTCs. Instead, allocate the CRTC on drm_output enable() time. A drm_output will have a valid CRTC only while it is enabled. This allows us to create drm_output objects arbitrarily and without a head assignment, which is required by the head-based output API for the backends. The assigned heads will be known only at enable() time. Now drm_output_enable() has to call drmModeGetResources() to be able to find a suitable CRTC. We might want to cache the resources somewhere, but that is it topic for another patch. v4: Force resetting unused CRTCs on fini. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
Pekka Paalanen authored
Move the connector related fields from drm_output to the drm_head. A drm_head represents a connector for now. The code in drm_head_create() to update connector data, monitor information, etc. is moved into a new function. This will be useful when DRM-backend starts creating heads for all connectors regardless of their connection status and will need to update them on hotplug events. While incurring the churn to move several fields into struct drm_head, also refactor out drm_head_assign_connector_info(). This function is needed later when drm_heads will exist regardless of connected status, as every hotplug event will need to update the state of all connectors. At that point we will also start handling connector changes that do not go through an intermediate disconnected state. This refactoring is trivial enough to be in this patch to reduce the total amount of changes to be reviewed. v6: - adapt to the new places of updating unused_connectors - free connector in create_output_for_connector() error path Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
- 17 Apr, 2018 11 commits
-
-
Pekka Paalanen authored
Backlight is driven per connector, hence it belongs in struct drm_head. weston_output::set_backlight() API is remains per output so far. There is no UI to control backlights per head and adding one would be difficult for an output that has multiple cloned heads. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
Pekka Paalanen authored
Instead of iterating output_list and pending_output_list, iterate head_list to find outputs whose connectors have been disconnected. This helps a following patch to move connector fields from drm_output to drm_head. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
Pekka Paalanen authored
Making this function not depend on drm_head::output field through drm_output_find_by_connector() will later allow to remove the drm_head::output field before removing the unused_connectors array. This helps keeping the commit more fine-grained. drm_backend_update_unused_outputs() was only interested in enabled outputs. The new code is 100% equivalent to the old code. The difference is that weston_head::output is only set for attached heads. A connector cannot be in use if it is not attached to an output. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
Pekka Paalanen authored
Switch drm_output_find_by_connector() to search for the output by iterating the compositor's head_list. drm_head_find_by_connector() will be useful later on its own. As of "compositor-drm: start migration to head-based output API" the head list is guaranteed to contain all created drm_outputs through the automatically created drm_head. This simplifies the code a little, introduces drm_head_find_by_connector(), and works towards the eventual removal of drm_output_find_by_connector(). Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
Pekka Paalanen authored
Helps debugging. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
Pekka Paalanen authored
Move the responsibility of ensuring the head will work in the enabled output to the backends. A compositor cannot enable an output without heads, and removing the last head from an output automatically disables the output, so attaching a new head to an enabled output is only possible for clone mode. Backends headless, rdp, and x11 forbid clone mode by not having an attach_head hook implemented; fbdev and wayland explicitly deny clone mode. Only the DRM backend is affected by this change and even that not yet because MAX_CLONED_CONNECTORS is 1 in the DRM backend. Also ensure a global is created for the head when attached to an enabled output, and log it. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
Pekka Paalanen authored
Support attaching custom data to a weston_output by the traditional destroy listener / wl_signal_get approach. Needs a new destroy signal, because user data lifetime should be the lifetime of the weston_output regradless of its enabled status. The old destroy signal is for output consumers that only care about enabled outputs in the system and gets emitted on disable, not on destroy. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
Pekka Paalanen authored
To let users pick an arbitrary name for an output, to be used as e.g. a configuration key, add API to create an output with a given name. For the same configuration purpose, add a search function as well. For the search function to be predictable, forbid creating multiple outputs with the same name. Previously, creating multiple outputs with the same name would have needed detatching to create outputs from the same head, now that is forbidden. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
Pekka Paalanen authored
This will be interesting to see when testing clone mode. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
Pekka Paalanen authored
Remove the scaffolding that allowed backends to be converted one by one to the head-based API. Nothing is using these members anymore. Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Ian Ray <ian.ray@ge.com> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-
Pekka Paalanen authored
Hook up the libweston facing head-based output API by introducing struct drm_head, but leave it as a fake so that members can be migrated in pieces in follow-up patches. The DRM backend continues to create an output for each connected connector only, and during output creation it also creates a drm_head for it. This allows it to pretend it supports the head-based output API as long as there is only one head per output ever attached. create_output callback is fake, it will only look up the existing drm_output by the head name. Clones are not yet supported, hence max is defined to 1. This unfortunately introduces some temporary code that will be revomed later, but seems to be necessary to avoid a single big patch. v6: - add missing drm_head_destroy() call Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by:
Ian Ray <ian.ray@ge.com> Reviewed-by:
Daniel Stone <daniels@collabora.com> Acked-by:
Derek Foreman <derekf@osg.samsung.com>
-