[gnome-remote-desktop] rdp-pipewire-stream: Fix usage of implicit DRM format modifiers
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-remote-desktop] rdp-pipewire-stream: Fix usage of implicit DRM format modifiers
- Date: Mon, 25 Apr 2022 19:36:37 +0000 (UTC)
commit 60244e96333fbeabfee9c1a0e5ce56590dbb313d
Author: Pascal Nowack <Pascal Nowack gmx de>
Date: Sun Apr 24 17:51:09 2022 +0200
rdp-pipewire-stream: Fix usage of implicit DRM format modifiers
When using implicit modifiers, instead of explicit modifiers, then no
modifiers should be submitted to the attributes of an EGL image.
The EGL thread already takes care of the situation, when no modifiers
are submitted.
However, the RDP pipewire stream class does not and happily submits
invalid modifiers, leading to undefined results.
Fix this, by only submitting DRM format modifiers, when they are
explicit, i.e. modifier != DRM_FORMAT_MOD_INVALID.
See also:
https://github.com/obsproject/obs-studio/pull/5221/commits/de46b491c2681c0cf4b2557a149f654a9c72d8a7
src/grd-rdp-pipewire-stream.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/grd-rdp-pipewire-stream.c b/src/grd-rdp-pipewire-stream.c
index 3281efb0..f2fec6d5 100644
--- a/src/grd-rdp-pipewire-stream.c
+++ b/src/grd-rdp-pipewire-stream.c
@@ -758,7 +758,7 @@ process_frame_data (GrdRdpPipeWireStream *stream,
int *fds;
uint32_t *offsets;
uint32_t *strides;
- uint64_t *modifiers;
+ uint64_t *modifiers = NULL;
uint32_t n_planes;
unsigned int i;
uint8_t *dst_data = NULL;
@@ -779,14 +779,16 @@ process_frame_data (GrdRdpPipeWireStream *stream,
fds = g_alloca (sizeof (int) * n_planes);
offsets = g_alloca (sizeof (uint32_t) * n_planes);
strides = g_alloca (sizeof (uint32_t) * n_planes);
- modifiers = g_alloca (sizeof (uint64_t) * n_planes);
+ if (stream->spa_format.modifier != DRM_FORMAT_MOD_INVALID)
+ modifiers = g_alloca (sizeof (uint64_t) * n_planes);
for (i = 0; i < n_planes; i++)
{
fds[i] = buffer->datas[i].fd;
offsets[i] = buffer->datas[i].chunk->offset;
strides[i] = buffer->datas[i].chunk->stride;
- modifiers[i] = stream->spa_format.modifier;
+ if (modifiers)
+ modifiers[i] = stream->spa_format.modifier;
}
if (!stream->rdp_surface->needs_no_local_data)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]