Skip to content

Commit

Permalink
Upgrade to release tag: intel-media-22.6.6
Browse files Browse the repository at this point in the history
Release tag: https://github.com/intel/media-driver/releases/tag/intel-media-22.6.6
Update Android.mk for 22.6.6
Add ANDROID MACRO with LINUX according to Tianmi and Dong's patch
Dong:
3df71ee fix build error for enabling _DEBUG
Tianmi:
d083601 Minor fix to make media driver compile and run on Android

Signed-off-by: Shaofeng Tang <[email protected]>
  • Loading branch information
Shao-Feng committed Mar 23, 2023
1 parent 6bb7956 commit 7f0ae15
Show file tree
Hide file tree
Showing 18 changed files with 2,115 additions and 23 deletions.
83 changes: 83 additions & 0 deletions cmrtlib/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Copyright(c) 2018 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.

LOCAL_PATH:= $(call my-dir)


$(info value of CMRT_BUILD_TYPE is: $(CMRT_BUILD_TYPE))
$(info value of CMRT_ARCH is: $(CMRT_ARCH))

include $(CLEAR_VARS)

LOCAL_SRC_FILES := \
agnostic/hardware/cm_device.cpp \
agnostic/hardware/cm_device_export.cpp \
agnostic/hardware/cm_kernel_debugger.cpp \
agnostic/hardware/cm_perf_statistics.cpp \
agnostic/hardware/cm_queue.cpp \
agnostic/hardware/cm_surface_manager.cpp \
agnostic/hardware/cm_timer.cpp \
agnostic/share/cm_avs_state_msg_ex.cpp \
agnostic/share/cm_printf_host.cpp \
agnostic/share/cm_rt_helpers.cpp \
linux/hardware/cm_device_export_os.cpp \
linux/hardware/cm_device_os.cpp \
linux/hardware/cm_surface_manager_os.cpp \
linux/hardware/cm_timer_os.cpp \
linux/share/cm_performance.cpp \

LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/agnostic/share \
$(LOCAL_PATH)/agnostic/hardware \
$(LOCAL_PATH)/linux/share \
$(LOCAL_PATH)/linux/hardware

LOCAL_CFLAGS += \
-Wno-error \
-Wno-unused-variable \
-Wno-unused-parameter \
-Wno-unused-private-field \
-Wno-non-virtual-dtor \
-DANDROID=1 \
-DCM_RT_EXPORTS \
-DISTDLIB_UMD \
-DVPHAL \
-D__CT__ \
-Digfxcmrt_EXPORTS

ifeq ($(CMRT_BUILD_TYPE), debug)
LOCAL_CFLAGS += \
-D_DEBUG \
-D__DEBUG \
-O0
else
LOCAL_CFLAGS += \
-fno-strict-aliasing \
-D_FORTIFY_SOURCE=2
endif


LOCAL_MODULE := libigfxcmrt
LOCAL_PROPRIETARY_MODULE := true

LOCAL_LDLIBS := -lc -lva -lva-android
LOCAL_SHARED_LIBRARIES := libc libdl libcutils liblog libutils libm libva libva-android

include $(BUILD_SHARED_LIBRARY)
1 change: 1 addition & 0 deletions cmrtlib/linux/hardware/cm_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ class CmDevice_RT : public CmDevice
static pfVAGetDisplayDRM m_vaGetDisplayDrm;
#else
Display* m_display;
int32_t m_driFileDescriptor;
#endif

L3ConfigRegisterValues m_l3Config;
Expand Down
2,001 changes: 2,001 additions & 0 deletions media_driver/Android.mk

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ VPHAL_VEBOX_STATE_XE_HPM::VPHAL_VEBOX_STATE_XE_HPM(
}
dwNumofVebox = 0;

#if LINUX
#if (LINUX || ANDROID)
char* ScalingHQPerfMode = getenv("SET_SCALINGHQ_AS_PERFMODE");
if (ScalingHQPerfMode)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ VphalSfcStateXe_Xpm::VphalSfcStateXe_Xpm(
true);
VP_PUBLIC_NORMALMESSAGE("m_disableSfcDithering = %d", m_disableSfcDithering);

#if LINUX
#if (LINUX || ANDROID)
char *Sfc2PassPerfMode = getenv("SET_SFC2PASS_PERFMODE");
if (Sfc2PassPerfMode)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ VPHAL_VEBOX_STATE_XE_XPM::VPHAL_VEBOX_STATE_XE_XPM(
}
dwNumofVebox = 0;

