Skip to content

Commit 11e4301

Browse files
zhangyichixJeevakaPrabu
authored andcommitted
Fixed compilation issues
* Fixed some compilation issues * Update GenerateAndroidMk.py fix compile issue and update tpl for cmrt and media_driver. * Add 'media_add_curr_to_include_path()' to media_srcs.cmake Tracked-On: OAM-117146 Signed-off-by: zhangyichix <[email protected]> Signed-off-by: zhepeng.xu <[email protected]>
1 parent 1290bba commit 11e4301

File tree

337 files changed

+2811
-284
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

337 files changed

+2811
-284
lines changed

Tools/MediaDriverTools/Android/GenerateAndroidMk.py

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -43,42 +43,44 @@ def remove(f):
4343
cmd = "rm " + f + "> /dev/null 2>&1"
4444
os.system(cmd)
4545

46+
4647
def getDriverName(root):
4748
driver = "mod"
4849
if not path.exists(path.join(root, driver)):
4950
driver = "media-driver"
5051
if not path.exists(path.join(root, driver)):
51-
raise Exception("driver path " + driver +" not existed")
52+
raise Exception("driver path " + driver + " not existed")
5253
return driver
5354

55+
5456
class Generator:
5557
def __init__(self, src, root, makefile=None):
56-
#where to put the Android makefile
58+
# where to put the Android makefile
5759
self.makefile = makefile if makefile else src
5860

59-
#where is the major source file
61+
# where is the major source file
6062
self.src = src
6163

62-
#driver name
64+
# driver name
6365
driver = getDriverName(root)
64-
#where to put build file and template
66+
# where to put build file and template
6567
self.tool = path.join(root, driver, TOOL_DIR)
6668

6769
"""where to put the template"""
6870
self.templ = path.join(root, driver, TEMPLATE_DIR)
6971

70-
#major function
72+
# major function
7173
def generate(self):
7274

73-
if path.exists(self.src) == False:
75+
if not path.exists(self.src):
7476
raise Exception(self.src + "not existed")
75-
self.generateMakefile()
77+
self.generateMakefile(debug=True)
7678

7779
mk = path.join(self.makefile, "Android.mk")
78-
#remove old Android.mk
80+
# remove old Android.mk
7981
remove(mk)
8082

81-
#create new Android.mk
83+
# create new Android.mk
8284
with open(self.getTemplatePath()) as f:
8385
tpl = f.read()
8486
tpl = tpl.replace("@LOCAL_SRC_FILES", self.getSources())
@@ -88,7 +90,7 @@ def generate(self):
8890
f.write(tpl)
8991
print("generated " + self.getName() + " to " + self.makefile)
9092

91-
#virtuall functions
93+
# virtuall functions
9294
def getTemplate(self):
9395
raise Exception("pure virtul function")
9496

@@ -108,19 +110,19 @@ def getBuildDir(self):
108110
return path.join(self.tool, 'build', self.getName())
109111

110112
def adjustSources(self, lines):
111-
#print(lines)
113+
# print(lines)
112114
return lines
113115

114116
def adjustIncludes(self, lines):
115-
#print(lines)
117+
# print(lines)
116118
return lines
117119

118120
def getCmakeCmd(self):
119121
return "cmake " + self.src
120122

121123
def generateMakefile(self, debug=False):
122-
#Win env can help us debug the script
123-
#but we do not want generate makefile on Win-system
124+
# Win env can help us debug the script
125+
# but we do not want generate makefile on Win-system
124126
if os.name == "nt":
125127
return
126128
verbose = ";" if debug else "> /dev/null 2>&1;"
@@ -136,11 +138,13 @@ def getIncludes(self):
136138
includes = []
137139
lines = text.split("\n")
138140
for l in lines:
139-
#normpath will make sure we did not refer outside.
141+
# normpath will make sure we did not refer outside.
142+
l = l.strip()[2:]
143+
if l == '/linux':
144+
continue
145+
140146
p = path.normpath(l)
141-
j = p.find(self.src)
142-
if j != -1:
143-
includes.append(p[j:].replace(self.src, "$(LOCAL_PATH)"))
147+
includes.append(path.join("$(LOCAL_PATH)", path.relpath(p, self.src)))
144148
return INDENT + ("\n" + INDENT).join(includes) if includes else ""
145149

