diff options
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 0000000000..ff4fcc292a --- /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 cfc7109c0c..b845c5f792 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" |
