summaryrefslogtreecommitdiff
path: root/src/rpi-renderer.c
Commit message (Collapse)AuthorAgeFilesLines
* compositor: Change "touched" to boolDerek Foreman2015-11-201-2/+2
| | | | | Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* Provide damage region for screen recording on Raspberry PiShinya Saito2015-10-291-0/+1
| | | | | | | | | | | | When trying to do sceen recording using the screenshooter, no screen data was ever processed because the rpi-renderer never set the previous frames damage area. Update the rpi-renderer to copy the necessary data. Signed-off-by: Shinya Saito <ssaito@igel.co.jp> Signed-off-by: Tomohito Esaki <etom@igel.co.jp> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* rpi: avoid segfault in rpir_view_compute_rects() when EGL client destroys bufferJohn Sadler2015-09-081-0/+3
| | | | | | | | | | | | | | | | | This commit works-around a serious issue when running with the RPi backend. When an EGL client shuts down and destroys it's EGL window, Weston dies with a segmentation fault in the above function (because `buffer` is now NULL). The addition of a simple NULL check avoids the problem. This is a minor re-formatting of the patch already submitted here: http://patchwork.freedesktop.org/patch/34885 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85167 Signed-off-by: John Sadler <deathofathousandpapercuts@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* Coding style fixesDawid Gajownik2015-08-071-1/+1
| | | | | | | | | - opening braces are on the same line as the if statement - opening braces are not on the same line as the function name - space between for/while/if and opening parenthesis Signed-off-by: Dawid Gajownik <gajownik@gmail.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
* rpi-renderer: use weston_output matrix instead of a private matrixDerek Foreman2015-08-061-65/+3
| | | | | | | | We already do this math in compositor.c so let's not duplicate it here. Additionally, the copy here has broken zoom, so this also fixes zooming. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Acked-by: Daniel Stone <daniels@collabora.com>
* Unified multiple definitions of container_of() macro.Jon Cruz2015-06-151-0/+1
| | | | | | | | | Removed duplicate definitions of the container_of() macro and refactored sources to use the single implementation. 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
|
* rpi-renderer: minimal fix to zoom coordinatesPekka Paalanen2015-03-111-6/+4
| | | | | | | | | | | | | The patch "zoom: Use pixels instead of GL coordinates" changed the meaning of weston_output_zoom::trans_x,trans_y from GL coordinate system to global coordinates. This patch is a minimal untested change to the rpi-renderer to try and follow up on that change. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-By: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* rpi-renderer: don't pass a box to pixman_region32_contains_point()Derek Foreman2014-12-011-2/+1
| | | | | | | We don't care which box contained the point, so don't pass one in. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
* Use zalloc instead of calloc(1, ...)Bryce Harrington2014-11-281-8/+8
| | | | | Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
* Setting members to 0/NULL after a zalloc or calloc is redundantBryce Harrington2014-11-281-1/+0
| | | | | | | | | | calloc (and zalloc) set the allocated memory to 0, so there's really no need to do it manually. Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Marek Chalupa <mchqwerty@gmail.com> [Pekka: dropped the src/evdev.c hunk.] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* rpi: build fix for compute_rects debugPekka Paalanen2014-05-091-2/+2
| | | | | | See 918f2dd4cfb8b177f67b45653efbbe4325cbe9dc Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* rpi: call eglTerminate if we're bailingU. Artie Eoff2014-01-191-0/+1
| | | | Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
* rpi-backend: ensure pixels is destroyed in resource_updateU. Artie Eoff2014-01-191-6/+8
| | | | Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
* rpi: free renderer if we bail early during createU. Artie Eoff2014-01-191-0/+3
| | | | Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
* Remove the weston_view.geometry.width/height fieldsJason Ekstrand2013-12-021-2/+2
| | | | | | | | | | This has a couple of additional implications for the internal weston API: 1) weston_view_configure no longer exists. Use weston_view_set_position instead. 2) The weston_surface.configure callback no longer takes a width and height. If you need these, surface.width/height are set before configure is called. If you need to know when the width/height changes, you must track that yourself.
* rpi: Support opaque regionsTomeu Vizoso2013-12-021-4/+116
| | | | | | | | This is needed for XWayland surfaces with alpha channel, as X will be sending crap in there that should be discarded. This is currently done with a copy in the compositor, while we wait for support in the VideoCore side.
* rpi: avoid vc_dispmanx_set_wl_buffer_in_use without EGLPekka Paalanen2013-11-271-2/+18
| | | | | | | | | | | | | | | | | | | | | | The symbol is needed only for the EGL buffer path. If --disable-egl is given to ./configure, there is no need for it, so fix it to actually not look for that symbol needlessly. This should fix the runtime error: Failed to load module: .../rpi-backend.so: undefined symbol: vc_dispmanx_set_wl_buffer_in_use when you use --disable-egl and do not have a recent enough libraspberrypi package (/opt/vc, a.k.a userland.git) that would provide vc_dispmanx_set_wl_buffer_in_use. Apparently no released version of userland yet provides this. The calls are organized into two helper functions to avoid a boolean argument, and put the #ifdefs away from the main parts of the code. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Cc: Tomeu Vizoso <tomeu@tomeuvizoso.net>
* Add calls to wl_shm_buffer_begin/end_accessNeil Roberts2013-11-131-0/+4
| | | | | | This wraps all accesses to an SHM buffer between wl_shm_buffer_begin and end so that wayland-shm can install a handler for SIGBUS and catch attempts to pass the compositor a buffer that is too small.
* rpi: Remove create_view and destroy_view implementationsTomeu Vizoso2013-10-281-5/+24
| | | | | And also remove the vfunc definitions from the compositor as they are unused now.
* compositor: Let renderers create and destroy surface state on their ownAnder Conselvan de Oliveira2013-10-251-19/+35
| | | | | | | | | | | | | Remove create_surface() and destroy_surface() from the renderer interface and change the renderers to create surface state on demand and destroy it using the weston_surface's destroy signal. Also make sure the surfaces' renderer state is reset to NULL on destruction. This is a step towards runtime switchable renderers. (rpi-renderer changes are only compile-tested)
* rpi: Protect in-use DispmanX resources from premature deletionTomeu Vizoso2013-10-251-33/+41
| | | | | | The compositor will check if the client destroyed the wl_buffer while it was in use in a display update, and delete the resource itself once the update has finished.
* rpi: Remove dangling reference to weston_viewTomeu Vizoso2013-10-251-0/+2
| | | | This also marks the rpir_view for destroy in rpi_renderer_finish_frame()
* rpi: Only check for prematurely destroyed wl_buffers in the EGL caseTomeu Vizoso2013-10-251-2/+3
|
* rpi: EGL surfaces need to be swapped always that we have an incoming back bufferTomeu Vizoso2013-10-251-1/+2
|
* rpi: Fix logging of buffer swaps for the EGL caseTomeu Vizoso2013-10-251-1/+2
|
* rpi: Initialize surface's list of viewsTomeu Vizoso2013-10-251-0/+1
|
* Split the geometry information from weston_surface out into weston_viewJason Ekstrand2013-10-221-172/+279
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The weston_surface structure is split into two structures: * The weston_surface structure storres everything required for a client-side or server-side surface. This includes buffers; callbacks; backend private data; input, damage, and opaque regions; and a few other bookkeeping bits. * The weston_view structure represents an entity in the scenegraph and storres all of the geometry information. This includes clip region, alpha, position, and the transformation list as well as all of the temporary information derived from the geometry state. Because a view, and not a surface, is a scenegraph element, the view is what is placed in layers and planes. There are a few things worth noting about the surface/view split: 1. This is *not* a modification to the protocol. It is, instead, a modification to Weston's internal scenegraph to allow a single surface to exist in multiple places at a time. Clients are completely unaware of how many views to a particular surface exist. 2. A view is considered a direct child of a surface and is destroyed when the surface is destroyed. Because of this, the view.surface pointer is always valid and non-null. 3. The compositor's surface_list is replaced with a view_list. Due to subsurfaces, building the view list is a little more complicated than it used to be and involves building a tree of views on the fly whenever subsurfaces are used. However, this means that backends can remain completely subsurface-agnostic. 4. Surfaces and views both keep track of which outputs they are on. 5. The weston_surface structure now has width and height fields. These are populated when a new buffer is attached before surface.configure is called. This is because there are many surface-based operations that really require the width and height and digging through the views didn't work well. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
* rpi: Remove redundant castTomeu Vizoso2013-10-101-2/+1
|
* rpi: Add support for EGL buffersTomeu Vizoso2013-10-081-28/+243
| | | | | | The EGL implementation on the RPi allocates a front and a back DispmanX resources for each EGLSurface, which we composite along the others.
* Rename current, origin, scale, origin_scaleHardening2013-09-211-2/+2
| | | | This patch renames that fields to have consistent names.
* rpi: Add support for SHM buffers in RGB565 formatTomeu Vizoso2013-08-061-0/+4
|
* Add a weston_buffer structure to replace wl_bufferJason Ekstrand2013-06-211-12/+18
| | | | | | | | | This commit adds a weston_buffer structure to replace wl_buffer. This way we can hold onto buffers by just their resource. In order to do this, the every renderer.attach function has to fill in the weston_buffer.width and weston_buffer.height fields. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
* configure.ac: Enable AC_USE_SYSTEM_EXTENSIONSDaniel Stone2013-06-051-2/+2
| | | | | | | | | | | | | | | | | | AC_USE_SYSTEM_EXTENSIONS enables _XOPEN_SOURCE, _GNU_SOURCE and similar macros to expose the largest extent of functionality supported by the underlying system. This is required since these macros are often limiting rather than merely additive, e.g. _XOPEN_SOURCE will actually on some systems hide declarations which are not part of the X/Open spec. Since this goes into config.h rather than the command line, ensure all source is consistently including config.h before anything else, including system libraries. This doesn't need to be guarded by a HAVE_CONFIG_H ifdef, which was only ever a hangover from the X.Org modular transition. Signed-off-by: Daniel Stone <daniel@fooishbar.org> [pq: rebased and converted more files]
* rpi: add a Dispmanx rendererPekka Paalanen2013-05-221-0/+1370
Dispmanx is the prorietary display API on the Raspberry Pi, which provides hardware compositing. Every visible surface is assigned a Dispmanx element, and the hardware or firmware will do all compositing onto screen. The API supports translation, scaling, flips, discrete rotations in 90-degree steps, alpha channel on the surfaces, and full-surface alpha on top. Previously, Dispmanx capabilities were used via the weston_plane mechanism, where surfaces were assigned to planes when possible, and otherwise transparently falling back to GLESv2 compositing. Because we have no way to use the same memory buffer as a GL texture and a Dispmanx resource, we had to prepare for both. In the worst case, that means one GL texture, and two (double-buffered case) Dispmanx resources, all the size of a whole surface, for all surfaces. This was eating memory fast. To make things worse (and less slow), the wl_shm buffer was kept around, since it was copied to either a texture or a resource as needed. This caused all clients to need two buffers. In a Dispmanx-only renderer, we can drop the GL texture, and we can release wl_shm buffer immediately after the first copy, so clients become effectively single-buffered. So from the worst case of 5 buffers per surface, we go down to 3 or just 2 (single-buffered Dispmanx element, one wl_shm buffer in the client) buffers per surface. As this will replace the GL renderer on rpi, we cannot fall back to the GLESv2 compositing anymore. We lose arbitrary surface rotation, but we lose also the GL fallback, which caused glitches. This patch depends on new RaspberryPi firmware. Older firmware may not render ARGB surfaces correctly, solid color surfaces maybe cause a performance hit, and the output may completely fail in case the firmware does not fall back internal off-line compositing properly as needed. This new rpi-renderer support surface translation and scaling, but not rotation or transpose (not even in 90-deg steps). In theory, 90-deg step surface rotation is possible to support. Output transformations are supported, but flipped variants do not seem to work right. As a detail, menus and other surfaces that are simply translated with respect to another surface caused falling back to the GL renderer. The rpi-renderer handles them directly. This patch only adds the new renderer, but does not hook it up into use. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>