#if LINUX
#if (LINUX || ANDROID)
char* ScalingHQPerfMode = getenv("SET_SCALINGHQ_AS_PERFMODE");
if (ScalingHQPerfMode)
{
Expand Down
2 changes: 1 addition & 1 deletion media_driver/linux/common/vp/ddi/media_libva_vp.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include "media_libva_vp_tools.h"
#if (_DEBUG || _RELEASE_INTERNAL)
#if ANDROID
#include "media_libva_vp_tools_android.h"
//#include "media_libva_vp_tools_android.h"
#endif
#endif // #if (_DEBUG || _RELEASE_INTERNAL)

Expand Down
4 changes: 4 additions & 0 deletions media_driver/linux/gen12/ddi/media_libva_caps_g12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
#include "mos_bufmgr_priv.h"
#include "drm_fourcc.h"

#ifdef ANDROID
#include <va/va_android.h>
#endif


#ifndef VA_CENC_TYPE_NONE
#define VA_CENC_TYPE_NONE 0x00000000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ MOS_STATUS VphalInterfacesG12Tgllp::Initialize(
{
MOS_OS_CHK_NULL_RETURN(eStatus);
MOS_OS_CHK_NULL_RETURN(osInterface);
#if LINUX
#if (LINUX || ANDROID)
bool bApogeiosEnable = true;
MOS_USER_FEATURE_VALUE_DATA UserFeatureData;
MOS_ZeroMemory(&UserFeatureData, sizeof(UserFeatureData));
Expand Down Expand Up @@ -1007,4 +1007,4 @@ MOS_STATUS MediaInterfacesHwInfoDeviceG12Tgllp::Initialize(PLATFORM platform)
{
m_hwInfo.SetDeviceInfo(IP_VERSION_M12_0, platform.usRevId);
return MOS_STATUS_SUCCESS;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
#include "decode_scalability_singlepipe.h"
#include "decode_scalability_multipipe.h"

#if LINUX
#if (LINUX || ANDROID)
#include "vp_pipeline_adapter_g12.h"
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ VpPlatformInterfaceXe_Hpm::VpPlatformInterfaceXe_Hpm(PMOS_INTERFACE pOsInterface
VP_PUBLIC_NORMALMESSAGE("m_disableSfcDithering = %d", m_disableSfcDithering);

m_sfc2PassScalingEnabled = true;
#if LINUX
#if (LINUX || ANDROID)
char *sfc2PassPerfMode = getenv("SET_SFC2PASS_PERFMODE");
if (sfc2PassPerfMode)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ VpPlatformInterfaceXe_Xpm::VpPlatformInterfaceXe_Xpm(PMOS_INTERFACE pOsInterface
VP_PUBLIC_NORMALMESSAGE("m_disableSfcDithering = %d", m_disableSfcDithering);

m_sfc2PassScalingEnabled = true;
#if LINUX
#if (LINUX || ANDROID)
char *sfc2PassPerfMode = getenv("SET_SFC2PASS_PERFMODE");
if (sfc2PassPerfMode)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ VpPlatformInterfacesXe_Lpm_Plus::VpPlatformInterfacesXe_Lpm_Plus(PMOS_INTERFACE
VP_PUBLIC_NORMALMESSAGE("m_disableSfcDithering = %d", m_disableSfcDithering);

m_sfc2PassScalingEnabled = true;
#if LINUX
#if (LINUX || ANDROID)
char *sfc2PassPerfMode = getenv("SET_SFC2PASS_PERFMODE");
if (sfc2PassPerfMode)
{
Expand Down
4 changes: 2 additions & 2 deletions media_softlet/agnostic/common/codec/hal/codechal_debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ CodechalDebugInterface::CodechalDebugInterface()
uint32_t sizeToBeCopied = 0;
MOS_GFXRES_TYPE ResType;

#if !defined(LINUX)
#if !defined(LINUX) && !defined(ANDROID)
ResType = surface->OsResource.ResType;

CODECHAL_DEBUG_CHK_STATUS(ReAllocateSurface(
Expand Down Expand Up @@ -512,7 +512,7 @@ MOS_STATUS CodechalDebugInterface::DumpRgbDataOnYUVSurface(
uint32_t sizeToBeCopied = 0;
MOS_GFXRES_TYPE ResType;

#if LINUX
#if (LINUX || ANDROID)
// Linux does not have OsResource->ResType
ResType = surface->Type;
#else
Expand Down
14 changes: 7 additions & 7 deletions media_softlet/agnostic/common/shared/media_debug_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ MediaDebugInterface::MediaDebugInterface()
uint32_t sizeToBeCopied = 0;
MOS_GFXRES_TYPE ResType;

#if LINUX
#if (LINUX || ANDROID)
// Linux does not have OsResource->ResType
ResType = surface->Type;
#else
Expand Down Expand Up @@ -875,7 +875,7 @@ MOS_STATUS MediaDebugInterface::DumpYUVSurfaceToBuffer(PMOS_SURFACE surface,
uint32_t sizeToBeCopied = 0;
MOS_GFXRES_TYPE ResType;

#if LINUX
#if (LINUX || ANDROID)
// Linux does not have OsResource->ResType
ResType = surface->Type;
#else
Expand Down Expand Up @@ -1510,7 +1510,7 @@ MOS_STATUS MediaDebugInterface::DumpSurfaceInfo(
FIELD_TO_OFS(bOverlay, );
FIELD_TO_OFS(bFlipChain, );

#if !defined(LINUX)
#if !defined(LINUX) && !defined(ANDROID)
EMPTY_TO_OFS();
UNION_STRUCT_START_TO_OFS();
UNION_STRUCT_FIELD_TO_OFS(dwFirstArraySlice);
Expand Down Expand Up @@ -1703,7 +1703,7 @@ MOS_STATUS MediaDebugInterface::DumpMosSpecificResourceInfoToOfs(
FIELD_TO_OFS_8SHIFT(Info.Shared);
FIELD_TO_OFS_8SHIFT(Info.SoftwareProtected);
FIELD_TO_OFS_8SHIFT(Info.SVM);
#if !defined(LINUX)
#if !defined(LINUX) && !defined(ANDROID)
FIELD_TO_OFS_8SHIFT(Info.Tile4);
FIELD_TO_OFS_8SHIFT(Info.Tile64);
#endif
Expand All @@ -1714,7 +1714,7 @@ MOS_STATUS MediaDebugInterface::DumpMosSpecificResourceInfoToOfs(
FIELD_TO_OFS_8SHIFT(Info.TiledYs);
FIELD_TO_OFS_8SHIFT(Info.XAdapter);
FIELD_TO_OFS_8SHIFT(Info.__PreallocatedResInfo);
#if !defined(LINUX)
#if !defined(LINUX) && !defined(ANDROID)
FIELD_TO_OFS_8SHIFT(Info.LMemBarPreferred);
FIELD_TO_OFS_8SHIFT(Info.LMemBarOrNonlocalOnly);
FIELD_TO_OFS_8SHIFT(Info.LMemBarIndifferent);
Expand All @@ -1734,7 +1734,7 @@ MOS_STATUS MediaDebugInterface::DumpMosSpecificResourceInfoToOfs(
FIELD_TO_OFS_8SHIFT(Wa.DisableDisplayCcsClearColor);
FIELD_TO_OFS_8SHIFT(Wa.DisableDisplayCcsCompression);
FIELD_TO_OFS_8SHIFT(Wa.PreGen12FastClearOnly);
#if !defined(LINUX)
#if !defined(LINUX) && !defined(ANDROID)
FIELD_TO_OFS_8SHIFT(Wa.ForceStdAllocAlign);
#endif
}
Expand Down Expand Up @@ -1772,7 +1772,7 @@ MOS_STATUS MediaDebugInterface::DumpMosSpecificResourceInfoToOfs(
FIELD_TO_OFS(GetSizeMainSurface(), );
FIELD_TO_OFS(GmmGetTileMode(), );

#if !defined(LINUX)
#if !defined(LINUX) && !defined(ANDROID)
EMPTY_TO_OFS();
FIELD_TO_OFS(GetMultiTileArch().Enable, );
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1831,7 +1831,8 @@ VAStatus MediaLibvaCapsMtlBase::QuerySurfaceAttributes(
VA_SURFACE_ATTRIB_MEM_TYPE_KERNEL_DRM |
VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME |
VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2 |
VA_SURFACE_ATTRIB_MEM_TYPE_ANDROID_GRALLOC;
0x00100000;
//VA_SURFACE_ATTRIB_MEM_TYPE_ANDROID_GRALLOC;
#else
attribs[i].value.value.i = VA_SURFACE_ATTRIB_MEM_TYPE_VA |
VA_SURFACE_ATTRIB_MEM_TYPE_USER_PTR |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#include <sys/types.h>
#include <sys/sem.h>
#include <sys/mman.h>
#include "mos_compat.h" // libc variative definitions: backtrace
#include "mos_user_setting.h"
#include "mos_utilities_specific.h"
#include "mos_utilities.h"
Expand Down Expand Up @@ -1498,7 +1497,8 @@ MOS_STATUS MosUtilities::MosInitializeReg(RegBufferMap &regBufferMap)
std::ifstream regStream;
try
{
regStream.open(USER_FEATURE_FILE_NEXT);
//regStream.open(USER_FEATURE_FILE_NEXT);
regStream.open("/etc/igfx_user_feature_next.txt");
if (regStream.good())
{
std::string id = "";
Expand Down Expand Up @@ -1575,7 +1575,8 @@ MOS_STATUS MosUtilities::MosUninitializeReg(RegBufferMap &regBufferMap)
std::ofstream regStream;
try
{
regStream.open(USER_FEATURE_FILE_NEXT, std::ios::out | std::ios::trunc);
//regStream.open(USER_FEATURE_FILE_NEXT, std::ios::out | std::ios::trunc);
regStream.open("/etc/igfx_user_feature_next.txt", std::ios::out | std::ios::trunc);
if (regStream.good())
{
for(auto pair: regBufferMap)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class MosMutex;
//user feature
#if ANDROID_VERSION >= 800
#define USER_FEATURE_FILE "/data/igfx_user_feature.txt"
#define USER_FEATURE_FILE_NEXT "/data/igfx_user_feature_next.txt"
#else
#define USER_FEATURE_FILE "/etc/igfx_user_feature.txt"
#define USER_FEATURE_FILE_NEXT "/etc/igfx_user_feature_next.txt"
Expand Down

0 comments on commit 7f0ae15

Please sign in to comment.