2022-07-02 01:39:43 +00:00
|
|
|
[ -z "${OPENGL}" ] && OPENGL="no"
|
|
|
|
[ -z "${OPENGLES}" ] && OPENGLES="no"
|
|
|
|
[ -z "${VULKAN}" ] && VULKAN="no"
|
|
|
|
|
|
|
|
if [ "${OPENGL}" = "no" ]; then
|
2022-02-05 14:23:32 +00:00
|
|
|
OPENGL_SUPPORT="no"
|
|
|
|
else
|
|
|
|
OPENGL_SUPPORT="yes"
|
|
|
|
fi
|
|
|
|
|
2022-07-02 01:39:43 +00:00
|
|
|
if [ "${OPENGLES}" = "no" ]; then
|
2022-02-05 14:23:32 +00:00
|
|
|
OPENGLES_SUPPORT="no"
|
|
|
|
else
|
|
|
|
OPENGLES_SUPPORT="yes"
|
|
|
|
fi
|
|
|
|
|
2022-07-02 01:39:43 +00:00
|
|
|
if [ "${VULKAN}" = "no" ]; then
|
|
|
|
VULKAN_SUPPORT="no"
|
|
|
|
else
|
|
|
|
VULKAN_SUPPORT="yes"
|
|
|
|
fi
|
|
|
|
|
2022-02-05 14:23:32 +00:00
|
|
|
get_graphicdrivers() {
|
|
|
|
|
|
|
|
# set defaults
|
2023-06-15 17:28:39 +00:00
|
|
|
GALLIUM_DRIVERS="swrast"
|
2022-02-05 14:23:32 +00:00
|
|
|
XORG_DRIVERS=""
|
2022-07-02 01:39:43 +00:00
|
|
|
VULKAN_DRIVERS_CONFIG=""
|
|
|
|
VULKAN_DRIVERS_MESA=""
|
2022-02-05 14:23:32 +00:00
|
|
|
LLVM_SUPPORT="no"
|
|
|
|
COMPOSITE_SUPPORT="no"
|
|
|
|
VDPAU_SUPPORT="no"
|
|
|
|
VAAPI_SUPPORT="no"
|
|
|
|
V4L2_SUPPORT="no"
|
|
|
|
|
|
|
|
if [ "${GRAPHIC_DRIVERS}" = "all" ]; then
|
2022-07-02 01:39:43 +00:00
|
|
|
GRAPHIC_DRIVERS="crocus i915 iris r300 r600 radeonsi nvidia nvidia-legacy nvidia-ng vmware virtio vc4"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if listcontains "${GRAPHIC_DRIVERS}" "crocus"; then
|
|
|
|
GALLIUM_DRIVERS+=" crocus"
|
|
|
|
XORG_DRIVERS+=" intel"
|
|
|
|
COMPOSITE_SUPPORT="yes"
|
|
|
|
VAAPI_SUPPORT="yes"
|
2022-02-05 14:23:32 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if listcontains "${GRAPHIC_DRIVERS}" "etnaviv"; then
|
2022-07-02 01:39:43 +00:00
|
|
|
GALLIUM_DRIVERS+=" etnaviv kmsro"
|
2022-02-05 14:23:32 +00:00
|
|
|
V4L2_SUPPORT="yes"
|
|
|
|
VAAPI_SUPPORT="no"
|
|
|
|
VDPAU_SUPPORT="no"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if listcontains "${GRAPHIC_DRIVERS}" "freedreno"; then
|
|
|
|
GALLIUM_DRIVERS+=" freedreno"
|
|
|
|
V4L2_SUPPORT="yes"
|
|
|
|
VAAPI_SUPPORT="no"
|
|
|
|
VDPAU_SUPPORT="no"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if listcontains "${GRAPHIC_DRIVERS}" "i915"; then
|
2022-07-02 01:39:43 +00:00
|
|
|
GALLIUM_DRIVERS+=" i915"
|
2022-02-05 14:23:32 +00:00
|
|
|
XORG_DRIVERS+=" intel"
|
|
|
|
COMPOSITE_SUPPORT="yes"
|
|
|
|
VAAPI_SUPPORT="yes"
|
|
|
|
fi
|
|
|
|
|
2022-07-02 01:39:43 +00:00
|
|
|
if listcontains "${GRAPHIC_DRIVERS}" "iris"; then
|
|
|
|
GALLIUM_DRIVERS+=" iris"
|
2022-02-05 14:23:32 +00:00
|
|
|
XORG_DRIVERS+=" intel"
|
2022-07-02 01:39:43 +00:00
|
|
|
VULKAN_DRIVERS_MESA+=" intel"
|
2022-02-05 14:23:32 +00:00
|
|
|
COMPOSITE_SUPPORT="yes"
|
|
|
|
VAAPI_SUPPORT="yes"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if listcontains "${GRAPHIC_DRIVERS}" "lima"; then
|
|
|
|
GALLIUM_DRIVERS+=" kmsro lima"
|
|
|
|
V4L2_SUPPORT="yes"
|
|
|
|
fi
|
|
|
|
|
2022-07-02 01:39:43 +00:00
|
|
|
if listcontains "${GRAPHIC_DRIVERS}" "mali"; then
|
|
|
|
V4L2_SUPPORT="yes"
|
|
|
|
fi
|
|
|
|
|
2022-02-05 14:23:32 +00:00
|
|
|
if listcontains "${GRAPHIC_DRIVERS}" "nvidia"; then
|
|
|
|
XORG_DRIVERS+=" nvidia"
|
2022-07-02 01:39:43 +00:00
|
|
|
VULKAN_DRIVERS_CONFIG+=" nvidia"
|
2022-02-05 14:23:32 +00:00
|
|
|
VDPAU_SUPPORT="yes"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if listcontains "${GRAPHIC_DRIVERS}" "nvidia-legacy"; then
|
|
|
|
XORG_DRIVERS+=" nvidia-legacy"
|
|
|
|
VDPAU_SUPPORT="yes"
|
|
|
|
fi
|
|
|
|
|
2022-07-02 01:39:43 +00:00
|
|
|
if listcontains "${GRAPHIC_DRIVERS}" "nvidia-ng"; then
|
|
|
|
VULKAN_DRIVERS_CONFIG+=" nvidia-ng"
|
|
|
|
VAAPI_SUPPORT="yes"
|
|
|
|
fi
|
|
|
|
|
2022-02-05 14:23:32 +00:00
|
|
|
if listcontains "${GRAPHIC_DRIVERS}" "panfrost"; then
|
|
|
|
GALLIUM_DRIVERS+=" kmsro panfrost"
|
2022-07-02 01:39:43 +00:00
|
|
|
VULKAN_DRIVERS_MESA+=" panfrost"
|
2022-02-05 14:23:32 +00:00
|
|
|
V4L2_SUPPORT="yes"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if listcontains "${GRAPHIC_DRIVERS}" "r300"; then
|
|
|
|
GALLIUM_DRIVERS+=" r300"
|
|
|
|
XORG_DRIVERS+=" ati"
|
|
|
|
LLVM_SUPPORT="yes"
|
|
|
|
COMPOSITE_SUPPORT="yes"
|
|
|
|
VDPAU_SUPPORT="yes"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if listcontains "${GRAPHIC_DRIVERS}" "r600"; then
|
|
|
|
GALLIUM_DRIVERS+=" r600"
|
|
|
|
XORG_DRIVERS+=" ati"
|
|
|
|
LLVM_SUPPORT="yes"
|
|
|
|
COMPOSITE_SUPPORT="yes"
|
|
|
|
VDPAU_SUPPORT="yes"
|
|
|
|
VAAPI_SUPPORT="yes"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if listcontains "${GRAPHIC_DRIVERS}" "radeonsi"; then
|
|
|
|
GALLIUM_DRIVERS+=" radeonsi"
|
|
|
|
XORG_DRIVERS+=" ati amdgpu"
|
2022-07-02 01:39:43 +00:00
|
|
|
VULKAN_DRIVERS_MESA+=" amd"
|
2022-02-05 14:23:32 +00:00
|
|
|
LLVM_SUPPORT="yes"
|
|
|
|
COMPOSITE_SUPPORT="yes"
|
|
|
|
VDPAU_SUPPORT="yes"
|
|
|
|
VAAPI_SUPPORT="yes"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if listcontains "${GRAPHIC_DRIVERS}" "vc4"; then
|
|
|
|
GALLIUM_DRIVERS+=" vc4 v3d kmsro"
|
2022-07-02 01:39:43 +00:00
|
|
|
VULKAN_DRIVERS_MESA+=" broadcom"
|
2022-02-05 14:23:32 +00:00
|
|
|
V4L2_SUPPORT="yes"
|
|
|
|
VAAPI_SUPPORT="no"
|
|
|
|
VDPAU_SUPPORT="no"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if listcontains "${GRAPHIC_DRIVERS}" "virtio"; then
|
|
|
|
GALLIUM_DRIVERS+=" virgl"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if listcontains "${GRAPHIC_DRIVERS}" "vmware"; then
|
|
|
|
GALLIUM_DRIVERS+=" svga"
|
|
|
|
XORG_DRIVERS+=" vmware"
|
|
|
|
COMPOSITE_SUPPORT="yes"
|
|
|
|
fi
|
|
|
|
|
2022-07-02 01:39:43 +00:00
|
|
|
# VDPAU Support depends on X11
|
|
|
|
if [ ! "${DISPLAYSERVER}" = "x11" ]; then
|
|
|
|
VDPAU_SUPPORT="no"
|
|
|
|
fi
|
|
|
|
|
2023-06-15 17:28:39 +00:00
|
|
|
# add swrast to GALLIUM_DRIVERS regardless of GRAPHIC_DRIVERS value
|
|
|
|
GALLIUM_DRIVERS+=" swrast"
|
|
|
|
|
2022-02-05 14:23:32 +00:00
|
|
|
# remove duplicate entries
|
|
|
|
GALLIUM_DRIVERS="$(echo ${GALLIUM_DRIVERS} | xargs -n1 | sort -u | xargs)"
|
2022-07-02 01:39:43 +00:00
|
|
|
GRAPHIC_DRIVERS="$(echo ${GRAPHIC_DRIVERS} | xargs -n1 | sort -u | xargs)"
|
2022-02-05 14:23:32 +00:00
|
|
|
XORG_DRIVERS="$(echo ${XORG_DRIVERS} | xargs -n1 | sort -u | xargs)"
|
2022-07-02 01:39:43 +00:00
|
|
|
VULKAN_DRIVERS_MESA="$(echo ${VULKAN_DRIVERS_MESA} | xargs -n1 | sort -u | xargs)"
|
|
|
|
VULKAN_DRIVERS_CONFIG+=" ${VULKAN_DRIVERS_MESA}"
|
|
|
|
VULKAN_DRIVERS_CONFIG="$(echo ${VULKAN_DRIVERS_CONFIG} | xargs -n1 | sort -u | xargs)"
|
2022-02-05 14:23:32 +00:00
|
|
|
}
|