summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-04-06drm: Drop use of drm_config config wrapperlibweston-backend-configBryce Harrington1-21/+14
With the use_current_mode moved into the main config class, this small wrapper is redundant. Dropping it helps make the drm backend config initialization more consistent with the other backends.
2016-04-06Enforce destruction of all backend config objects after initializationBryce Harrington1-12/+23
Since the backend config struct versioning implies that there we expect potential future descrepancy between main's definition of the config object and the backend's, don't allow the backend to hang onto the config object outside the initialization scope.
2016-04-06drm: Don't hang onto the backend config object post-backend_initBryce Harrington3-20/+25
The drm backend was copying most everything out of the config object already, but now also copy the use_current_mode parameter and the config_output function pointer, so that there are no remaining references to the config object passed into backend_init(). By decoupling the config struct to the backend, if in the future if the structure definition changes in non-backwards compatible ways, then any version compatibility adaptation will be limited to just the backend_init() routine.
2016-04-06drm: Code and comments reformatting for consistency with other backend configsBryce Harrington3-21/+38
2016-04-06headless: port the headless backend to the new init apiBryce Harrington4-42/+121
refactor configuration API of headless-backend Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> v5: - update to current trunk - fixed typo 'struct weston_wayland_backend_config' - dropped unused variables - dropped weston_headless_backend_config_create() in favor of directly zalloc'ing the object - dropped weston_headless_backend_load() in favor of the more generalized load_backend_new(). - dropped typedef from header - restored use of 'backend_init' entry point - backend_init() takes a base weston_backend_config object - renamed 'param' to 'config' in a few places for consistency - renamed 'headless_options' variable to 'options for consistency - version the base struct - free config on error - don't free config during backend_init normal operations - adjust header ordering - make header guard naming consistent with other headers - light reformatting for code style and consistency with other backend config patches
2016-04-06x11: port the x11 backend to the new init apiBenoit Gschwind4-103/+261
Use a "well" defined structure to configure x11-backend and move configuration file parsing inside the weston compositor code. Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> v5: - Update to current trunk - Reformated for style consistency (e.g. spaces in "if(", linebreaks, etc.) - Move variable declarations to top of block - Rename header guard for consistency with other headers - Other misc. code style formatting fixes - Adjust code style to better match drm backend config - Version the config struct - Dropped use of bzero in favor of zalloc - Don't initialize vars already zalloc'd - Dropped weston_x11_backend_load in favor of more general load_backend_new routine - Dropped weston_x11_backend_config_outputs_clear and just free outputs in error handler for init routine - Restore use of 'backend_init' as module entrypoint - Rename 'ths' to 'config' for backend config structs - Rename 'x11_options' to 'options' for consistency - Rename other variables for consistency with other code - Rename 'noutputs' to 'num_outputs'
2016-04-01compositor: Document refs for alternatives/assumptions for backend configsBryce Harrington1-0/+6
2016-03-25compositor: Version the backend configuration structuresBryce Harrington3-2/+26
With this struct versioning, it is possible to add new options without breaking the ABI, as long as all additions are made to the end of a struct and nothing existing is modified or removed. When things are added, the structure's size will increase, and we'll use this size as our minor version number. If existing things need to be changed, then the major version, struct_version, is incremented to indicate the ABI break. >From our call site in main we record these major and minor version as struct_version and struct_size. The backend then verifies these against its own assumptions. So long as the backend's struct is equal or larger than what was passed in and the major versions are equal, we're good; but if it is larger, then this is a fatal error. Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Benoit Gschwind <gschwind@gnu-log.net> v5: Update to current trunk
2016-03-25drm: Fix gcc warning about missing braces.Bryce Harrington1-1/+1
Use double-brackets for config initializer for create_output_for_connector to avoid gcc warning, since first element is another struct. (See GCC bug 53119.) Quells warning: src/compositor-drm.c: In function ‘create_output_for_connector’: src/compositor-drm.c:2292:9: warning: missing braces around initializer [-Wmissing-braces] struct weston_drm_backend_output_config config = { 0 }; ^ src/compositor-drm.c:2292:9: warning: (near initialization for ‘config.base’) [-Wmissing-braces] Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-25drm: port the drm backend to the new init apiGiulio Camuffo5-110/+282
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net> Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> v5: Update to reflect format rename to gdb_format
2016-03-25Revert "main: Remove unused function load_backend_new()"Bryce Harrington1-0/+17
This reverts commit 5ffbfffaf7758c33791978516d0a1100773b85e2. Restore load_backend_new() for use with libweston backend configuration. Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-24ivi-shell: harden get_ivi_shell_surface()Pekka Paalanen1-3/+9
Add more sanity checks to get_ivi_shell_surface() just in case. If the configure hook is set, we must always have non-NULL configure_private. Check the ivi_shell_surface matches the surface. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Eugen Friedrich <friedrix@gmail.com>
2016-03-24ivi-shell: add sanity check in ivi_shell_surface_configurePekka Paalanen1-1/+5
This should not get called unless there is an ivi_shell_surface. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Eugen Friedrich <friedrix@gmail.com>
2016-03-24ivi-shell: add input panel label funcPekka Paalanen1-0/+8
Copied from desktop-shell/input-panel.c, add a label function for the input panel. This patch strictly reduces the difference between input-panel.c and input-panel-ivi.c. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Eugen Friedrich <friedrix@gmail.com>
2016-03-24ivi-shell: add shell surface labelsPekka Paalanen1-0/+16
To be used by the Weston timeline feature for identifying surfaces in a trace. The 'get_label' functionality can also be used by any debugging code, too. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Eugen Friedrich <friedrix@gmail.com>
2016-03-24ivi-shell: remove ivi_layout_get_screen_output APIUcan, Emre (ADITG/SW1)2-17/+0
The controller plugins use IVI Layout API with weston outputs. Therefore, this API is not required. Signed-off-by: Emre Ucan <eucan@de.adit-jv.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
2016-03-24ivi-shell: remove ivi_layout_get_screen_from_id APIUcan, Emre (ADITG/SW1)2-26/+1
The controller plugins does not use ivi screens for IVI layout APIs. They use weston outputs directly. Therefore, this API is unnecessary. Signed-off-by: Emre Ucan <eucan@de.adit-jv.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
2016-03-24ivi-shell: implement get_screen_from_outputUcan, Emre (ADITG/SW1)1-3/+17
It is an internal API, which returns ivi_layout_screen for a pregiven weston_output. Signed-off-by: Emre Ucan <eucan@de.adit-jv.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
2016-03-24ivi-shell: use weston_output in public APIsUcan, Emre (ADITG/SW1)4-68/+54
IVI layout APIs now are called with weston_output pointers, instead of ivi_layout_screen pointers. Signed-off-by: Emre Ucan <eucan@de.adit-jv.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
2016-03-24ivi-shell: remove ivi_layout_get_screens APIUcan, Emre (ADITG/SW1)4-114/+8
The compositor data struct already has a list of weston outputs. Therefore, this API is not required. Signed-off-by: Emre Ucan <eucan@de.adit-jv.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
2016-03-24ivi-shell: remove ivi_layout_get_screen_resolution APIUcan, Emre (ADITG/SW1)4-97/+11
The controller plugins can get the screen resolution directly from weston output. Therefore, this API is not required. Signed-off-by: Emre Ucan <eucan@de.adit-jv.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
2016-03-24ivi-shell: remove ivi_layout_get_id_of_screen APIUcan, Emre (ADITG/SW1)3-23/+4
ivi-screen does not have an id. IVI layout implementation is using id of weston output. Therefore, this API is unnecessary. Signed-off-by: Emre Ucan <eucan@de.adit-jv.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
2016-03-24ivi-shell: remove id_screenUcan, Emre (ADITG/SW1)1-7/+2
use output id instead Signed-off-by: Emre Ucan <eucan@de.adit-jv.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
2016-03-23input: use doubles in the interfaces to notify of input eventsGiulio Camuffo9-81/+89
This patch is a further step in the wl_fixed_t internal sanitization. It changes the notify_* functions to take doubles instead of wl_fixed_t but does not change how these are stored in the various input structs yet, except for weston_pointer_axis_event. However this already allows to remove all wl_fixed_t usage in places like the libinput or the x11 backend. Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-22compositor-drm: Renaming of gbm fieldsMiguel A. Vico1-29/+29
In preparation for follow-on changes to support frame presentation through EGLDevice+EGLOutput, this change includes the following: - Rename drm_backend::format to gbm_format - Rename drm_output::format to gbm_format - Rename drm_output::surface to gbm_surface - Rename drm_output::cursor_bo to gbm_cursor_bo Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com> Reviewed-by: Andy Ritger <aritger@nvidia.com> Reviewed-by: Daniel Stone <daniels@collabora.com> [Pekka: trivial rebase out of the series] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-22gl-renderer: Implement & use check_extensionMiguel A. Vico1-14/+42
Using strstr(3) for checking for extensions is an error-prone mechanism as extension names can be prefixes of other extension names (see https://www.opengl.org/registry/doc/rules.html#using). This change implements the check_extension() function to properly check for an extension and replaces all usages of strstr(3). Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com> Reviewed-by: Andy Ritger <aritger@nvidia.com> Reviewed-by: Daniel Stone <daniels@collabora.com> [Pekka: move 'bool' to the same line with 'static'] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-18hmi-controller: fix wrong panel widthUcan, Emre (ADITG/SW1)1-5/+3
The width of the first base layer is used for all panels. Every display has a base layer which is as big as the display. Therefore, it is wrong to use the width of the first base layer for all panels, because every display could have a different resolution. Signed-off-by: Emre Ucan <eucan@de.adit-jv.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-18hmi-controller: fix wrong background surface sizeUcan, Emre (ADITG/SW1)1-9/+8
In current implementation, the size of the first application layer is used for the background image of a display. This is wrong because: 1. The background surface should be fullscreen. 2. Each display could have different resolution. We should use the size of the base layer of each display for the background image. Signed-off-by: Emre Ucan <eucan@de.adit-jv.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-17input: Implement wl_seat.releaseQuentin Glidic1-0/+7
Avoid a crash because listener is NULL. Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net> Reviewed-By: David Fort <contact@hardening-consulting.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-17compositor-drm: fix memcmp using a bad pointer in drm_outout_choose_initial_modecomic fans1-1/+1
current_mode is already the pointer, taking the address of it is wrong. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94562 Reviewed-by: Bryce Harrington <bryce@osg.samsung.com> [Pekka: rewrote the patch] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-17ivi: Switch from MEM_ALLOC to the now equivalent xzallocBryce Harrington1-15/+7
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-17shared: Print .c file/line number in x* routinesBryce Harrington1-24/+4
Switches from inline to pre-processor definitions in order to utilize __FILE__ and __LINE__ from the .c file in order to display the location of memory allocation failures when failing. Now xmalloc, et al calls will produce: [weston-info] clients/weston-info.c:714: out of memory (1024) Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-17clients & tests: Unify multiple definitions of x*alloc and related functionsBryce Harrington23-159/+150
Direct fail_on_null calls now produce output like: [weston-info] clients/weston-info.c:714: out of memory xmalloc, et al produce output on failure like: [weston-info] out of memory (-1) Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-17ivi-shell: simplify ivi_layout_screen_set_render_orderUcan, Emre (ADITG/SW1)1-13/+3
It is not necessary check the ivi-id of pregiven objects (layer or surface). Traversing the list of all objects is sure to find the exact same pointer we start with, bugs aside. The controller modules are responsible for providing valid pointers. We cannot protect from invalid pointers anyway. Signed-off-by: Emre Ucan <eucan@de.adit-jv.com> [Pekka: fix subject, add commit message] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-17ivi-shell: simplify ivi_layout_screen_add_layerUcan, Emre (ADITG/SW1)1-12/+2
It is not necessary check the ivi-id of pregiven objects (layer or surface). Traversing the list of all objects is sure to find the exact same pointer we start with, bugs aside. The controller modules are responsible for providing valid pointers. We cannot protect from invalid pointers anyway. Signed-off-by: Emre Ucan <eucan@de.adit-jv.com> [Pekka: commit message] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-17ivi-shell: simplify ivi_layout_set_render_orderUcan, Emre (ADITG/SW1)1-16/+3
It is not necessary check the ivi-id of pregiven objects (layer or surface). Traversing the list of all objects is sure to find the exact same pointer we start with, bugs aside. The controller modules are responsible for providing valid pointers. We cannot protect from invalid pointers anyway. Signed-off-by: Emre Ucan <eucan@de.adit-jv.com> [Pekka: commit message] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-17ivi-shell: simplify ivi_layout_layer_add_surfaceUcan, Emre (ADITG/SW1)1-12/+2
It is not necessary check the ivi-id of pregiven objects (layer or surface). Traversing the list of all objects is sure to find the exact same pointer we start with, bugs aside. The controller modules are responsible for providing valid pointers. We cannot protect from invalid pointers anyway. Signed-off-by: Emre Ucan <eucan@de.adit-jv.com> [Pekka: commit message] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-17ivi-shell: simplify ivi_layout_remove_surfaceUcan, Emre (ADITG/SW1)1-11/+2
It is not necessary check the ivi-id of pregiven objects (layer or surface). Traversing the list of all objects is sure to find the exact same pointer we start with, bugs aside. The controller modules are responsible for providing valid pointers. We cannot protect from invalid pointers anyway. Signed-off-by: Emre Ucan <eucan@de.adit-jv.com> [Pekka: commit message] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-16ivi-shell: remove add_configured_listener left-overPekka Paalanen1-4/+0
In all my rebases, this got accidentally left behind. The implementation was removed in 4a7503976b5d300a4474b149d877cf579c2a8c05 but 32ca791df8f855898e007512f3b996a66ffcb09c reintroduced it. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-16ivi-shell: introduce ivi-layout-shell.hPekka Paalanen5-20/+71
This new header encapsulates the API that ivi-layout offers to ivi-shell.c to call. ivi-shell.c no longer uses ivi-layout-private.h. This limits the ivi-layout internal structures to just ivi-layout code. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
2016-03-16ivi-shell: remove configured signal from ivi-layoutPekka Paalanen3-30/+1
Now that ivi-layout calls directly into ivi-shell.c, this signal is no longer used. Remove it. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
2016-03-16ivi-shell: call shell_surface_send_configure() directlyPekka Paalanen4-26/+35
For some reason, it seems that ivi-layout.c has tried hard to avoid calling directly into ivi-shell.c. This means there is a jump through hoops just to get the configure event sent to the clients. Ivi-shell registers a listener for a ivi-layout signal for sending the event. Instead, let ivi-layout.c call directly into ivi-shell.c, and expose a function to send out the configure events. This reduces some confusion on who calls what. The main idea though is that this makes ivi-shell.c not depend on struct ivi_layout_surface fields directly anymore. In following patches, ivi_layout_surface can be made opaque for ivi-shell.c. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
2016-03-16clients: fix incorrect format handling in simple-shmMurray Calavera1-4/+5
the `shm_format` function seems to assume the `wl_shm_format` enum has bit-exclusive enumerations which is not true. Signed-off-by: Murray Calavera <murray.calavera@gmail.com> [Pekka: fix whitespace with an 'if'.] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-15ivi-shell: add include guards on ivi-shell.hPekka Paalanen1-0/+5
It's our standard practice. This file will get used a bit more in the future. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-15ivi-shell: include config.h in ivi-layout-transition.cPekka Paalanen1-0/+2
Every .c file must include config.h as the first thing. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-15simple-egl: use roundtrip after get_registry requestMarek Chalupa1-1/+1
Sometimes weston-simple-egl aborts in create_surface under some conditions. It is because wl_display_dispatch() may not be enough to make sure we have all requried objects. Can be modeled by wldbg: $ wldbg -i weston-simple-egl (wldbg) b re get_registry (wldbg) c (wldbg) c After these steps the weston-simple-egl aborts, because it has not got shell neither ivi-shell objects Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-15ivi-shell: remove content_observer notificationUcan, Emre (ADITG/SW1)3-32/+0
The content observer notification struct and its set API (ivi_layout_surface_set_content_observer) are removed. Because they are unused. Signed-off-by: Emre Ucan <eucan@de.adit-jv.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-15ivi-shell: Remove all surface transitions when it is being removed.Mateusz Polrola3-0/+21
If surface transitions are not removed when surface is being removed, it can lead to crash later when transition will finish, as it will try to reference already freed memory. This change exposes function that can remove all existing transitions for given surface and it is being called during surface cleanup. Signed-off-by: Mateusz Polrola <mateuszx.potrola@intel.com> Reviewed-by: Emre Ucan <eucan@de.adit-jv.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-10desktop-shell: make panel clock configurableArmin Krezović3-7/+59
This patch enhances the panel clock by adding a config file option which can be used to either disable the clock or make it also show seconds in the current clock format. v2: Implement suggestions from Pekka: - Include Signed-off-by - Coding style fixes - Implement clock widget allocation by using width from cairo_text_extents - Highlight config option values in man page v3: Implement suggestions from Pekka and Bryce: - Use CLOCK_FORMAT_* instead of FORMAT_* in the enum - Switch to using fixed clock widget size instead of one returned from cairo_text_extents - Fixes to config option highlighting in the man page v4: Implement more suggestions from Pekka and Bryce: - Improve patch changelog - Move the check for CLOCK_FORMAT_NONE into the caller function - Fix a memory leak in panel_create introduced by previous revision of this patch Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57583 Signed-off-by: Armin Krezović <armin.krezovic@fet.ba> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-03-09clients: Use zallocBryce Harrington12-14/+30
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>