Skip to content

Commit d083601

Browse files
committed
Upgrade media driver to 2021Q3 Release - 21.3.5
This change includes: 1. Rebase media driver to 2021Q3 Release - 21.3.5 2. Fixed some path issues in Android makefile generation tool 3. Minor fix to make media driver compile and run on Android Tracked-On: OAM-100026 Signed-off-by: Chen, Tianmi <[email protected]>
1 parent 3df71ee commit d083601

File tree

9 files changed

+297
-232
lines changed

9 files changed

+297
-232
lines changed

Tools/MediaDriverTools/Android/GenerateAndroidMk.py

+24
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,31 @@ def getMakefile(self):
233233
def getFlagsfile(self):
234234
return "media_driver/CMakeFiles/iHD_drv_video.dir/flags.make"
235235

236+
def getIncludes(self):
237+
text = self.getDefines("CXX_INCLUDES")
238+
preself = path.abspath(path.join(self.src, "../"))
239+
print("self="+self.src)
240+
print("preself="+preself)
241+
includes = []
242+
lines = text.split("\n")
243+
for l in lines:
244+
#normpath will make sure we did not refer outside.
245+
p = path.normpath(l)
246+
print("Inc=" + p);
247+
j = p.find(self.src)
248+
i = p.find(preself)
249+
if j != -1:
250+
includes.append(p[j:].replace(self.src, "$(LOCAL_PATH)"))
251+
else:
252+
if i != -1:
253+
includes.append(p[i:].replace(preself, "$(LOCAL_PATH)/.."))
254+
return INDENT + ("\n" + INDENT).join(includes) if includes else ""
255+
236256
def adjustSources(self, lines):
257+
for i, l in enumerate(lines):
258+
j = l.find("__/")
259+
if j != -1:
260+
lines[i] = path.join("..", l[j+3:])
237261
lines[:] = [l for l in lines if "media_libva_putsurface_linux.cpp" not in l]
238262

239263
class Main:

Tools/MediaDriverTools/Android/mk/cmrt.tpl

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ LOCAL_C_INCLUDES += \
3333
@LOCAL_C_INCLUDES
3434

3535
LOCAL_CFLAGS += \
36+
-Wno-error \
37+
-Wno-unused-variable \
38+
-Wno-unused-parameter \
39+
-Wno-unused-private-field \
3640
-Wno-non-virtual-dtor \
3741
-DANDROID=1 \
3842
@LOCAL_CFLAGS

Tools/MediaDriverTools/Android/mk/gmm.tpl

+5-2
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,13 @@ LOCAL_PROPRIETARY_MODULE := true
2626
LOCAL_SRC_FILES = \
2727
@LOCAL_SRC_FILES
2828

29-
LOCAL_CFLAGS = \
29+
LOCAL_CFLAGS := \
30+
-Wno-error \
31+
-Wno-unused-parameter \
3032
@LOCAL_CFLAGS
3133

32-
LOCAL_CPPFLAGS = \
34+
LOCAL_CPPFLAGS := \
35+
-fexceptions \
3336
-std=c++11
3437

3538
LOCAL_C_INCLUDES = \

Tools/MediaDriverTools/Android/mk/media_driver.tpl

+6-2
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,16 @@ LOCAL_SHARED_LIBRARIES := \
3535
liblog \
3636

3737

38-
LOCAL_STATIC_LIBRARIES = \
38+
LOCAL_STATIC_LIBRARIES := \
3939
libgmm_umd \
4040

41-
LOCAL_CPPFLAGS = \
41+
LOCAL_CPPFLAGS := \
42+
-Wno-error \
43+
-Wno-unused-parameter \
44+
-Wno-c++11-narrowing \
4245
-DDRV_I915 \
4346
-DOTC_GRALLOC \
47+
-DANDROID \
4448
-DANDROID_VERSION=800 \
4549
-fexceptions \
4650
-frtti \

cmrtlib/Android.mk

+3-5
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,11 @@ LOCAL_C_INCLUDES += \
5151
$(LOCAL_PATH)/linux/hardware
5252

5353
LOCAL_CFLAGS += \
54-
-Wno-non-virtual-dtor \
5554
-Wno-error \
55+
-Wno-unused-variable \
5656
-Wno-unused-parameter \
57-
-Wno-deprecated-declarations \
58-
-Wno-implicit-fallthrough \
59-
-Wno-missing-field-initializers \
60-
-Wno-c++11-narrowing \
57+
-Wno-unused-private-field \
58+
-Wno-non-virtual-dtor \
6159
-DANDROID=1 \
6260
-DCM_RT_EXPORTS \
6361
-DISTDLIB_UMD \

media_driver/Android.mk

+251-222
Large diffs are not rendered by default.

media_driver/agnostic/common/codec/hal/codechal_encode_csc_ds.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1883,7 +1883,7 @@ MOS_STATUS CodechalEncodeCscDs::RawSurfaceMediaCopy(MOS_FORMAT srcFormat)
18831883
auto cscSurface = m_encoder->m_trackedBuf->GetCscSurface(CODEC_CURR_TRACKED_BUFFER);
18841884

18851885
// Copy through VEBOX from Linear/TileY to TileY
1886-
#ifdef LINUX
1886+
#if (LINUX || ANDROID)
18871887
CODECHAL_ENCODE_CHK_STATUS_RETURN(m_pMosMediaCopy->MediaCopy(
18881888
&m_rawSurfaceToEnc->OsResource,
18891889
&cscSurface->OsResource,

media_driver/linux/common/os/mos_utilities_specific.h

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
//user feature
3838
#if ANDROID_VERSION >= 800
3939
#define USER_FEATURE_FILE "/data/igfx_user_feature.txt"
40+
#define USER_FEATURE_FILE_NEXT "/data/igfx_user_feature_next.txt"
4041
#else
4142
#define USER_FEATURE_FILE "/etc/igfx_user_feature.txt"
4243
#define USER_FEATURE_FILE_NEXT "/etc/igfx_user_feature_next.txt"

media_softlet/agnostic/common/vp/hal/pipeline/vp_pipeline_adapter_base.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ MOS_STATUS VpPipelineAdapterBase::GetVpMhwInterface(
116116
return eStatus;
117117
}
118118

119+
#ifndef ANDROID
119120
VpPipelineAdapterBase *VpPipelineAdapterBase::VphalStateFactory(
120121
PMOS_INTERFACE pOsInterface,
121122
PMOS_CONTEXT pOsDriverContext,
@@ -124,6 +125,7 @@ VpPipelineAdapterBase *VpPipelineAdapterBase::VphalStateFactory(
124125
VP_FUNC_CALL();
125126
return VphalDevice::CreateFactoryNext(pOsInterface, pOsDriverContext, peStatus);
126127
}
128+
#endif
127129

128130
VpPipelineAdapterBase::~VpPipelineAdapterBase()
129131
{

0 commit comments

Comments
 (0)