Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for FreeBSD on 23.4.3 #1785

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Commits on Mar 24, 2024

  1. -D__linux__ is predefined on Linux and illegal on non-Linux

    In file included from media_driver/agnostic/common/cm/cm_hal.cpp:26:
    In file included from media_driver/agnostic/common/os/mos_os.h:30:
    In file included from media_driver/agnostic/common/os/mos_defs.h:38:
    In file included from /usr/include/c++/v1/stdio.h:101:
    /usr/include/c++/v1/__config:219:12: fatal error: 'features.h' file not found
     #  include <features.h>
                ^~~~~~~~~~~~
    jbeich authored and rosorio committed Mar 24, 2024
    Configuration menu
    Copy the full SHA
    d543472 View commit details
    Browse the repository at this point in the history
  2. Avoid __fastcall conflicting with system definition

    In file included from media_driver/agnostic/common/cm/cm_kernel_rt.cpp:35:
    In file included from media_driver/agnostic/common/cm/cm_mov_inst.h:31:
    In file included from media_driver/agnostic/common/cm/cm_mem.h:128:
    media_driver/linux/common/cm/hal/cm_mem_os.h:33:9: error: '__fastcall' macro redefined [-Werror,-Wmacro-redefined]
     #define __fastcall
             ^
    /usr/include/sys/cdefs.h:372:9: note: previous definition is here
     #define __fastcall      __attribute__((__fastcall__))
             ^
    jbeich authored and rosorio committed Mar 24, 2024
    Configuration menu
    Copy the full SHA
    7e26e59 View commit details
    Browse the repository at this point in the history
  3. Avoid ALIGN conflicting with system definition

    In file included from media_driver/linux/gen12/ddi/media_libva_caps_g12.cpp:38:
    media_driver/linux/common/os/i915/include/mos_bufmgr_priv.h:351:9: error: 'ALIGN' macro redefined [-Werror,-Wmacro-redefined]
     #define ALIGN(value, alignment)    ((value + alignment - 1) & ~(alignment - 1))
             ^
    /usr/include/machine/param.h:79:9: note: previous definition is here
     #define ALIGN(p)                _ALIGN(p)
             ^
    
    In file included from media_driver/linux/gen12/ddi/media_libva_caps_g12.cpp:30:
    In file included from media_driver/linux/common/ddi/media_libva.h:52:
    In file included from media_driver/agnostic/common/codec/hal/codechal_decoder.h:40:
    In file included from media_driver/agnostic/common/cm/cm_wrapper.h:31:
    In file included from media_driver/linux/common/cm/hal/cm_wrapper_os.h:31:
    In file included from media_driver/agnostic/common/cm/cm_def.h:31:
    In file included from media_driver/agnostic/common/cm/cm_common.h:31:
    In file included from media_driver/linux/common/cm/hal/cm_innerdef_os.h:42:
    In file included from /usr/include/pthread_np.h:36:
    In file included from /usr/include/sys/param.h:162:
    /usr/include/machine/param.h:79:2: error: bootlegging test
    jbeich authored and rosorio committed Mar 24, 2024
    Configuration menu
    Copy the full SHA
    6e1f5e6 View commit details
    Browse the repository at this point in the history
  4. Avoid -ldl if not required or not supported

    ld: error: unable to find library -ldl
    jbeich authored and rosorio committed Mar 24, 2024
    Configuration menu
    Copy the full SHA
    7485cf7 View commit details
    Browse the repository at this point in the history
  5. Clang forbids downcasting pthread_t if it's a pointer

    media_driver/media_driver_next/linux/common/os/mos_utilities_specific_next.cpp:1693:12: error: cast from pointer to smaller type 'uint32_t' (aka 'unsigned int') loses information
        return (uint32_t)pthread_self();
               ^~~~~~~~~~~~~~~~~~~~~~~~
    jbeich authored and rosorio committed Mar 24, 2024
    Configuration menu
    Copy the full SHA
    3297302 View commit details
    Browse the repository at this point in the history
  6. makedev() is defined in <sys/types.h> on BSDs and <sys/mkdev.h> on So…

    …laris
    
    In file included from cmrtlib/linux/hardware/cm_device_os.cpp:24:
    cmrtlib/linux/../linux/hardware/drm_device.h:42:10: fatal error: 'sys/sysmacros.h' file not found
     #include <sys/sysmacros.h>   //<sys/types.h>
              ^~~~~~~~~~~~~~~~~
    media_driver/linux/common/os/i915/xf86drm.c:50:10: fatal error: 'sys/sysmacros.h' file not found
     #include <sys/sysmacros.h>
              ^~~~~~~~~~~~~~~~~
    media_driver/linux/ult/libdrm_mock/xf86drm_mock.c:50:10: fatal error: 'sys/sysmacros.h' file not found
     #include <sys/sysmacros.h>
              ^~~~~~~~~~~~~~~~~
    jbeich authored and rosorio committed Mar 24, 2024
    Configuration menu
    Copy the full SHA
    0f30123 View commit details
    Browse the repository at this point in the history
  7. memalign is Linux-specific, so use C11 aligned_alloc instead

    In file included from cmrtlib/agnostic/hardware/cm_queue.cpp:22:
    In file included from cmrtlib/linux/../agnostic/hardware/cm_queue.h:26:
    cmrtlib/linux/../linux/share/cm_def_os.h:37:10: fatal error: 'malloc.h' file not found
     #include <malloc.h>
              ^~~~~~~~~~
    In file included from cmrtlib/agnostic/share/cm_avs_state_msg_ex.cpp:22:
    In file included from cmrtlib/linux/../agnostic/share/cm_def.h:26:
    cmrtlib/linux/../linux/share/cm_def_os.h:104:10: error: use of undeclared identifier 'memalign'
      return memalign(alignment, size);
             ^
    media_driver/agnostic/common/os/mos_utilities.c:36:10: fatal error: 'malloc.h' file not found
     #include <malloc.h>    // For memalign
              ^~~~~~~~~~
    media_driver/agnostic/common/os/mos_utilities.c:4047:11: error: use of undeclared identifier 'memalign'
        ptr = _aligned_malloc(size, alignment);
              ^
    media_driver/linux/common/os/mos_utilities_specific.h:91:43: note: expanded from macro '_aligned_malloc'
     #define _aligned_malloc(size, alignment)  memalign(alignment, size)
                                               ^
    jbeich authored and rosorio committed Mar 24, 2024
    Configuration menu
    Copy the full SHA
    695b56f View commit details
    Browse the repository at this point in the history
  8. Get thread ID on more platforms

    media_driver/agnostic/common/cm/cm_task_internal.cpp:896:39: error: use of undeclared identifier 'SYS_gettid'
        m_taskProfilingInfo.threadID    = CmGetCurThreadId(); // Get Thread ID
                                          ^
    media_driver/linux/common/cm/hal/cm_innerdef_os.h:98:37: note: expanded from macro 'CmGetCurThreadId'
     #define CmGetCurThreadId()  syscall(SYS_gettid)
                                         ^
    media_driver/agnostic/common/cm/cm_task_internal.cpp:997:39: error: use of undeclared identifier 'SYS_gettid'
        m_taskProfilingInfo.threadID    = CmGetCurThreadId(); // Get Thread ID
                                          ^
    media_driver/linux/common/cm/hal/cm_innerdef_os.h:98:37: note: expanded from macro 'CmGetCurThreadId'
     #define CmGetCurThreadId()  syscall(SYS_gettid)
                                         ^
    jbeich authored and rosorio committed Mar 24, 2024
    Configuration menu
    Copy the full SHA
    be6bd90 View commit details
    Browse the repository at this point in the history
  9. Get framebuffer resolution on more platforms

    media_driver/linux/common/codec/ddi/media_libva_decoder.cpp:48:10: fatal error: 'linux/fb.h' file not found
     #include <linux/fb.h>
              ^~~~~~~~~~~~
    media_driver/linux/common/codec/ddi/media_libva_decoder.cpp:55:43: error: variable has incomplete type 'struct fb_var_screeninfo'
        struct fb_var_screeninfo              vsinfo;
                                              ^
    media_driver/linux/common/codec/ddi/media_libva_decoder.cpp:62:22: error: use of undeclared identifier 'FBIOGET_VSCREENINFO'
            if(ioctl(fd, FBIOGET_VSCREENINFO, &vsinfo) < 0)
                         ^
    media_driver/linux/common/ddi/media_libva.cpp:39:10: fatal error: 'linux/fb.h' file not found
     #include <linux/fb.h>
              ^~~~~~~~~~~~
    jbeich authored and rosorio committed Mar 24, 2024
    Configuration menu
    Copy the full SHA
    daaa717 View commit details
    Browse the repository at this point in the history
  10. Enable skuwa debug messages on non-Linux

    jbeich authored and rosorio committed Mar 24, 2024
    Configuration menu
    Copy the full SHA
    59c5601 View commit details
    Browse the repository at this point in the history
  11. CI: add FreeBSD job

    jbeich authored and rosorio committed Mar 24, 2024
    Configuration menu
    Copy the full SHA
    2933bb5 View commit details
    Browse the repository at this point in the history
  12. CI: add FreeBSD gmmlib workaround

    jbeich authored and rosorio committed Mar 24, 2024
    Configuration menu
    Copy the full SHA
    4ec9b2b View commit details
    Browse the repository at this point in the history
  13. Revert "[Media Common] Reduce library dependency"

    This reverts commit 53405da.
    jbeich authored and rosorio committed Mar 24, 2024
    Configuration menu
    Copy the full SHA
    17d3844 View commit details
    Browse the repository at this point in the history
  14. [Media Common] Detect backtrace() on non-GNU after b66bb0c

    ld: error: undefined symbol: backtrace
    >>> referenced by mos_utilities_specific.cpp:2504 (media_softlet/linux/common/os/osservice/mos_utilities_specific.cpp:2504)
    >>>               media_driver/CMakeFiles/iHD_drv_video_COMMON.dir/__/media_softlet/linux/common/os/osservice/mos_utilities_specific.cpp.o:(MosUtilities::MosTraceEvent(unsigned short, unsigned char, void const*, unsigned int, void const*, unsigned int))
    c++: error: linker command failed with exit code 1 (use -v to see invocation)
    jbeich authored and rosorio committed Mar 24, 2024
    Configuration menu
    Copy the full SHA
    abb792c View commit details
    Browse the repository at this point in the history
  15. error: 'linux/fb.h' file not found

       29 | #include <linux/fb.h>
          |          ^~~~~~~~~~~~
    error: use of undeclared identifier 'FBIOGET_VSCREENINFO'
     1254 |         if (ioctl(fd, FBIOGET_VSCREENINFO, &vsinfo) < 0)
          |                       ^
    rosorio committed Mar 24, 2024
    Configuration menu
    Copy the full SHA
    7d261ab View commit details
    Browse the repository at this point in the history
  16. error: unknown type name 'drmDevicePtr'

      608 |     drmDevicePtr device;
          |     ^
    rosorio committed Mar 24, 2024
    Configuration menu
    Copy the full SHA
    67961a2 View commit details
    Browse the repository at this point in the history