Skip to content

Commit 4f614ce

Browse files
Inteloliver-sang
Intel
authored andcommitted
Add Linux Devult which utilize googletest framework
Just build for now, not run Change-Id: I230b6bd9ca8140ce71880bb09f10375a7a9ba6ab
1 parent 9eb00c8 commit 4f614ce

File tree

99 files changed

+51910
-0
lines changed

Some content is hidden

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

99 files changed

+51910
-0
lines changed

LICENSE.md

+30
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,33 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
9191
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
9292
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
9393
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
94+
95+
96+
Copyright 2008, Google Inc.
97+
All rights reserved.
98+
99+
Redistribution and use in source and binary forms, with or without
100+
modification, are permitted provided that the following conditions are
101+
met:
102+
103+
* Redistributions of source code must retain the above copyright
104+
notice, this list of conditions and the following disclaimer.
105+
* Redistributions in binary form must reproduce the above
106+
copyright notice, this list of conditions and the following disclaimer
107+
in the documentation and/or other materials provided with the
108+
distribution.
109+
* Neither the name of Google Inc. nor the names of its
110+
contributors may be used to endorse or promote products derived from
111+
this software without specific prior written permission.
112+
113+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
114+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
115+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
116+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
117+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
118+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
119+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
120+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
121+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
122+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
123+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

media_driver/linux/ult/CMakeLists.txt

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright (c) 2017, 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+
cmake_minimum_required(VERSION 3.1)
21+
if(NOT "${LIBVA_INSTALL_PATH}" STREQUAL "")
22+
include_directories(BEFORE ${LIBVA_INSTALL_PATH})
23+
else()
24+
include(FindPkgConfig)
25+
pkg_check_modules(LIBVA REQUIRED libva>=1.0.0)
26+
if(LIBVA_FOUND)
27+
include_directories(BEFORE ${LIBVA_INCLUDE_DIRS})
28+
endif()
29+
endif()
30+
31+
ADD_SUBDIRECTORY(libdrm_mock)
32+
ADD_SUBDIRECTORY(ult_app)
33+
34+
enable_testing()
35+
ADD_TEST(NAME test_devult COMMAND drvult ${UMD_PATH})
36+
SET_TESTS_PROPERTIES(test_devult
37+
PROPERTIES PASS_REGULAR_EXPRESSION "PASS")
38+
SET_TESTS_PROPERTIES(test_devult
39+
PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")
+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/*
2+
* Copyright (c) 2017, Intel Corporation
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a
5+
* copy of this software and associated documentation files (the "Software"),
6+
* to deal in the Software without restriction, including without limitation
7+
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+
* and/or sell copies of the Software, and to permit persons to whom the
9+
* Software is furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included
12+
* in all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
18+
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19+
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20+
* OTHER DEALINGS IN THE SOFTWARE.
21+
*/
22+
#include <string.h>
23+
#define LOCAL_I915_PARAM_HAS_HUC 42
24+
struct DeviceConfig
25+
{
26+
uint64_t aperture_size; //DRM_IOCTL_I915_GEM_GET_APERTURE
27+
//below is for DRM_IOCTL_I915_GETPARAM
28+
uint32_t DeviceId; //I915_PARAM_CHIPSET_ID
29+
uint32_t revision; //I915_PARAM_REVISION
30+
union {
31+
uint32_t flags; //Should put this before the struct, otherwise, it would be error in libdrm.
32+
struct {
33+
uint32_t has_exec2:1; //I915_PARAM_HAS_EXECBUF2
34+
uint32_t has_bsd:1; //I915_PARAM_HAS_BSD
35+
uint32_t has_blt:1; //I915_PARAM_HAS_BLT
36+
uint32_t has_relaxed_fencing:1; //I915_PARAM_HAS_RELAXED_FENCING
37+
38+
uint32_t has_wait_timeout:1; //I915_PARAM_HAS_WAIT_TIMEOUT
39+
uint32_t has_llc:1; //I915_PARAM_HAS_LLC
40+
uint32_t has_vebox:1; //I915_PARAM_HAS_VEBOX
41+
uint32_t has_ext_mmap:1; //I915_PARAM_MMAP_VERSION
42+
43+
uint32_t has_exec_softpin:1; //I915_PARAM_HAS_EXEC_SOFTPIN
44+
uint32_t has_bsd2:1; //I915_PARAM_HAS_BSD
45+
uint32_t has_huc:1; //I915_PARAM_HAS_HUC
46+
47+
uint32_t reserved:21;
48+
};
49+
};
50+
51+
//uint32_t mmap_version; //I915_PARAM_MMAP_VERSION
52+
int32_t num_fences_avail; //I915_PARAM_NUM_FENCES_AVAIL
53+
int32_t aliasing_ppgtt; //I915_PARAM_HAS_ALIASING_PPGTT
54+
int32_t subslice_total; //I915_PARAM_SUBSLICE_TOTAL
55+
int32_t eu_total; //I915_PARAM_EU_TOTAL
56+
57+
uint64_t edram_reg;
58+
/*
59+
void operator = (DeviceConfig &Dev2){
60+
memcpy(this, &Dev2, sizeof(DeviceConfig));
61+
};*/
62+
} const DeviceConfigTable [] = {
63+
#define DEVICECONFIG( aper, devId, rev, flags, fences,ppgtt,subslice, eu, edram_reg ) { aper, devId, rev, flags, fences,ppgtt,subslice, eu, edram_reg},
64+
/*
65+
* aperture_size, DeviceId, flags(), num_fences_avail, aliasing_ppgtt, subslice_total, eu_total, edram_reg,
66+
*/
67+
DEVICECONFIG( 4286468096, 0x191e, 0x7, 0x01ff, 32, 3, 3, 24, 0 ) //SKL
68+
DEVICECONFIG( 4267114496, 0x5a84, 0xb, 0x03df, 32, 3, 3, 18, 0x0 ) //BXT
69+
DEVICECONFIG( 4248690688, 0x1606, 0x9, 0x03ff, 32, 3, 2, 12, 0x0 ) //BDW
70+
DEVICECONFIG( 4259069952, 0x5a49, 0x3, 0x3ff, 32, 3, 2, 16, 0x0 ) //CNL
71+
72+
#undef DEVICECONFIG
73+
{ 0, 0, 0, 0, 0, 0, 0, 0, 0}
74+
};
75+
typedef struct DeviceConfig DeviceConfig_t;
76+
77+
typedef enum{
78+
igfxSKLAKE = 0,
79+
igfxBROXTON = 1,
80+
igfxBROADWELL = 2,
81+
igfxCANNONLAKE = 3,
82+
igfx_MAX
83+
}Platform_t;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright (c) 2017, 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+
cmake_minimum_required(VERSION 2.8)
21+
22+
project(libdrm_mock)
23+
24+
SET(CMAKE_C_FLAGS "-g -O0")
25+
SET(CMAKE_CXX_FLAGS "-g -O0")
26+
27+
include_directories(./include ../inc)
28+
aux_source_directory(. SOURCES)
29+
add_compile_options(-std=c++11)
30+
set(CMAKE_C_COMPILER "g++")
31+
add_library(drm_mock SHARED ${SOURCES})
32+
33+
set_target_properties(drm_mock PROPERTIES VERSION 2.4.0 SOVERSION 2)

0 commit comments

Comments
 (0)