146150
def getDefines(self, name):
@@ -161,7 +165,7 @@ def getSources(self):
161165
lines = re.findall(".*?\\.o:\\n", text)
162166
lines = [l.replace(".o:\n", " \\") for l in lines]
163167
self.adjustSources(lines)
164-
#make source pretty
168+
# make source pretty
165169
return INDENT + ("\n" + INDENT).join(lines)
166170

167171

@@ -175,6 +179,7 @@ def getTemplate(self):
175179

176180
def getMakefile(self):
177181
return "Source/GmmLib/Makefile"
182+
178183
def getFlagsfile(self):
179184
return "Source/GmmLib/CMakeFiles/igfx_gmmumd_dll.dir/flags.make"
180185

@@ -184,7 +189,7 @@ def adjustSources(self, lines):
184189
if j == -1:
185190
lines[i] = path.join("Source/GmmLib", l)
186191
else:
187-
lines[i] = path.join("Source", l[j+3:])
192+
lines[i] = path.join("Source", l[j + 3:])
188193

189194

190195
class CmrtGeneator(Generator):
@@ -207,7 +212,7 @@ def adjustSources(self, lines):
207212
if j == -1:
208213
lines[i] = path.join("linux", l)
209214
else:
210-
lines[i] = l[j+3:]
215+
lines[i] = l[j + 3:]
211216

212217

213218
class DriverGeneator(Generator):
@@ -217,11 +222,19 @@ def __init__(self, root):
217222

218223
def getCmakeCmd(self):
219224
wd = path.join(self.src, "..")
220-
cmd = 'cmake ' + wd +' -DCMAKE_INSTALL_PREFIX=/usr'
225+
cmd = 'cmake ' + wd + ' -DCMAKE_INSTALL_PREFIX=/usr'
221226
cmd += ' -DBUILD_ALONG_WITH_CMRTLIB=1 -DBS_DIR_GMMLIB=' + path.join(wd, '../gmmlib/Source/GmmLib/')
222227
cmd += ' -DBS_DIR_COMMON=' + path.join(wd, '../gmmlib/Source/Common/')
223228
cmd += ' -DBS_DIR_INC=' + path.join(wd, '../gmmlib/Source/inc/')
224229
cmd += ' -DBS_DIR_MEDIA=' + wd
230+
cmd += (' -DSKIP_GMM_CHECK=ON'
231+
' -DGEN12=ON'
232+
' -DXe_M=ON'
233+
' -DXEHP_SDV=ON'
234+
' -DENABLE_PRODUCTION_KMD=ON' # For /media_softlet/agnostic/Xe_R/Xe_HPC/renderhal
235+
# ' -DGEN10=ON' # For /media_interface/media_interfaces_m10_cnl
236+
' -DGEN12_RKL=ON' # For /media_interface/media_interfaces_m12_rkl
237+
)
225238
return cmd
226239

227240
def getTemplate(self):
@@ -234,14 +247,18 @@ def getFlagsfile(self):
234247
return "media_driver/CMakeFiles/iHD_drv_video.dir/flags.make"
235248

236249
def adjustSources(self, lines):
237-
lines[:] = [l for l in lines if "media_libva_putsurface_linux.cpp" not in l]
250+
lines[:] = [l.replace('__/', '../') for l in lines
251+
if "media_libva_putsurface_linux.cpp" not in l
252+
and '/private/' not in l
253+
]
254+
238255

239256
class Main:
240257

241258
def run(self):
242259
tool = path.dirname(__file__)
243260
root = path.abspath(path.join(tool, "../../../../"))
244-
print("root = "+root)
261+
print("root = " + root)
245262
gens = [GmmGeneator(root), CmrtGeneator(root), DriverGeneator(root)]
246263
for g in gens:
247264
g.generate()

Tools/MediaDriverTools/Android/mk/cmrt.tpl

Lines changed: 4 additions & 0 deletions
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/media_driver.tpl

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,37 +26,56 @@ include $(CLEAR_VARS)
2626
LOCAL_SRC_FILES := \
2727
@LOCAL_SRC_FILES
2828

