1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
From 3fc9fe078c850643f8070cce1d2b0307a9014523 Mon Sep 17 00:00:00 2001
From: "Sodhi, Vunny" <vunny.sodhi@intel.com>
Date: Fri, 13 Aug 2021 12:09:26 +0800
Subject: [meta-intel][PATCH] Fixed tile modifier issue for NV12 format
If we are using I915_FORMAT_MOD_Y_TILED which is needed for
NV12 format then modifiers need to be enabled which can be passed
as flags argument to ioctl.
Upstream-Status: Submitted
https://github.com/Intel-Media-SDK/MediaSDK/pull/2755
Signed-off-by: Sodhi, Vunny <vunny.sodhi@intel.com>
---
samples/sample_common/src/vaapi_utils_drm.cpp | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/samples/sample_common/src/vaapi_utils_drm.cpp b/samples/sample_common/src/vaapi_utils_drm.cpp
index 5ad73dd..73c8bd2 100644
--- a/samples/sample_common/src/vaapi_utils_drm.cpp
+++ b/samples/sample_common/src/vaapi_utils_drm.cpp
@@ -422,7 +422,7 @@ void* drmRenderer::acquire(mfxMemId mid)
int ret = m_drmlib.drmIoctl(m_fd, DRM_IOCTL_GEM_OPEN, &flink_open);
if (ret) return NULL;
- uint32_t handles[4], pitches[4], offsets[4], pixel_format;
+ uint32_t handles[4], pitches[4], offsets[4], pixel_format, flags = 0;
uint64_t modifiers[4];
memset(&handles, 0, sizeof(handles));
@@ -452,13 +452,14 @@ void* drmRenderer::acquire(mfxMemId mid)
pitches[1] = vmid->m_image.pitches[1];
offsets[1] = vmid->m_image.offsets[1];
modifiers[0] = modifiers[1] = I915_FORMAT_MOD_Y_TILED;
+ flags = 2; // DRM_MODE_FB_MODIFIERS (1<<1) /* enables ->modifer[]
}
else {
pixel_format = DRM_FORMAT_XRGB8888;
}
ret = m_drmlib.drmModeAddFB2WithModifiers(m_fd, vmid->m_image.width, vmid->m_image.height,
- pixel_format, handles, pitches, offsets, modifiers, &fbhandle, 0);
+ pixel_format, handles, pitches, offsets, modifiers, &fbhandle, flags);
if (ret) return NULL;
MSDK_ZERO_MEMORY(flink_close);
--
2.7.4
|