summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-11-04compositor: Abort on bad frame timestampbad_timestamp_abortFrederic Plourde1-0/+29
Many features, like animations, hardly depend on page flip timestamps to work properly, but some DRM drivers do not correctly support page flip timestamps (or not at all) and in that case, things start to go wrong. This patch adds sanity check to weston_output_finish_frame to ensure that received timestamps are free from those pathologies: 1) Timestamps exactly equal 0 2) Timestamps do not advance from one frame to the next If a pathological case is detected, we gracefully exit Weston with an appropriate exit code to help developers debug their drivers. This fixes: https://bugs.freedesktop.org/show_bug.cgi?id=79502 Note: This patch depends on "compositor: Return a user-defined exit code"
2014-11-04cosmetic: replace boolean function return values with boolDerek Foreman5-26/+28
For functions that test if something is true/valid and return a 1 or 0, it makes sense to switch to bool. Reviewed-by: Bryce Harrington <b.harrington@samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-10-10gl-renderer: don't move memory in output_rotate_damageDerek Foreman1-10/+9
output_rotate_damage shifted an array of pixman regions with a loop. Now it uses an index into that array. This currently only saves 1 pixman_region32_copy, but we can now raise BUFFER_DAMAGE_COUNT without a performance impact if we run into a configuration where this is useful. Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-10-08Very OCD cosmetic nitpickDaniel Stone1-1/+1
2014-10-08releasing: update web host nameDaniel Stone1-1/+1
Signed-off-by: Daniel Stone <daniels@collabora.com>
2014-10-08tests: add role conflict sub-surface vs. wl_shell_surfacePekka Paalanen2-0/+144
Add tests for triggering the role conflict when a wl_surface is already a wl_shell_surface and then attempted to be made into a sub-surface, and vice versa. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
2014-10-08compositor: send error for surface role resetsPekka Paalanen6-46/+69
With the more accurate definition of wl_surface roles in Wayland, enforce the restriction: a role is always set permanently, and attempting to change it is a protocol error. This patch is based on Jasper's patch: http://lists.freedesktop.org/archives/wayland-devel/2014-August/016811.html The difference in this patch compared to his are: - send role errors on the interface whose request triggers it, not on wl_surface - an interface could have several requests assigning different roles, cannot use wl_interface as the unique key; use an arbitary string instead - ensure in window-manager.c that create_shell_surface() -> create_common_surface() is never called with surface->configure set, to avoid compositor abort - use wl_resource_post_no_memory() where appropriate instead of hand-rolling it with wl_resource_post_error() Ideally we would not add weston_surface::role_name field, but use weston_surface::configure. At the moment this is not possible though, because at least shell.c uses several different roles with the same configure function. Drag'n'drop uses two configure functions for the same role. The configure hook is also reset in several places, which is not good for role tracking. This patch overlooks the wl_surface roles assigned in privileged extensions: screensaver, panel, background, lock, input panel. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
2014-10-08protocol: add role error code to xdg_shellPekka Paalanen1-0/+9
Needed for properly reporting role violations from xdg_shell.get_xdg_surface and .get_xdg_popup. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net> Acked-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-10-01shell: don't crash on create_common_surface() failurePekka Paalanen1-0/+6
Noticed while reading code, that create_common_surface() may return NULL, and callers of its direct callers check for NULL, but the intermediate function in between would crash. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-30clients: add presentation-shm demoPekka Paalanen3-0/+876
This started as a copy of simple-shm.c before it was converted to xdg_shell. This demo excercises the presentation feedback interface in five different modes: - A continuous repaint loop triggered by frame callbacks, and using immediate commits, just gathering presentation feedback and computing some time intervals for statistics. - The same as above, except with 1s sleep before actually repainting as a response to frame callback. This tests how well the compositor can do a repaint from idle state (not continuously repainting), assuming nothing else is causing repaints. - A continuous repaint loop triggered by 'presented' events rather than by frame callbacks. If Weston uses an appropriate scheduling algorithm, this mode achieves the smallest possible frame latency (below one output refresh period). In all modes, all frames are pre-rendered at startup, so no rendering happens during the animation. [Louis-Francis Ratté-Boulianne: split queuing feature] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
2014-09-30tests: presentation test, simplePekka Paalanen2-0/+255
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-30compositor-drm: deliver frame seq for feedbackPekka Paalanen3-1/+16
Add 'msc' field to weston_output to maintain the refresh counter, and use it in presentation_feedback.presented. Make compositor-drm update the per-output refresh counter with the values reported by DRM. If the DRM reported value jumps backwards, assume it wrapped around once. Other backends do not update weston_output::msc, and there presentation_feedback will always deliver refresh counter as zero. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> v3 Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
2014-09-30compositor: implement presentation_feedbackPekka Paalanen2-4/+149
Implement the presentation.feedback request, and the presentation_feedback protocol interface. Feedback information is delivered to clients as the backend reports it, except the refresh counter (MSC) which is always reported as zero. Changes in v4: * add 'flags' argument to 'presented' event without implementation Changes in v5: * remove the 'destroy' method implementation for feedback objects [Pekka Paalanen: do not leak struct feedback.] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> v3 Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
2014-09-30compositor: set and use the presentation clock everywherePekka Paalanen9-69/+161
Add presentation clock setters that verify the given clock actually works. Offer an automatic choice of a software fallback clock, when a backend has to always use clock_gettime() to approximate the presentation time. The DRM backend already queried the DRM about the clock id, just let the DRM backend set the presentation clock from that. For all other backends which do not get a timestamp from the driver, call the software clock setter to choose a suitable clock. Report the chosen clock via presentation.clock_id event to clients. In finish_frame(), upgrade the argument from uint32_t milliseconds to struct timespec which can accurately hold the presentation clock values. This will be needed when weston_output_finish_frame() starts to send out presentation_feedback.presented events. While at it, replace gettimeofday() calls with clock_gettime() using the chosen presentation clock, so we manufacture presentation timestamps from the presentation clock when the gfx drivers cannot give us a proper timestamp. Rpi patch is more verbose due to not having the compositor pointer available in rpi_flippipe_update_complete(). Explicitly carry the clock id with flippipe so it is available in the thread. Changes in v4: * rpi debug build fix v4 Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> v3 Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
2014-09-30weston-info: report presentation clockPekka Paalanen2-0/+84
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> v3 Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
2014-09-30compositor: add stub implementation of presentation interfacePekka Paalanen1-1/+46
You can bind to the global interface, and it delivers a fake clock id. All requests on it raise an error. Changes in v4: * queuing methods were extractracted for a later series [Louis-Francis Ratté-Boulianne: split queuing feature] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
2014-09-30protocol: add presentation extension v5Pekka Paalanen2-0/+245
Add accurate presentation timing features to Wayland: queueing and feedback. This specification is based on the draft written by Frederic Plourde <frederic.plourde@collabora.co.uk> and redesigned by Pekka Paalanen. The RFC v2 version is from http://lists.freedesktop.org/archives/wayland-devel/2014-January/012988.html Changes in v3: * associate presentation time to current surface contents This implements the suggestion from http://lists.freedesktop.org/archives/wayland-devel/2014-February/013066.html which prevents surface content from jumping backwards in time if a client retroactively queues an update with a target time in the past. * use 64-bit tv_sec in presentation The time_t type used in struct timespec could be almost anything. POSIX probably defines it to be an integer, but not the size. Apparently it is usually 'long', which makes it 64-bit on x86_64. To be able to fully represent timespec values returned by clock_gettime, change the protocol to use 64 bits for the tv_sec part. * define an error for invalid tv_nsec This allow us to rely on the normalized timestamp form. * define some interactions with sub-surfaces Sub-surface cached state updates (synchronized mode) are designed especially for resizing. As queued updates are not meant to produce any resizing-like effects, they also do not trigger any sub-surface operations. * add sub-headings as xml comments * queued update cannot map Because before mapping, the surface has no main output assigned. An immediate commit is needed anyway, to be able to set all the surface state, which a queued update cannot touch. * frame callbacks are not queued It is not known when queueing frame callbacks would be useful. Changes in v4: * remove mentions of the queuing feature The specification has been split and the queuing feature will be added back in another version of the extension. * add flags argument to 'presented' event Describe the nature of how the update was presented to screen and the characteristics of the feedback information. No flags have been defined for now. * add a protocol error code for invalid flags Changes in v5: * remove the destroy method for the feedback object The protocol object should instead be automatically destroyed after a 'presented' or 'discarded' event has been triggered. * some grammatical corrections to the specification [Louis-Francis Ratté-Boulianne: split the spec in two parts] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> v3 Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
2014-09-22shell: fix weston_output_mode_switch() usageDerek Foreman2-6/+6
Calling weston_output_mode_switch() with WESTON_MODE_SWITCH_RESTORE_NATIVE will result in the mode being set "back" to the passed in mode - so the passed mode should be the native mode. Additionally, weston_output_mode_switch() should be called when output->original_mode is non-NULL (which indicates we had a temporary mode set). The comparison to current_mode results in a lot of log chatter. Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-22clients: Maximize window when double touch on title barXiong Zhang3-2/+80
Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
2014-09-22cosmetic: Move WL_EXPORT out of header filesDerek Foreman3-7/+7
Most of the code only puts WL_EXPORT in .c files. Remove the few instances in header files. If it's missing form the associated .c, put it there instead.
2014-09-22cosmetic: Remove prototype for nonexistent functionDerek Foreman1-3/+0
2014-09-22configure.ac: bump version to 1.6.90Pekka Paalanen1-1/+1
Open master for new features again. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-19configure.ac: bump version to 1.6.0Pekka Paalanen1-2/+2
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-17editor: do not crash when text input manager is not availableOlivier Blin1-0/+5
[Pekka Paalanen: whitespace fix] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-17keyboard: do not crash when input panel is not availableOlivier Blin1-0/+5
[Pekka Paalanen: whitespace fix] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-15compositor-x11: Rename the output make to "weston-X11"Jason Ekstrand1-1/+1
Previously all outputs in the X11 backend had the make "xwayland" which is confusing. Now they have something that makes a little more sense.
2014-09-15window: Don't needlessly sync parent and geometryOndřej Majerech1-0/+12
When a toytoolkit client redraws, the toolkit syncs the parent and geometry. If a client redraws often (such as the terminal drawing a huge amount of output), this can spam the compositor with requests and may result in the client's eventual being killed. We don't need to send requests for changing the geometry or parent if these haven't changed. So remember the last geometry and parent, and update them only if needed. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83297 Signed-off-by: Ondřej Majerech <majerech.o@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-12configure.ac: bump version 1.5.93 for rc2Pekka Paalanen1-1/+1
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-12libinput: default to INFO log levelPekka Paalanen1-8/+8
Set the default logging level from libinput to INFO. This matches better the behaviour of the old input backend, and prints the found input devices into Weston's log. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Acked-by: Jonas Ådahl <jadahl@gmail.com>
2014-09-12libinput-device: Don't get initial key statesJonas Ådahl1-30/+0
Initial key state is no pressed keys, and the libinput_device_get_keys function was deprecated in libinput 0.6.0. Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2014-09-12libinput: normalize WL_CALIBRATION before passing it to libinputPeter Hutterer2-1/+88
WL_CALIBRATION, introduced in weston-1.1, requires the translation component of the calibration matrix to be in screen coordinates. libinput does not have access to this and it's not a very generic way to do this anyway. So with the libinput backend, WL_CALIBRATION support is currently broken (#82742). This cannot be fixed in libinput without changing its API for this specific use-case. This patch lets weston take care of WL_CALIBRATION. It takes the original format and normalizes it before passing it to libinput. This way libinput still does the coordinate transformation, weston just needs to provide the initial configuration. Note that this needs an updated libinput, otherwise libinput will try to transform coordinates as well. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=82742 Reviewed-by: Jonas Ådahl <jadahl@gmail.com> Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-12compositor: Don't free an uninitialised pointer.Ondřej Majerech1-1/+2
When backend_init returns NULL, we goto out_signals, which wants to free(modules), but in this particular code path, modules hasn't been initialised leading to a "Double-free or corruption" error message. Initialising modules to NULL makes the free a no-op in this scenario. Signed-off-by: Ondřej Majerech <majerech.o@gmail.com> Reviewed-by: Ryo Munakata <ryomnktml@gmail.com>
2014-09-11image: don't print redundant errorBill Spitzak1-1/+0
This error is printed by load_image() now Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-11load_image: always print a message on failure if filename is not emptyBill Spitzak1-2/+12
It was rather inconsistent before. This may help users figure out why backgrounds and icons don't show up. A better api where the error can be queried might be nice, but this seems sufficient for current Weston use. [Pekka Paalanen: removed one stray space.] Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-11parse_options: fail on more malformed optionsBill Spitzak1-28/+69
Fail on trailing text after numbers, such as --width=100mm Fail on any text after booleans, such as --flag=false Also fixed reading of memory after the null terminator of a long option with no = sign in it. [Pekka Paalanen: some whitespace style fixes.] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-11cosmetic: update comments that refer to weston_surface_update_transform()Derek Foreman3-4/+4
weston_surface_update_transform() no longer exists, except in comments. Fix that. [Pekka Paalanen: don't lose the full comment in compositor-drm.c.] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-11Partially revert "xdg-shell: Add show_window_menu request"Pekka Paalanen1-7/+49
This reverts the parts of commit 81ff075bf48c55cd07e37784e20c310fa52ed926 that touch window.c. This brings the toytoolkit window context menus back, until someone implements the xdg-shell equivalent in the compositor. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=82972 Acked-by: Jasper St. Pierre <jstpierre@mecheye.net> Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-10xdg-shell: fix maximizing in multi-head setupMarek Chalupa1-3/+4
Set the right position of maximized window. Up until now we ignored output's "position" and were using only the working area of output which is in output-relative coordinates. This led to showing the maximized window always on the first output. This, along with the previous patch, fixes https://bugs.freedesktop.org/show_bug.cgi?id=82967 Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-10xdg-shell: update shsurf->output when maximizingMarek Chalupa1-26/+34
shsurf->output is the output that user expects the shell surface is on. When maximizing, we don't have any explicit setting of the output like in the case of fullscreening, so set the output to the one that the surface is currently on. In the case that the surface is not mapped yet, (if it ever happens) use the same heuristics as for fullscreening. This fixes the size sent with configure event, when maximizing a window. The size is now picked up by the correct output, but the maximized window position is still wrong. [Pekka Paalanen] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=82967 Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-10input: Schedule pointer sprite repaint when cursor is setJonas Ådahl2-2/+52
If a cursor was set with wl_pointer.set_cursor but not in combination with an action that has the side effect of damaging the region where the cursor is positioned, it would not be drawn. This patch explicitly schedules a repaint of the pointer sprite when it is set. clickdot is updated to illustrate the bug; when moving the pointer over clickdot, the pointer is hidden. When not having moved the pointer for 500 ms it is made visible using wl_pointer.set_pointer. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-09compositor: fix memory corruption when removing an outputGiulio Camuffo1-0/+6
The destructor set on the wl_output resources needs the weston_output to be allocated, because it removes the resource from its list. So unset the destructor on all the resources when destroying an output. Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-09main: don't leak option stringsRyo Munakata1-24/+18
[Pekka Paalanen: fix a long line] Signed-off-by: Ryo Munakata <ryomnktml@gmail.com> Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-09compositor: extract choose_default_backend and create_listening_socketRyo Munakata1-25/+41
Extract these two new functions from main() to improve readability. Refactoring only, no functioncal changes. [Pekka Paalanen: commit message] Signed-off-by: Ryo Munakata <ryomnktml@gmail.com> Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-09compositor: remove unused signalGiulio Camuffo1-1/+0
The move_signal in weston_output isn't used, and not even initialized, so anything trying to listen to it will crash on wl_signal_add(). Instead of it, the 'output_moved_signal' in weston_compositor is used, so remove it. Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-06Fix a copy-paste error in weston_surface_commit_stateJason Ekstrand1-1/+1
2014-09-05configure.ac: bump version to 1.5.92 for rc1Pekka Paalanen1-1/+1
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-05fix asprintf warningsPekka Paalanen3-6/+18
Fix recently introduced compiler warnings: desktop-shell/shell.c: In function 'shell_configuration': desktop-shell/shell.c:588:10: warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result [-Wunused-result] src/screenshooter.c: In function ‘screenshooter_binding’: src/screenshooter.c:291:10: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Wunused-result] src/text-backend.c: In function ‘text_backend_configuration’: src/text-backend.c:944:10: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Wunused-result] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-05xdg-shell: handle clients launched in fullscreenMarek Chalupa1-0/+33
When client is lauched in fullscreen, it is placed on the first output, because it is not mapped and shell_surface_set_output() therefore sets default output. Since we have no better way how to position newly created windows, (http://lists.freedesktop.org/archives/wayland-devel/2014-May/thread.html#14568) set the output to the one that has currently focus. Priority has the touch focus, then pointer and then keyboard focus. This fixes bug https://bugs.freedesktop.org/show_bug.cgi?id=69780 Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-05matrix-test: fix units in reportDerek Foreman1-2/+2
The matrix-test speed tests are calculated in ns but some printed the units as us Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-05touch-input: Don't dereference NULL pointer during full screen fadeDerek Foreman2-3/+13
If a full screen program is fading out and a touch start happens, it will result in a NULL pointer dereference when weston_touch_set_focus tries to derefernce view->surface->resource. Instead, this patch sets the focus to NULL, which should be the same as if the program was destroyed during the touch anyway. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=78706 Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>