29+
LOCAL_HEADER_LIBRARIES := libva_headers
30+
2931
LOCAL_SHARED_LIBRARIES := \
3032
libsync \
3133
libcutils \
3234
libutils \
3335
libdrm \
3436
libva \
3537
liblog \
36-
37-
38-
LOCAL_STATIC_LIBRARIES = \
3938
libgmm_umd \
4039

4140
LOCAL_CPPFLAGS = \
4241
-DDRV_I915 \
4342
-DOTC_GRALLOC \
44-
-DANDROID_VERSION=800 \
4543
-fexceptions \
4644
-frtti \
4745
-std=c++14 \
46+
-Wno-error \
47+
-Wno-ignored-qualifiers \
48+
-Wno-unused-parameter \
49+
-Wno-missing-braces \
50+
-Wno-overloaded-virtual \
51+
-Wno-unused-variable \
52+
-Wno-missing-field-initializers \
53+
-Wno-unused-function \
54+
-Wno-logical-op-parentheses \
55+
-Wno-implicit-fallthrough \
56+
-Wno-comment \
57+
-Wno-unused-private-field \
58+
-Wno-unused-value \
59+
-Wno-parentheses-equality \
60+
-Wno-unused-label \
61+
-Wno-parentheses \
62+
-Wno-c++11-narrowing \
63+
-Wno-unused-lambda-capture \
64+
-Wno-unreachable-code-loop-increment \
65+
-Wno-delete-incomplete \
66+
-DGMM_LIB_DLL \
4867
@LOCAL_CFLAGS
4968

5069
LOCAL_CONLYFLAGS = -x c++
5170
LOCAL_CFLAGS = $(LOCAL_CPPFLAGS)
5271

5372
LOCAL_C_INCLUDES = \
5473
@LOCAL_C_INCLUDES
55-
74+
$(LOCAL_PATH)/../cmrtlib/linux/hardware \
5675

5776
#LOCAL_CPP_FEATURES := rtti exceptions
5877

5978
LOCAL_MODULE := i965_drv_video
6079
LOCAL_PROPRIETARY_MODULE := true
6180

62-
include $(BUILD_SHARED_LIBRARY)
81+
include $(BUILD_SHARED_LIBRARY)

cmrtlib/Android.mk

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Copyright(c) 2018 Intel Corporation
2+
3+
# Permission is hereby granted, free of charge, to any person obtaining a
4+
# copy of this software and associated documentation files(the "Software"),
5+
# to deal in the Software without restriction, including without limitation
6+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
7+
# and / or sell copies of the Software, and to permit persons to whom the
8+
# Software is furnished to do so, subject to the following conditions:
9+
10+
# The above copyright notice and this permission notice shall be included
11+
# in all copies or substantial portions of the Software.
12+
13+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
14+
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16+
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
17+
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18+
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
19+
# OTHER DEALINGS IN THE SOFTWARE.
20+
21+
LOCAL_PATH:= $(call my-dir)
22+
23+
24+
$(info value of CMRT_BUILD_TYPE is: $(CMRT_BUILD_TYPE))
25+
$(info value of CMRT_ARCH is: $(CMRT_ARCH))
26+
27+
include $(CLEAR_VARS)
28+
29+
LOCAL_SRC_FILES := \
30+
agnostic/hardware/cm_device.cpp \
31+
agnostic/hardware/cm_device_export.cpp \
32+
agnostic/hardware/cm_kernel_debugger.cpp \
33+
agnostic/hardware/cm_perf_statistics.cpp \
34+
agnostic/hardware/cm_queue.cpp \
35+
agnostic/hardware/cm_surface_manager.cpp \
36+
agnostic/hardware/cm_timer.cpp \
37+
agnostic/share/cm_avs_state_msg_ex.cpp \
38+
agnostic/share/cm_printf_host.cpp \
39+
agnostic/share/cm_rt_helpers.cpp \
40+
linux/hardware/cm_device_export_os.cpp \
41+
linux/hardware/cm_device_os.cpp \
42+
linux/hardware/cm_surface_manager_os.cpp \
43+
linux/hardware/cm_timer_os.cpp \
44+
linux/share/cm_performance.cpp \
45+
46+
LOCAL_C_INCLUDES += \
47+
$(LOCAL_PATH)/proprietary/share \
48+
$(LOCAL_PATH)/agnostic/share \
49+
$(LOCAL_PATH)/agnostic/hardware \
50+
$(LOCAL_PATH)/linux/share \
51+
$(LOCAL_PATH)/linux/hardware
52+
53+
LOCAL_CFLAGS += \
54+
-Wno-error \
55+
-Wno-unused-variable \
56+
-Wno-unused-parameter \
57+
-Wno-unused-private-field \
58+
-Wno-non-virtual-dtor \
59+
-DANDROID=1 \
60+
-DCM_RT_EXPORTS \
61+
-DISTDLIB_UMD \
62+
-DVPHAL \
63+
-D__CT__ \
64+
-Digfxcmrt_EXPORTS
65+
66+
ifeq ($(CMRT_BUILD_TYPE), debug)
67+
LOCAL_CFLAGS += \
68+
-D_DEBUG \
69+
-D__DEBUG \
70+
-O0
71+
else
72+
LOCAL_CFLAGS += \
73+
-fno-strict-aliasing \
74+
-D_FORTIFY_SOURCE=2
75+
endif
76+
77+
78+
LOCAL_MODULE := libigfxcmrt
79+
LOCAL_PROPRIETARY_MODULE := true
80+
81+
LOCAL_LDLIBS := -lc -lva -lva-android
82+
LOCAL_SHARED_LIBRARIES := libc libdl libcutils liblog libutils libm libva libva-android
83+
84+
include $(BUILD_SHARED_LIBRARY)

