Use struct pixel_format_info pointers instead of pixman_format_code_t
values at the API surface for output and image creation.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Add weston_renderbuffer_ref/unref() functions and use them to
eventually destroy the weston_renderbuffer. Drop the explicit
renderbuffer_destroy vfunc from the pixman renderer interface.
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Given that pixman_image_create_bits_no_clear() is asked to allocate the
buffer on its own, the _no_clear part is not important. Drop it.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Move the call to weston_output_update_capture_info() from the headless
backend into pixman_renderer_output_create(). For this, add an
uint32_t drm_format parameter to struct pixman_renderer_output_options.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Add a private struct pixman_renderbuffer that derives from struct
weston_renderbuffer and move the pixman renderer specific image and link
fields into it.
Add a pixman_renderbuffer_get_image() helper for the backends that need
to access the contained pixman image, RDP and X11.
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Add a damage region to struct weston_renderbuffer and use it to replace
the previous_damage tracking in the drm backend.
Keep renderbuffers on a list in struct pixman_output_state and use it
to accumulate damage on all renderbuffers during repaint_output.
Now renderbuffers have to be created when pixman output state already
exists.
Reorder renderer output state and renderbuffer creation accordingly.
With this, pixman_renderer_output_set_hw_extra_damage() can be removed.
This can not yet replace the external damage tracking in the VNC
backend, which needsto know the accumulated damage that is not returned
from repaint_output.
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Add a struct weston_renderbuffer parameter to repaint_output and make
backends set the pixman image renderbuffer through this parameter
instead of using pixman_renderer_output_set_buffer()
Turn pixman_renderer_output_set_buffer() static.
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Add a create_image_from_ptr vfunc to struct pixman_renderer_interface,
which wraps weston_renderbuffer creation for the pixman renderer via
pixman_image_create_bits(), as well as a renderbuffer_destroy vfunc
to dispose of the pixman image renderbuffer.
Also add create_image_no_clear using pixman_image_create_bits_no_clear()
instead.
Make the backends create and destroy their pixman image renderbuffers
through this interface.
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Add a struct pixman_renderer_interface with output_create and
output_destroy vfuncs and store a pointer to it in struct
weston_renderer.
Make all backends access the pixman_renderer_output_create/destroy
functions through this interface and turn them static.
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
In a journey to decouple renderer from weston_output, pass the initial
framebuffer size to Pixman-renderer explicitly.
Now Pixman-renderer will never look into weston_output::current_mode.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
pixman_renderer_output_create currently takes a flags enum bitmask for
its options. Switch this to using a structure, so we can introduce other
non-boolean options.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Introduce a new private header file that only internal backends are
allowed to use. Starts by migrating functions that operate on the
'struct weston_head'.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Introduce a new private header file that only internal parts of the
library are allowed to use and shouldn't be exposed in the public header
of libweston.
Start by adding by adding functions that operate on the 'weston_buffer*'.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
The main idea is to make libweston users use the form
#include <libweston/libweston.h>
instead of the plain
#include <compositor.h>
which is prone to name conflicts. This is reflected both in the installed
files, and the internal header search paths so that Weston would use the exact
same form as an external project using libweston would.
The public headers are moved under a new top-level directory include/ to make
them clearly stand out as special (public API).
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Add a flag to pixman-renderer for initializing the output with a shadow
framebuffer. All backends were getting the shadow implcitly, so all
backends are modified to ask for the shadow explicitly.
Using a shadow buffer is usually beneficial, because read-modify-write
cycles (blending) into a scanout-capable buffer may be very slow. The
scanout framebuffer may also have reduced color depth, making blending
and read-back produce inferior results.
In some use cases though the shadow buffer might be just an extra copy
hurting more than it helps. Whether it helps or hurts depends on the
platform and the workload. Therefore let the backends control whether
pixman-renderer uses a shadow buffer for an output or not.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Pixman-renderer uses a single internal shadow buffer. It is enough to
composite the current damage into shadow, but the copy to hw buffer
needs to include the previous damage because of double-buffering in
DRM-backend.
This patch lets pixman-renderer do exactly that without compositing also
the previous damage on DRM-renderer.
Arguably weston_output should not have field previous_damage to begin
with, because it implies double-buffering, which e.g. EGL does not
guarantee. It would be better for each backend explicitly always provide
any extra damage that should be copied to hw.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Reviewed-by: Ian Ray <ian.ray@ge.com>
This clarifies what is supposed to be the libweston code.
v2: screen-share.c is already in compositor/ instead.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Tested-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Tested-by: Benoit Gschwind <gschwind@gnu-log.net>
Acked-by: Benoit Gschwind <gschwind@gnu-log.net>
[Pekka: rebased]