summaryrefslogtreecommitdiffstats
path: root/recipes-multimedia/onevpl/onevpl/0001-samples-Fixed-tile-modifier-issue-for-NV12-format.patch
blob: c798e3f1d0411822d6f06679905d66bc569995a6 (plain)
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
50
51
From 15cc366b66b625b0b2613a4365e7777563325a94 Mon Sep 17 00:00:00 2001
From: "Yew, Chang Ching" <chang.ching.yew@intel.com>
Date: Wed, 25 Aug 2021 11:20:30 +0000
Subject: [PATCH 2/2] samples: 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
innersource PR #221

Signed-off-by: Sodhi, Vunny <vunny.sodhi@intel.com>
Signed-off-by: Yew, Chang Ching <chang.ching.yew@intel.com>
---
 tools/legacy/sample_common/src/vaapi_utils_drm.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/legacy/sample_common/src/vaapi_utils_drm.cpp b/tools/legacy/sample_common/src/vaapi_utils_drm.cpp
index cf8d7ba7..3df3bb8a 100644
--- a/tools/legacy/sample_common/src/vaapi_utils_drm.cpp
+++ b/tools/legacy/sample_common/src/vaapi_utils_drm.cpp
@@ -405,7 +405,7 @@ void* drmRenderer::acquire(mfxMemId mid) {
         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));
@@ -435,6 +435,7 @@ 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;
@@ -449,7 +450,7 @@ void* drmRenderer::acquire(mfxMemId mid) {
                                                   offsets,
                                                   modifiers,
                                                   &fbhandle,
-                                                  0);
+                                                  flags);
 
         if (ret)
             return NULL;
-- 
2.31.1