diff options
author | Khem Raj <raj.khem@gmail.com> | 2023-06-18 10:45:46 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2023-06-18 10:47:32 -0700 |
commit | ceff4a5263bdebca3a58452b0a91470c20548124 (patch) | |
tree | a8a1b9aa854c2311e9e8005318c22a547da3da31 | |
parent | 79d5e2bbe40329e28de5e6d7522281ccfdbbb2b8 (diff) | |
download | meta-openembedded-ceff4a5263bdebca3a58452b0a91470c20548124.tar.gz |
xdg-desktop-portal-wlr: Fix build with older mesa
Some ports e.g. visionfive2 does not yet supported 21.1+ mesa
where gbm_bo_create_with_modifiers2 API is available, therefore
use gbm_bo_create_with_modifiers API for compatibility
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2 files changed, 55 insertions, 1 deletions
diff --git a/meta-multimedia/recipes-support/xdg-desktop-portal-wlr/xdg-desktop-portal-wlr/0001-screencast-Fix-build-with-older-mesa.patch b/meta-multimedia/recipes-support/xdg-desktop-portal-wlr/xdg-desktop-portal-wlr/0001-screencast-Fix-build-with-older-mesa.patch new file mode 100644 index 000000000..ff4fcc292 --- /dev/null +++ b/meta-multimedia/recipes-support/xdg-desktop-portal-wlr/xdg-desktop-portal-wlr/0001-screencast-Fix-build-with-older-mesa.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | From ef60a76e2a21b7649632dcf71d125039604a56b5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sun, 18 Jun 2023 10:42:19 -0700 | ||
4 | Subject: [PATCH] screencast: Fix build with older mesa | ||
5 | |||
6 | gbm_bo_create_with_modifiers2() is quite new and there are still distros | ||
7 | that ship 21.2 and older. e.g. powerVR mesa implementation | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | --- | ||
12 | src/screencast/pipewire_screencast.c | 8 ++++++-- | ||
13 | src/screencast/screencast_common.c | 4 ++-- | ||
14 | 2 files changed, 8 insertions(+), 4 deletions(-) | ||
15 | |||
16 | diff --git a/src/screencast/pipewire_screencast.c b/src/screencast/pipewire_screencast.c | ||
17 | index 0611fd5..7d66810 100644 | ||
18 | --- a/src/screencast/pipewire_screencast.c | ||
19 | +++ b/src/screencast/pipewire_screencast.c | ||
20 | @@ -234,9 +234,13 @@ static void pwr_handle_stream_param_changed(void *data, uint32_t id, | ||
21 | uint32_t n_params; | ||
22 | struct spa_pod_builder *builder[2] = {&b[0].b, &b[1].b}; | ||
23 | |||
24 | - struct gbm_bo *bo = gbm_bo_create_with_modifiers2(cast->ctx->gbm, | ||
25 | + struct gbm_bo *bo = gbm_bo_create_with_modifiers(cast->ctx->gbm, | ||
26 | cast->screencopy_frame_info[cast->buffer_type].width, cast->screencopy_frame_info[cast->buffer_type].height, | ||
27 | - cast->screencopy_frame_info[cast->buffer_type].format, modifiers, n_modifiers, flags); | ||
28 | + cast->screencopy_frame_info[cast->buffer_type].format, modifiers, n_modifiers); | ||
29 | + if(!bo) | ||
30 | + bo = gbm_bo_create(cast->ctx->gbm, | ||
31 | + cast->screencopy_frame_info[cast->buffer_type].width, cast->screencopy_frame_info[cast->buffer_type].height, | ||
32 | + cast->screencopy_frame_info[cast->buffer_type].format, GBM_BO_USE_RENDERING); | ||
33 | if (bo) { | ||
34 | modifier = gbm_bo_get_modifier(bo); | ||
35 | gbm_bo_destroy(bo); | ||
36 | diff --git a/src/screencast/screencast_common.c b/src/screencast/screencast_common.c | ||
37 | index d6d13db..2e4fc18 100644 | ||
38 | --- a/src/screencast/screencast_common.c | ||
39 | +++ b/src/screencast/screencast_common.c | ||
40 | @@ -143,8 +143,8 @@ struct xdpw_buffer *xdpw_buffer_create(struct xdpw_screencast_instance *cast, | ||
41 | uint32_t flags = GBM_BO_USE_RENDERING; | ||
42 | if (cast->pwr_format.modifier != DRM_FORMAT_MOD_INVALID) { | ||
43 | uint64_t *modifiers = (uint64_t*)&cast->pwr_format.modifier; | ||
44 | - buffer->bo = gbm_bo_create_with_modifiers2(cast->ctx->gbm, frame_info->width, frame_info->height, | ||
45 | - frame_info->format, modifiers, 1, flags); | ||
46 | + buffer->bo = gbm_bo_create_with_modifiers(cast->ctx->gbm, frame_info->width, frame_info->height, | ||
47 | + frame_info->format, modifiers, 1); | ||
48 | } else { | ||
49 | if (cast->ctx->state->config->screencast_conf.force_mod_linear) { | ||
50 | flags |= GBM_BO_USE_LINEAR; | ||
51 | -- | ||
52 | 2.41.0 | ||
53 | |||
diff --git a/meta-multimedia/recipes-support/xdg-desktop-portal-wlr/xdg-desktop-portal-wlr_0.7.0.bb b/meta-multimedia/recipes-support/xdg-desktop-portal-wlr/xdg-desktop-portal-wlr_0.7.0.bb index cfc7109c0..b845c5f79 100644 --- a/meta-multimedia/recipes-support/xdg-desktop-portal-wlr/xdg-desktop-portal-wlr_0.7.0.bb +++ b/meta-multimedia/recipes-support/xdg-desktop-portal-wlr/xdg-desktop-portal-wlr_0.7.0.bb | |||
@@ -16,7 +16,8 @@ DEPENDS = " \ | |||
16 | inherit meson pkgconfig features_check | 16 | inherit meson pkgconfig features_check |
17 | REQUIRED_DISTRO_FEATURES = "opengl wayland" | 17 | REQUIRED_DISTRO_FEATURES = "opengl wayland" |
18 | 18 | ||
19 | SRC_URI = "git://github.com/emersion/xdg-desktop-portal-wlr.git;protocol=https;nobranch=1" | 19 | SRC_URI = "git://github.com/emersion/xdg-desktop-portal-wlr.git;protocol=https;nobranch=1 \ |
20 | file://0001-screencast-Fix-build-with-older-mesa.patch" | ||
20 | 21 | ||
21 | S = "${WORKDIR}/git" | 22 | S = "${WORKDIR}/git" |
22 | SRCREV = "776113a4f014639c29d8de8fcb513493ef7b491f" | 23 | SRCREV = "776113a4f014639c29d8de8fcb513493ef7b491f" |