weston/libweston
Daniel Stone b040974398 gl-renderer: Set pitch correctly for subsampled textures
zwp_linux_dmabuf_v1 allows clients to pass an explicit pitch for each
plane, but wl_shm only takes a single pitch parameter; the pitch for
secondary planes must be inferred.

Multi-plane sub-sampled textures have partial width/height, e.g.
YUV420/I420 has a full-size Y plane, followed by a half-width/height U
plane, and a half-width/height V plane.

GStreamer's waylandsink - the only user of wl_shm YUV formats - expects
the implementation to follow the example of Xv and implicitly divide the
pitch for secondary planes by the subsampling factor. gl-renderer was
not doing this, and instead just using the (larger) stride provided by
the client for all planes in the buffer.

Fix gl-renderer to divide pitch by the subsampling factor when uploading
from subsampled SHM buffers into GL textures, also dividing co-ordinates
when doing offset partial uploads.

Tested with:
  $ gst-launch-1.0 videotestsrc ! waylandsink

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reported-by: Fabien Lahoudere <fabien.lahoudere@collabora.co.uk>
Tested-by: Fabien Lahoudere <fabien.lahoudere@collabora.co.uk>
Reviewed-by: Arnaud Vrac <avrac@freebox.fr>
Acked-by: Vincent ABRIOU <vincent.abriou@st.com>
Acked-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Fixes: fdeefe4241 ("gl-renderer: add support of WL_SHM_FORMAT_YUV420")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103063
2017-12-01 16:36:38 +00:00
..
animation.c
bindings.c libweston: Use struct timespec for touch down events 2017-11-27 11:42:07 +02:00
clipboard.c
compositor-drm.c compositor-drm, compositor-fbdev: stop suggesting root 2017-11-28 10:24:12 +02:00
compositor-drm.h
compositor-fbdev.c compositor-drm, compositor-fbdev: stop suggesting root 2017-11-28 10:24:12 +02:00
compositor-fbdev.h
compositor-headless.c
compositor-headless.h
compositor-rdp.c libweston: Use struct timespec for compositor time 2017-11-27 11:42:07 +02:00
compositor-rdp.h
compositor-wayland.c libweston: Use struct timespec for touch down events 2017-11-27 11:42:07 +02:00
compositor-wayland.h
compositor-x11.c libweston: Use struct timespec for compositor time 2017-11-27 11:42:07 +02:00
compositor-x11.h
compositor.c libweston: Use struct timespec for compositor time 2017-11-27 11:42:07 +02:00
compositor.h libweston: Use struct timespec for compositor time 2017-11-27 11:42:07 +02:00
data-device.c libweston: Use struct timespec for touch motion events 2017-11-27 11:42:07 +02:00
dbus.c
dbus.h
gl-renderer.c gl-renderer: Set pitch correctly for subsampled textures 2017-12-01 16:36:38 +00:00
gl-renderer.h
input.c libweston: Use struct timespec for touch motion events 2017-11-27 11:42:07 +02:00
launcher-direct.c
launcher-impl.h
launcher-logind.c
launcher-util.c libweston: Use struct timespec for key events 2017-11-27 11:42:07 +02:00
launcher-util.h
launcher-weston-launch.c
libbacklight.c
libbacklight.h
libinput-device.c libweston: Use struct timespec for touch down events 2017-11-27 11:42:07 +02:00
libinput-device.h
libinput-seat.c
libinput-seat.h
libweston-uninstalled.pc.in
libweston.pc.in
linux-dmabuf.c
linux-dmabuf.h
log.c
noop-renderer.c
pixel-formats.c
pixel-formats.h
pixman-renderer.c libweston: Use struct timespec for key events 2017-11-27 11:42:07 +02:00
pixman-renderer.h
plugin-registry.c
plugin-registry.h
screenshooter.c
spring-tool.c
timeline-object.h
timeline.c
timeline.h
vaapi-recorder.c
vaapi-recorder.h
version.h.in
vertex-clipping.c
vertex-clipping.h
weston-launch.c weston-launch: improve help text for -u and -t 2017-11-28 09:18:08 +02:00
weston-launch.h
weston-sync-file.h
windowed-output-api.h
zoom.c