intel / media-driver

Intel Graphics Media Driver to support hardware decode, encode and video processing.
https://github.com/intel/media-driver/wiki
Other
1.01k stars 346 forks source link

[Bug]: build fails when deactivating GEN9_SKL or GEN9_KBL #1841

Open hauke-work opened 3 months ago

hauke-work commented 3 months ago

Which component impacted?

Build

Is it regression? Good in old configuration?

No, this issue exist a long time

What happened?

I want to build mediadriver on Linux just for GEN9_BXT with the following options:

    -DINSTALL_DRIVER_SYSCONF=OFF \
    -DMEDIA_BUILD_FATAL_WARNINGS=OFF \
    -DMEDIA_RUN_TEST_SUITE=OFF \
    -DMEDIA_BUILD_HARDENING=OFF \
    -DGEN8=OFF \
    -DGEN9_BXT=ON \
    -DGEN9_CFL=OFF \
    -DGEN9_GLK=OFF \
    -DGEN9_KBL=OFF \
    -DGEN9_SKL=OFF \
    -DGEN9_CML=OFF \
    -DGEN9_CMPV=OFF \
    -DGEN11=OFF \
    -DGEN12=OFF \
    -DMTL=OFF \
    -DARL=OFF

The build fails.

I was able to remove the dependency to GEN9_KBL with this patch:

diff --git a/media_driver/agnostic/gen9/codec/hal/codechal_encode_vp8_g9.cpp b/media_driver/agnostic/gen9/codec/hal/codechal_encode_vp8_g9.cpp
index 3a0a6a9f8..544ace9ce 100644
--- a/media_driver/agnostic/gen9/codec/hal/codechal_encode_vp8_g9.cpp
+++ b/media_driver/agnostic/gen9/codec/hal/codechal_encode_vp8_g9.cpp
@@ -29,7 +29,7 @@
 #ifndef _FULL_OPEN_SOURCE
 #include "igcodeckrn_g9.h"
 #endif
-#include "mhw_vdbox_mfx_hwcmd_g9_kbl.h"
+#include "mhw_vdbox_mfx_hwcmd_g9_bxt.h"

 #define     INTRA_PROBABILIY                 63
 #define     INTER_LAST_PROBABILIY            255
@@ -8043,7 +8043,7 @@ MOS_STATUS CodechalEncodeVp8G9::SendMpuSurfaces(
         kernelState));

     // Picture state
-    size = mhw_vdbox_mfx_g9_kbl::MFX_VP8_PIC_STATE_CMD::byteSize;
+    size = mhw_vdbox_mfx_g9_bxt::MFX_VP8_PIC_STATE_CMD::byteSize;
     MOS_ZeroMemory(&surfaceCodecParams, sizeof(CODECHAL_SURFACE_CODEC_PARAMS));
     surfaceCodecParams.dwSize = size;
     surfaceCodecParams.presBuffer = params->presPictureState;
diff --git a/media_driver/agnostic/gen9/codec/hal/codechal_hw_g9_X.h b/media_driver/agnostic/gen9/codec/hal/codechal_hw_g9_X.h
index ef1058908..d86c7dd94 100644
--- a/media_driver/agnostic/gen9/codec/hal/codechal_hw_g9_X.h
+++ b/media_driver/agnostic/gen9/codec/hal/codechal_hw_g9_X.h
@@ -29,8 +29,8 @@
 #include "codechal_hw.h"
 #include "mhw_mi_hwcmd_g9_X.h"
 #include "mhw_render_hwcmd_g9_X.h"
-#include "mhw_vdbox_mfx_hwcmd_g9_skl.h"
-#include "mhw_vdbox_vdenc_hwcmd_g9_skl.h"
+#include "mhw_vdbox_mfx_hwcmd_g9_bxt.h"
+#include "mhw_vdbox_vdenc_hwcmd_g9_bxt.h"

 //!  Codechal hw interface Gen9
 /*!
@@ -57,7 +57,7 @@ public:
         InitCacheabilityControlSettings(codecFunction);

         m_sizeOfCmdBatchBufferEnd = mhw_mi_g9_X::MI_BATCH_BUFFER_END_CMD::byteSize;
-        m_vdencBrcImgStateBufferSize = mhw_vdbox_vdenc_g9_skl::VDENC_IMG_STATE_CMD::byteSize + mhw_vdbox_mfx_g9_skl::MFX_AVC_IMG_STATE_CMD::byteSize +
+        m_vdencBrcImgStateBufferSize = mhw_vdbox_vdenc_g9_bxt::VDENC_IMG_STATE_CMD::byteSize + mhw_vdbox_mfx_g9_bxt::MFX_AVC_IMG_STATE_CMD::byteSize +
             mhw_mi_g9_X::MI_BATCH_BUFFER_END_CMD::byteSize;

         // Slice Shutdown Threshold

The dependency on GEN9_SKL is more complicated to fix. This is also not a real fix for the problem, I just move the dependencies to BXT. The generic code should not depend on specific options.

What's the usage scenario when you are seeing the problem?

Others

What impacted?

I can not remove all unnecessary dependencies and the binary is bigger than needed.

Debug Information

No response

Do you want to contribute a patch to fix the issue?

No.

Jexu commented 3 months ago

They are all category in gen9 platform and mixed together. I think it is hard to decouple them at this moment. It was top design issue at the beginning. Perhaps unified build option '-DGEN9' is more reasonable.