cmrtlib/linux/hardware/cm_device_os.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,8 +493,10 @@ CmDevice_RT::CmDevice_RT(
493493
m_gtpinBufferUP1(nullptr),
494494
m_gtpinBufferUP2(nullptr),
495495
m_createOption(createOption),
496-
m_driverStoreEnabled(0),
497-
m_driFileDescriptor(0)
496+
#if !defined(ANDROID)
497+
m_driFileDescriptor(0),
498+
#endif
499+
m_driverStoreEnabled(0)
498500
{
499501

500502
// New Surface Manager

media_common/agnostic/common/cp/media_srcs.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,5 @@ set(COMMON_CP_DIRECTORIES_
3838
set(CP_INTERFACE_DIRECTORIES_
3939
${CP_INTERFACE_DIRECTORIES_}
4040
${CMAKE_CURRENT_LIST_DIR}
41-
)
41+
)
42+
media_add_curr_to_include_path()

media_common/agnostic/common/heap_manager/media_srcs.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ source_group( "Common Files" FILES ${TMP_HEADERS_} )
3636
set(SOFTLET_COMMON_PRIVATE_INCLUDE_DIRS_
3737
${SOFTLET_COMMON_PRIVATE_INCLUDE_DIRS_}
3838
${CMAKE_CURRENT_LIST_DIR}
39-
)
39+
)
40+
media_add_curr_to_include_path()

media_common/agnostic/common/hw/media_srcs.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,5 @@ set(SOFTLET_MHW_SFC_PRIVATE_INCLUDE_DIRS_
118118
set(SOFTLET_MHW_VEBOX_PRIVATE_INCLUDE_DIRS_
119119
${SOFTLET_MHW_VEBOX_PRIVATE_INCLUDE_DIRS_}
120120
${CMAKE_CURRENT_LIST_DIR}
121-
)
121+
)
122+
media_add_curr_to_include_path()

media_common/agnostic/common/hw/vdbox/media_srcs.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,5 @@ set(TMP_SOFTLET_MHW_VDBOX_HUC_HEADERS_ "")
5353
set(SOFTLET_MHW_VDBOX_PRIVATE_INCLUDE_DIRS_
5454
${SOFTLET_MHW_VDBOX_PRIVATE_INCLUDE_DIRS_}
5555
${CMAKE_CURRENT_LIST_DIR}
56-
)
56+
)
57+
media_add_curr_to_include_path()

0 commit comments

Comments
 (0)