Commit Graph

13 Commits

Author SHA1 Message Date
Stefan Agner 0bb9447653 renderer: change all frame_signal emission to pass previous_damage
Commit adaf8c7410 ("renderer: change frame_signal emission to pass
previous_damage as data argument") missed updating all frame_signal
emissions. Later commit 2619bfe420 ("move frame_signal emission to
weston_output_repaint()") fixed this deficency along with moving the
location of the emission. Due to an issue of the location change, this
commit had to be reverted again.

This makes sure that the pixman as well as the GL renderer now also
emits the damage region instead of the Weston output.

Fixes: adaf8c7410 ("renderer: change frame_signal emission to pass previous_damage as data argument")
Signed-off-by: Stefan Agner <stefan@agner.ch>
2019-12-09 13:32:07 +01:00
Leandro Ribeiro 2eee164f24 libweston: remove previous_damage from struct weston_output
The member previous_damage from struct weston_output is no longer necessary.
First, stop calling init, fini and copying output_damage to it. Then remove
it from struct weston_output.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2019-12-04 07:58:26 +00:00
Leandro Ribeiro 914c96c3d2 Revert "move frame_signal emission to weston_output_repaint()"
The emission of frame_signal has to happen before a flip, otherwise
glReadPixels() could read an old frame or even worse an uninitialized buffer.
So move frame_signal emission back to renderers.

This reverts commit 2619bfe420.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2019-12-03 12:31:53 -03:00
Leandro Ribeiro 2619bfe420 move frame_signal emission to weston_output_repaint()
In order to remove duplication and make the code easier to follow, move
frame_signal emission from renderers to weston_output_repaint(). This should
have no observable effect.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2019-11-27 13:18:42 -03:00
Stefan Agner da2e574ca9 pixman: avoid unnecessary y-flip for screen capture
Commit 4fc5dd0099 ("compositor: add capability CAPTURE_YFLIP")
introduced a capability flag which indicates whether y-flipping is
necessary. As already indicated in that commit message, it seems
that pixman flipps the y-axis only due to historic reasons.

Drop y-flipping and use the WESTON_CAP_CAPTURE_YFLIP flag to
indicate that y-flipping is not necessary. This simplifies code
and improves screen share performance (on my test by about 3% down
to 18% CPU load on the sharing instance of Weston).

Signed-off-by: Stefan Agner <stefan@agner.ch>
2019-08-01 08:19:15 +00:00
Alexandros Frantzis 676296749a libweston: Support zwp_surface_synchronization_v1.get_release
Implement the get_release request of the zwp_surface_synchronization_v1
interface.

This commit implements the zwp_buffer_release_v1 interface. It supports
the zwp_buffer_release_v1.fenced_release event for surfaces rendered by
the GL renderer, and the zwp_buffer_release_v1.immediate_release event
for other cases.

Note that the immediate_release event is safe to be used for surface
buffers used as planes in the DRM backend, since the backend releases
them only after the next page flip that doesn't use the buffers has
finished.

Changes in v7:
  - Remove "partial" from commit title and description.
  - Fix inverted check when clearing used_in_output_repaint flag.

Changes in v5:
  - Use the new, generic explicit sync server error reporting function.
  - Introduce and use weston_buffer_release_move.
  - Introduce internally and use weston_buffer_release_destroy.

Changes in v4:
  - Support the zwp_buffer_release_v1.fenced_release event.
  - Support release fences in the GL renderer.
  - Assert that pending state buffer_release is always NULL after a
    commit.
  - Simplify weston_buffer_release_reference.
  - Move removal of destroy listener before resource destruction to
    avoid concerns about use-after-free in
    weston_buffer_release_reference
  - Rename weston_buffer_release_reference.busy_count to ref_count.
  - Add documentation for weston_buffer_release and ..._reference.

Changes in v3:
  - Raise NO_BUFFER for get_release if no buffer has been committed,
    don't raise UNSUPPORTED_BUFFER for non-dmabuf buffers,
    so get_release works for all valid buffers.
  - Destroy the buffer_release object after sending an event.
  - Track lifetime of buffer_release objects per commit, independently
    of any buffers.
  - Use updated protocol interface names.
  - Use correct format specifier for resource ids.

Changes in v2:
  - Raise UNSUPPORTED_BUFFER at commit if client has requested a
    buffer_release, but the committed buffer is not a valid linux_dmabuf.
  - Remove tests that are not viable anymore due to our inability to
    create dmabuf buffers and fences in a unit-test environment.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2019-02-06 12:21:56 +00:00
Vasilis Liaskovitis 486b463a18 gl-renderer, pixman: disconnect the client on unhandled buffer type.
Introduce a helper function to disconnect the client on unhandled
buffer types, and use it in the gl and pixman renderers. The function
is modeled after linux_dmabuf_buffer_send_server_error.

Also print the egl error state in the gl renderer, in case the
unrecognized buffer error happens when querying an egl buffer.

https://gitlab.freedesktop.org/wayland/weston/issues/148
2018-11-02 14:28:05 +00:00
Philipp Zabel 195dadeb2a libweston: add weston_surface is_opaque property
Add an is_opaque property that is set to true if the attached buffer does not
have an alpha component, or if the solid color is non-transparent.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
2018-09-18 19:21:46 +02:00
Pekka Paalanen 26ded94aa0 pixman: make shadow buffer optional
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>
2018-05-24 17:20:04 +03:00
Pekka Paalanen acf50c3d96 pixman,drm: do not composite previous damage
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>
2018-05-24 17:20:04 +03:00
Alexandros Frantzis 47e79c860b libweston: Use struct timespec for key events
Change code related to key events to use struct timespec to represent
time.

This commit is part of a larger effort to transition the Weston codebase
to struct timespec.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-11-27 11:42:07 +02:00
Jussi Kukkonen 649bbce607 include stdint.h for int32_t/uint32_t
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2016-07-26 16:26:08 -07:00
Pekka Paalanen b5e3ea218b Rename src/ to libweston/
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]
2016-06-23 17:44:54 +03:00