summaryrefslogtreecommitdiff
path: root/src/compositor-drm.c
Commit message (Collapse)AuthorAgeFilesLines
* compositor-drm: Add support for Tegra Jetson TK1baserock/weston-1.11.0/tegraJames Thomas2016-07-181-3/+92
| | | | Update configure.ac to add check for libdrm_tegra
* compositor-drm: Add new gbm struct to allow for a separate gbm deviceJames Thomas2016-07-181-20/+27
| | | | | This is needed for devices like tegra jetson where the gbm device is not the same as the drm device
* compositor-drm: Prevent a crash in the pixman rendererEmmanuel Gil Peyrot2016-05-171-1/+2
| | | | | | | | | | When pixman is used and no connector could be found (or any other error), drm_backend_create() tried to destroy a gbm_device that would only be created in init_egl(), resulting in a segfault. Signed-off-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* compositor-drm: Write a name in the mode generated from a modelineEmmanuel Gil Peyrot2016-05-171-0/+3
| | | | | | | | | | The current behaviour leaves the name empty, making it somewhat harder to determine the characteristics of this mode from a debugger. Signed-off-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net> [Pekka: wrap long line (ybakos)] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* compositor-drm: Remove unused output reference in drm_fbEmmanuel Gil Peyrot2016-05-171-3/+0
| | | | | | Signed-off-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* drm: port the drm backend to the new init apiGiulio Camuffo2016-05-101-126/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Preparing for libweston and for the separation of the code base into libweston vs. weston the compositor, we must remove all uses weston_config structures from the backends. We have decided that all option and config input happens in the compositor (main.c), and configuration is passed in for the backends as structs. Most other backends have already converted, and this patch converts the DRM-backend to the libweston-style init API. The libweston-style init API includes a header for each backend (here compositor-drm.h) defining the configuration interface. The compositor (main.c) prepares a configuration struct to be passed through libweston core to the backend during initialization. A complication with the DRM-backend is that outputs can be hotplugged, and their configuration needs to be fetched from the compositor (main.c). For this, the config struct contains a callback member. The output configuration API is subject to change later, this is just a temporary API to get libweston forward. As weston_compositor's user_data was not previously used for anything, and the output configuration callback needs data, the user_data is set to the 'config' pointer. This pointer is only used in drm_configure_output() in main.c. [Bryce: lots of stuff and rebasing] 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> Tested-by: Benoit Gschwind <gschwind@gnu-log.net> [Pekka: write commit message] [Pekka: squash in "drm: Don't hang onto the backend config object post-backend_init" from Bryce Harrington] [Pekka: drop the compositor.h hunk] [Pekka: do not #include inside extern "C"] [Pekka: remove incorrect comment about weston_drm_backend_config ownership.] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* drm: Spelling fix in commentBryce Harrington2016-04-181-1/+1
| | | | | Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
* compositor-drm: Renaming of gbm fieldsMiguel A. Vico2016-03-221-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>
* compositor-drm: fix memcmp using a bad pointer in drm_outout_choose_initial_modecomic fans2016-03-171-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>
* protocol: migrate to stable presentation-time.xmlPekka Paalanen2016-03-071-11/+11
| | | | | | | | | | | | | | | | | | | | Remove the unstable presentation_timing.xml file, and use presentation-time.xml from wayland-protocols instead to generate all the Presentation extension bindings. The following renames are done according to the XML changes: - generated header includes - enum constants and macros prefixed with WP_ - interface symbol names prefixed with wp_ - protocol API calls prefixed with wp_ Clients use wp_presentation_interface.name rather than hardcoding the global interface name: presentation-shm, weston-info, presentation-test. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Jonas Ådahl <jadahl@gmail.com> [Pekka: updated wayland-protocols dependency to 1.2]
* compositor-drm: the cursor plane only supports ARGBDerek Foreman2016-02-091-3/+9
| | | | | | | | | | Keep XRGB apps out of the cursor plane, only ARGB is supported. This prevents programs like weston-simple-shm from landing in the cursor plane and being misrendered. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* compositor-drm: update internal cursor plane location when disabling cursorDerek Foreman2016-02-091-1/+4
| | | | | | | | | | | | | | | | When the cursor plane is disabled the kernel can lose its location. If we don't update our internal idea of where the plane is at that time, the next time we set a cursor it can show up at 0,0. This can show up when an application is put in the cursor plane, removed from the plane, then put back at the same location. It might show up at 0,0 when it's reinstated. We now use INT32_MIN as a location for disabled cursors so enabling the plane will always cause an update. Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
* compositor-{drm, fbdev, rpi}: Make VT switching configurableBob Ham2016-01-121-14/+1
| | | | | | | | | | | | Add a new boolean weston.ini option, "vt-switching" to enable or disable Ctrl-Alt-Fn key combinations. Signed-off-by: Bob Ham <bob.ham@collabora.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com> (Derek Foreman changed the prototype for switch_vt_binding to have a weston_keyboard * instead of weston_seat *. The pointer wasn't used, so this is just a warning fix.)
* linux-dmabuf: Move the attributes part of linux_dmabuf_buffer into its own ↵Emmanuel Gil Peyrot2015-12-021-6/+6
| | | | | | | | | | | | | | | | struct This allows renderers to use that struct to create their own dmabufs, in case they can’t import the one provided by the client directly but know how to convert it into a format they can render. Signed-off-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Daniel Stone <daniels@collabora.com> Differential Revision: https://phabricator.freedesktop.org/D332 Reviewed-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
* compositor-drm: fix hw cursor positioningPekka Paalanen2015-11-271-0/+7
| | | | | | | | | | | Fix a regression introduced by be428b3825043cbcc676d2526fe6213bea7f676a which accidentally removed the global-to-output space conversion. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Cc: Derek Foreman <derekf@osg.samsung.com> Cc: Daniel Stone <daniels@collabora.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com> Tested-by: Derek Foreman <derekf@osg.samsung.com>
* compositor-drm: Use view transform in cursor plane setupDerek Foreman2015-11-241-3/+5
| | | | | | | | | | | Make sure a view's transform is viable for a cursor plane and then actually apply it before setting the cursor plane location. Now if a subsurface ends up in the cursor plane, the plane will be properly positioned. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* compositor-drm: pass NULL to mmap() instead of 0 as the addressChris Michael2015-11-121-1/+1
| | | | | | | | mmap() function expects to be passed a void pointer as the address here. Passing NULL is technically more correct than passing 0. Signed-off-by: Chris Michael <cp.michael@samsung.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
* compositor-drm: fall back to EGL visual_id 0 if no others workDerek Foreman2015-11-071-3/+4
| | | | | | | | | | commit e76f185 stopped using visuals with "native visual id" == 0 This broke some systems, so we now try 0 as a worst case fallback if everything else has failed. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* compositor: pass the backend config struct to the backends init functionGiulio Camuffo2015-10-231-1/+2
| | | | | | | | | Add new configuration argument to the backend_init() function, which will replace the current argc, argv, and config arguments. After each backend is converted individually the unused parameters will be removed. Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* compositor-drm: fix cursor size test in drm_assign_planesDerek Foreman2015-10-151-1/+2
| | | | | | | | | | | | | | | | | | | In commit 70d337dfd we changed one cursor size test from a hard coded 64,64 to the actual device provided width, height. The test in drm_assign_planes remained fixed at 64, 64. The simple-shm test ended up being small enough to fit into a cursor plane by one test, but too large by the test in drm_assign_planes. We'd assign to the cursor plane but not keep a reference. weston-simple-shm would disappear and be replaced with the previous cursor image. This partially "fixes" T3361. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* compositor-drm: Ensure strings from EDID blobs are null terminatedBryce Harrington2015-09-221-0/+3
| | | | | | | | | | strncpy only adds null terminating bytes if the source string is smaller than the destination string. Since this function relies on the string being null terminated when checking its contents, we better make sure there is at least a \0 as the last character. Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
* Revert "compositor-drm: disable hardware cursors"Pekka Paalanen2015-09-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit 6858383d51b12632481370fdc7d886a1e6bb4ebd. The main reason for the original patch was a regression on the Intel drivers causing compositor framerate to drop to half during cursor updates or motion. The Intel problem was fixed in https://github.com/torvalds/linux/commit/2e7f43c41c042d6fed4d67aceeaae32d8f102e98 The fix is included in Linux 4.1-rc6 and 4.0.5. The comment in the original patch is still true, but arguably the possible minor glitches with cursor updates are less bad than not using cursor planes at all. Cc: nerdopolis <bluescreen_avenger@verizon.net> Cc: Daniel Stone <daniel@fooishbar.org> Cc: Giulio Camuffo <giuliocamuffo@gmail.com> Cc: David FORT <contact@hardening-consulting.com> Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Tested-by: Giulio Camuffo <giuliocamuffo@gmail.com> Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
* build, compositor-drm: fix output name constants another wayPekka Paalanen2015-08-241-0/+2
| | | | | | | | | | | | | | | | | | Bumping libdrm requirement by 3 years just for output connector name constants was a bit much. Fix the problem introduced in 89c49b3060a115e846ba1e7fbef94d14894244f2 by conditionally using the new additions. Both VIRTUAL and DSI came in the same libdrm commit 566c3ce877a4be72697e15cdfc421ce965f7c37d, so we check only for DSI. This patch also reverts faee330c5e027011941d50533156683be3a67ca3. Reported-by: Eugen Friedrich <friedrix@gmail.com> Cc: Derek Foreman <derekf@osg.samsung.com> Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Derek Foreman <derekf@osg.samsung.com> Acked-by: Bryce Harrington <bryce@osg.samsung.com>
* compositor-drm: rename outputs to follow kernel stylePekka Paalanen2015-08-211-19/+23
| | | | | | | | | | | | | | | | | | | | | | | | | The problem with the old table of names is that it contains duplicates. It is possible to end up with multiple outputs with the same name. In that case you cannot write individual configurations for these outputs in weston.ini, because they are matched by the name. Change all names to follow the kernel naming scheme set in drivers/gpu/drm/drm_crtc.c. The snprintf format now follows the kernel style, too. Use the DRM_MODE_CONNECTOR_* macros rather than implicit table ordering. Completely new entries in the table are "Virtual" and "DSI". There should not be any gaps in the macro values, but if there are, deal with a NULL entry. Also change "UNKNOWN" to "UNNAMED" so it's easier to distinguish from "Unknown" by the kernel. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89361 Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Derek Foreman <derekf@osg.samsung.com> Tested-by: Drew DeVault <sir@cmpwn.com>
* compositor-drm: cast surface to EGLNativeWindowTypeDawid Gajownik2015-08-191-1/+1
| | | | | | | | | gl_renderer_output_create expects `window_for_legacy' variable to be of type EGLNativeWindowType, not EGLNativeDisplayType. This variable is used later in eglCreateWindowSurface(). Signed-off-by: Dawid Gajownik <gajownik@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* Fix build breakage when using older gbm lacking dmabuf importBryce Harrington2015-08-141-0/+4
| | | | | | | | | | | | | | | | | | | | | | The buildbots discovered this issue on Ubuntu 14.04, which carries libgbm 10.1.3-0ubuntu0.4. The dmabuf changes need gbm 10.2, so it fails during build like this: src/compositor-drm.c: In function ‘drm_output_prepare_overlay_view’: src/compositor-drm.c:984:10: error: variable ‘gbm_dmabuf’ has initializer but incomplete type struct gbm_import_fd_data gbm_dmabuf = { ^ etc. Proposed fix is to conditionalize the gbm fd import feature in compositor-drm. This fix was suggested by daniels. I set up a synthetic test environment to reproduce the issue as found by the buildbots and tweaked the patch to get it to build both with and without gbm 10.2. Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
* compositor-drm: dmabuf GBM importPekka Paalanen2015-08-141-4/+29
| | | | | | | | v2: - add TODO note about multi-planar import and how we should do it Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Daniel Stone <daniels@collabora.com>
* compositor-drm: init linux_dmabuf supportPekka Paalanen2015-08-141-0/+17
| | | | | | | | v2 changes: - only initialize linux_dmabuf if renderer supports it Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Daniel Stone <daniels@collabora.com>
* backends: don't destroy renderer and output twiceDawid Gajownik2015-08-061-1/+0
| | | | | | | | drm, fbdev, rpi and wayland backends are unnecessarily destroying renderer and output before executing weston_compositor_shutdown() Signed-off-by: Dawid Gajownik <gajownik@gmail.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
* input: Don't test keyboard/pointer/touch pointersDerek Foreman2015-07-311-4/+6
| | | | | | | | | | | | | | Keyboards and pointers aren't freed when devices are removed, so we should really be testing keyboard_device_count and pointer_device_count in most cases, not the actual pointers. Otherwise we end up with different behaviour after removing a device than we had before it was inserted. This commit renames the touch/keyboard/pointer pointers and adds helper functions to get them that hide this complexity and return NULL when *_device_count is 0. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
* input: Also pass appropriate pointer type when libva unavailableBryce Harrington2015-07-161-1/+1
|
* input: Pass the appropriate pointer type to bindings instead of a seatDerek Foreman2015-07-161-6/+9
| | | | | | | | | | | | | | | | | Normally we need to check if a seat's [device_type]_count is > 0 before we can use the associated pointer. However, in a binding you're guaranteed that the seat has a device of that type. If we pass in that type instead of the seat, it's obvious we don't have to test it. The bindings can still get the seat pointer via whatever->seat if they need it. This is preparation for a follow up patch that prevents direct access to seat->device_type pointers, and this will save us a few tests at that point. Reviewed-by: Jonas Ådahl <jadahl@gmail.com> Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
* compositor-drm: Simplify logic in setup_output_seat_constraintDerek Foreman2015-07-161-3/+5
| | | | | | | Use early return for a slight simplification. Reviewed-by: Jonas Ådahl <jadahl@gmail.com> Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
* compositor-drm: Refactor code into cursor_bo_update()Pekka Paalanen2015-07-161-15/+40
| | | | | | | | | | | | | | Cut a chunk of code out from drm_output_set_cursor() and form a new function for writing a cursor bo data from a weston_view with a wl_shm buffer. Add more asserts to verify the assumptions in there. v2: Use drm_compositor::cursor_{width,height} instead of hard-coded 64. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
* compositor-drm: Fix cursor view size checkDaniel Stone2015-07-161-3/+4
| | | | | | | | | Instead of testing against a hardcoded 64x64 pixel size to see if a view is suitable for promotion to a cursor plane, use our cursor_width and cursor_height variables. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
* compositor-drm: Record current DPMS levelDaniel Stone2015-07-161-2/+12
| | | | | | | | Track the current DPMS level for any given output, and track failure (or otherwise) of the DPMS-setting property call. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
* compositor-drm: Refactor getting current mode into a new functionPekka Paalanen2015-07-161-16/+27
| | | | | | | | Makes create_output_for_connector() slightly easier to read. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
* compositor-drm: Refactor connector name into new functionPekka Paalanen2015-07-161-10/+18
| | | | | | | | | | Refactor the code constructing the connector name into a new function. This makes create_output_for_connector() slightly easier to read. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* compositor-drm: Refactor initial mode out of create_outputPekka Paalanen2015-07-161-49/+119
| | | | | | | | | | | | | Refactor the code for choosing the initial mode for an output from create_output_for_connector() to drm_output_choose_initial_mode(). This makes create_output_for_connector() slightly easier to read. v2: Document everything. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
* compositor-drm: Allow instant start of repaint loop. (v4)Mario Kleiner2015-07-161-1/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drm_output_start_repaint_loop() incurred a delay of one refresh cycle by using a no-op page-flip to get an accurate vblank timestamp as reference. This causes unwanted lag whenever Weston exited its repaint loop, e.g., whenever an application wants to repaint with less than full video refresh rate but still minimum lag. Try to use the drmWaitVblank ioctl to get a proper timestamp instantaneously without lag. If that does not work, fall back to the old method of idle page-flip. This optimization will work on any drm/kms driver which supports high precision vblank timestamping. As of Linux 4.0 these would be intel, radeon and nouveau on all their supported gpu's. On kms drivers without instant high precision timestamping support, the kernel is supposed to return a timestamp of zero when calling drmWaitVblank() to query the current vblank count and time iff vblank irqs are currently disabled, because the only way to get a valid timestamp on such kms drivers is to enable vblank interrupts and then wait a bit for the next vblank irq to take a new valid timestamp. The caller is supposed to poll until at next vblank irq it gets a valid non-zero timestamp if it needs a timestamp. This zero-timestamp signalling works up to Linux 3.17, but got broken due to a regression in Linux 3.18 and later. On Linux 3.18+ with kms drivers that don't have high precision timestamping, the kernel erroneously returns a stale timestamp from an earlier vblank, ie. the vblank count and timestamp are mismatched. A patch is under way to fix this, but to deal with broken kernels, we also check non-zero timestamps if they are more than one refresh duration in the past, as this indicates a stale/invalid timestamp, so we need to take the page-flip fallback for restarting the repaint loop. v2: Implement review suggestions by Pekka Paalanen, especially extend the commit message to describe when and why the instant restart won't work due to missing Linux kernel functionality or a Linux kernel regression. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com> v3: Fix timespec_to_nsec() which was computing picoseconds, use the new timespec-util.h helpers. v4: Rebased to master, split long lines. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* compositor: add API to manage compositor instancesGiulio Camuffo2015-07-101-7/+1
| | | | | | | | | | | | | | | This commit adds three new exported functions: - weston_compositor_create() returns a new weston_compositor instance, initializing it as the now removed weston_compositor_init() did. - weston_compositor_exit(compositor) asks the compositor to tear down by calling the compositor's exit vfunc which is set by the libweston application. - weston_compositor_destroy(compositor) is called by the libweston application when tearing down the compositor. The compositor is destroyed and the memory freed. Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* compositor: introduce struct weston_backendGiulio Camuffo2015-07-091-323/+331
| | | | | | | | | | | | This is a preliminary change for libweston, with no functional modifications. Separate the backends and the core weston_compositor struct, by creating the weston_compositor in the main(), and having the various backends extend the weston_backend struct, an instance of which is returned by the backend entry point. This enable us to logically separate the compositor core from the backend, allowing the core to be extended without messing with the backends. Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* compositor-drm: fix drm_waitvblank_pipe() decl stylePekka Paalanen2015-07-021-1/+2
| | | | Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* compositor-drm: Add comment for newly added drm_waitvblank_pipe()Bryce Harrington2015-06-301-0/+13
|
* compositor-drm: Handle more than two output crtcs per cardMario Kleiner2015-06-301-2/+12
| | | | | | | | | | Allow proper handling of output->pipe > 1 to support triple-head graphics cards etc. by using the "high-crtc" support introduced in Linux 2.6.39 and libdrm 2.4.25 around May 2011. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
* compositor-drm: Allow weston_output_mode_switch_to_native() to work.Mario Kleiner2015-06-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | Initialize output->native_mode with the initially chosen mode for an output, so weston_output_mode_switch_to_native() has something to work with and can switch back from temporary selected modes to the outputs native mode. Before, this was a no-op. This allows an output to switch back to its default mode if a former toplevel fullscreen shell surface created via method WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER gets destroyed, or it gets demoted to non-fullscreen, or if modesetting on the output failed for some reason. v2: Modified and split into a separate patch from original patch "Allow restore_output_mode() to work properly.", as suggested by Derek Foreman. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Cc: Derek Foreman <derekf@osg.samsung.com> Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
* compositor-drm: Fix refresh rate selection in drm_output_switch_modeMario Kleiner2015-06-301-2/+2
| | | | | | | | | | | | | | The matching logic in choose_mode() compared refresh rate of a drm_mode candidate mode expressed in Hz against the requested refresh rate of the target weston_mode expressed in milliHz, so the match always failed and the logic always ended up the mode with the highest refresh rate for a given resolution, instead of the one matching the requested rate. Match proper fields to fix this. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
* Moved helper macro to a discrete include file.Jon Cruz2015-06-151-0/+1
| | | | | | | | | | | To help reduce code duplication and also 'kitchen-sink' includes the ARRAY_LENGTH macro was moved to a stand-alone file and referenced from the sources consuming it. Other macros will be added in subsequent passes. Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* src: Update boilerplate from MIT X11 license to MIT Expat licenseBryce Harrington2015-06-151-16/+19
|
* compositor-drm: Clean trailing whitespaceDaniel Stone2015-05-211-4/+4
| | | | Signed-off-by: Daniel Stone <daniels@collabora.com>