Skip to content

Commit

Permalink
Add Linux Devult which utilize googletest framework
Browse files Browse the repository at this point in the history
Just build for now, not run

Change-Id: I230b6bd9ca8140ce71880bb09f10375a7a9ba6ab
  • Loading branch information
Intel authored and oliver-sang committed Dec 29, 2017
1 parent 9eb00c8 commit 4f614ce
Show file tree
Hide file tree
Showing 99 changed files with 51,910 additions and 0 deletions.
30 changes: 30 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,33 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Copyright 2008, Google Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 changes: 39 additions & 0 deletions media_driver/linux/ult/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright (c) 2017, Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
cmake_minimum_required(VERSION 3.1)
if(NOT "${LIBVA_INSTALL_PATH}" STREQUAL "")
include_directories(BEFORE ${LIBVA_INSTALL_PATH})
else()
include(FindPkgConfig)
pkg_check_modules(LIBVA REQUIRED libva>=1.0.0)
if(LIBVA_FOUND)
include_directories(BEFORE ${LIBVA_INCLUDE_DIRS})
endif()
endif()

ADD_SUBDIRECTORY(libdrm_mock)
ADD_SUBDIRECTORY(ult_app)

enable_testing()
ADD_TEST(NAME test_devult COMMAND drvult ${UMD_PATH})
SET_TESTS_PROPERTIES(test_devult
PROPERTIES PASS_REGULAR_EXPRESSION "PASS")
SET_TESTS_PROPERTIES(test_devult
PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")
83 changes: 83 additions & 0 deletions media_driver/linux/ult/inc/devconfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
* Copyright (c) 2017, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#include <string.h>
#define LOCAL_I915_PARAM_HAS_HUC 42
struct DeviceConfig
{
uint64_t aperture_size; //DRM_IOCTL_I915_GEM_GET_APERTURE
//below is for DRM_IOCTL_I915_GETPARAM
uint32_t DeviceId; //I915_PARAM_CHIPSET_ID
uint32_t revision; //I915_PARAM_REVISION
union {
uint32_t flags; //Should put this before the struct, otherwise, it would be error in libdrm.
struct {
uint32_t has_exec2:1; //I915_PARAM_HAS_EXECBUF2
uint32_t has_bsd:1; //I915_PARAM_HAS_BSD
uint32_t has_blt:1; //I915_PARAM_HAS_BLT
uint32_t has_relaxed_fencing:1; //I915_PARAM_HAS_RELAXED_FENCING

uint32_t has_wait_timeout:1; //I915_PARAM_HAS_WAIT_TIMEOUT
uint32_t has_llc:1; //I915_PARAM_HAS_LLC
uint32_t has_vebox:1; //I915_PARAM_HAS_VEBOX
uint32_t has_ext_mmap:1; //I915_PARAM_MMAP_VERSION

uint32_t has_exec_softpin:1; //I915_PARAM_HAS_EXEC_SOFTPIN
uint32_t has_bsd2:1; //I915_PARAM_HAS_BSD
uint32_t has_huc:1; //I915_PARAM_HAS_HUC

uint32_t reserved:21;
};
};

//uint32_t mmap_version; //I915_PARAM_MMAP_VERSION
int32_t num_fences_avail; //I915_PARAM_NUM_FENCES_AVAIL
int32_t aliasing_ppgtt; //I915_PARAM_HAS_ALIASING_PPGTT
int32_t subslice_total; //I915_PARAM_SUBSLICE_TOTAL
int32_t eu_total; //I915_PARAM_EU_TOTAL

uint64_t edram_reg;
/*
void operator = (DeviceConfig &Dev2){
memcpy(this, &Dev2, sizeof(DeviceConfig));
};*/
} const DeviceConfigTable [] = {
#define DEVICECONFIG( aper, devId, rev, flags, fences,ppgtt,subslice, eu, edram_reg ) { aper, devId, rev, flags, fences,ppgtt,subslice, eu, edram_reg},
/*
* aperture_size, DeviceId, flags(), num_fences_avail, aliasing_ppgtt, subslice_total, eu_total, edram_reg,
*/
DEVICECONFIG( 4286468096, 0x191e, 0x7, 0x01ff, 32, 3, 3, 24, 0 ) //SKL
DEVICECONFIG( 4267114496, 0x5a84, 0xb, 0x03df, 32, 3, 3, 18, 0x0 ) //BXT
DEVICECONFIG( 4248690688, 0x1606, 0x9, 0x03ff, 32, 3, 2, 12, 0x0 ) //BDW
DEVICECONFIG( 4259069952, 0x5a49, 0x3, 0x3ff, 32, 3, 2, 16, 0x0 ) //CNL

#undef DEVICECONFIG
{ 0, 0, 0, 0, 0, 0, 0, 0, 0}
};
typedef struct DeviceConfig DeviceConfig_t;

typedef enum{
igfxSKLAKE = 0,
igfxBROXTON = 1,
igfxBROADWELL = 2,
igfxCANNONLAKE = 3,
igfx_MAX
}Platform_t;
33 changes: 33 additions & 0 deletions media_driver/linux/ult/libdrm_mock/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright (c) 2017, Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
cmake_minimum_required(VERSION 2.8)

project(libdrm_mock)

SET(CMAKE_C_FLAGS "-g -O0")
SET(CMAKE_CXX_FLAGS "-g -O0")

include_directories(./include ../inc)
aux_source_directory(. SOURCES)
add_compile_options(-std=c++11)
set(CMAKE_C_COMPILER "g++")
add_library(drm_mock SHARED ${SOURCES})

set_target_properties(drm_mock PROPERTIES VERSION 2.4.0 SOVERSION 2)
Loading

0 comments on commit 4f614ce

Please sign in to comment.