diff options
Diffstat (limited to 'dynamic-layers/chromium-browser-layer/recipes-browser/chromium/chromium-ozone-wayland/0119-V4L2VDA-dlopen-libg2d.so.2-to-avoid-segfault.patch')
-rw-r--r-- | dynamic-layers/chromium-browser-layer/recipes-browser/chromium/chromium-ozone-wayland/0119-V4L2VDA-dlopen-libg2d.so.2-to-avoid-segfault.patch | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/dynamic-layers/chromium-browser-layer/recipes-browser/chromium/chromium-ozone-wayland/0119-V4L2VDA-dlopen-libg2d.so.2-to-avoid-segfault.patch b/dynamic-layers/chromium-browser-layer/recipes-browser/chromium/chromium-ozone-wayland/0119-V4L2VDA-dlopen-libg2d.so.2-to-avoid-segfault.patch new file mode 100644 index 00000000..df6c6fe4 --- /dev/null +++ b/dynamic-layers/chromium-browser-layer/recipes-browser/chromium/chromium-ozone-wayland/0119-V4L2VDA-dlopen-libg2d.so.2-to-avoid-segfault.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | From 4e33abf0778eba9b6bf5bf4fc01e021775b7d2c7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Hou Qi <qi.hou@nxp.com> | ||
3 | Date: Thu, 29 Sep 2022 11:12:12 +0800 | ||
4 | Subject: [PATCH] V4L2VDA: dlopen libg2d.so.2 to avoid segfault | ||
5 | |||
6 | For rootfs that have no libg2d.so, dlopen libg2d.so.2 instead. | ||
7 | |||
8 | Upstream-Status: Inappropriate [NXP specific] | ||
9 | --- | ||
10 | media/gpu/v4l2/v4l2_device.cc | 5 +++-- | ||
11 | 1 file changed, 3 insertions(+), 2 deletions(-) | ||
12 | |||
13 | diff --git a/media/gpu/v4l2/v4l2_device.cc b/media/gpu/v4l2/v4l2_device.cc | ||
14 | index af71f54d141aa..139d32d3a788f 100644 | ||
15 | --- a/media/gpu/v4l2/v4l2_device.cc | ||
16 | +++ b/media/gpu/v4l2/v4l2_device.cc | ||
17 | @@ -286,6 +286,7 @@ typedef struct g2d_buf* (*g2d_api_alloc)(int size, int cacheable); | ||
18 | typedef int (*g2d_api_buf_export_fd)(struct g2d_buf *); | ||
19 | typedef int (*g2d_api_blitEx)(void *handle, struct g2d_surfaceEx *srcEx, struct g2d_surfaceEx *dstEx); | ||
20 | |||
21 | +#define G2D_LIB_NAME "/usr/lib/libg2d.so.2" | ||
22 | #define G2D_API_SYM(name) g2d_api_##name g2d_##name = nullptr | ||
23 | G2D_API_SYM(open); | ||
24 | G2D_API_SYM(close); | ||
25 | @@ -1908,10 +1909,10 @@ scoped_refptr<V4L2Device> V4L2Device::Create() { | ||
26 | |||
27 | device = new GenericV4L2Device(); | ||
28 | if (device->Initialize()) { | ||
29 | - dl_handle = dlopen("/usr/lib/libg2d.so", | ||
30 | + dl_handle = dlopen(G2D_LIB_NAME, | ||
31 | RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE | RTLD_LAZY); | ||
32 | if (!dl_handle) { | ||
33 | - VLOGF(1) << "Has no libg2d.so"; | ||
34 | + VLOGF(1) << "Failed to dlopen " << G2D_LIB_NAME; | ||
35 | return device; | ||
36 | } | ||
37 | |||
38 | -- | ||
39 | 2.17.1 | ||
40 | |||