mirror of
https://github.com/nxp-imx/meta-imx.git
synced 2025-07-19 18:39:09 +02:00
41 lines
1.4 KiB
Diff
41 lines
1.4 KiB
Diff
From 4e33abf0778eba9b6bf5bf4fc01e021775b7d2c7 Mon Sep 17 00:00:00 2001
|
|
From: Hou Qi <qi.hou@nxp.com>
|
|
Date: Thu, 29 Sep 2022 11:12:12 +0800
|
|
Subject: [PATCH] V4L2VDA: dlopen libg2d.so.2 to avoid segfault
|
|
|
|
For rootfs that have no libg2d.so, dlopen libg2d.so.2 instead.
|
|
|
|
Upstream-Status: Inappropriate [NXP specific]
|
|
---
|
|
media/gpu/v4l2/v4l2_device.cc | 5 +++--
|
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/media/gpu/v4l2/v4l2_device.cc b/media/gpu/v4l2/v4l2_device.cc
|
|
index af71f54d141aa..139d32d3a788f 100644
|
|
--- a/media/gpu/v4l2/v4l2_device.cc
|
|
+++ b/media/gpu/v4l2/v4l2_device.cc
|
|
@@ -286,6 +286,7 @@ typedef struct g2d_buf* (*g2d_api_alloc)(int size, int cacheable);
|
|
typedef int (*g2d_api_buf_export_fd)(struct g2d_buf *);
|
|
typedef int (*g2d_api_blitEx)(void *handle, struct g2d_surfaceEx *srcEx, struct g2d_surfaceEx *dstEx);
|
|
|
|
+#define G2D_LIB_NAME "/usr/lib/libg2d.so.2"
|
|
#define G2D_API_SYM(name) g2d_api_##name g2d_##name = nullptr
|
|
G2D_API_SYM(open);
|
|
G2D_API_SYM(close);
|
|
@@ -1908,10 +1909,10 @@ scoped_refptr<V4L2Device> V4L2Device::Create() {
|
|
|
|
device = new GenericV4L2Device();
|
|
if (device->Initialize()) {
|
|
- dl_handle = dlopen("/usr/lib/libg2d.so",
|
|
+ dl_handle = dlopen(G2D_LIB_NAME,
|
|
RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE | RTLD_LAZY);
|
|
if (!dl_handle) {
|
|
- VLOGF(1) << "Has no libg2d.so";
|
|
+ VLOGF(1) << "Failed to dlopen " << G2D_LIB_NAME;
|
|
return device;
|
|
}
|
|
|
|
--
|
|
2.17.1
|
|
|