# hook addon for enable direct rendering

#TCOS_XORG_DRI=
#TCOS_XORG_DRI_INTEL=
#TCOS_XORG_DRI_ATI=
#TCOS_XORG_DRI_SAVAGE=
#TCOS_XORG_DRI_SIS=
#TCOS_XORG_DRI_TRIDENT=
#TCOS_XORG_DRI_UNICHROME=
#TCOS_XORG_DRI_MATROX=

DRI_DIR=/usr/lib/dri/
[ -d $USRLIB_MULTIARCH/dri ] && DRI_DIR=$USRLIB_MULTIARCH/dri/

mkdir -p ${DESTDIR}/${DRI_DIR}

copy_dri() {
  [ -e "${DRI_DIR}/$1" ] && cpifexists ${DRI_DIR}/$1 ${DRI_DIR}
}


if [ $TCOS_XORG_DRI_INTEL ]; then
  stat_before
    copy_dri i810_dri.so
    copy_dri i915_dri.so
    copy_dri i965_dri.so
  stat_after "Intel DRI"
fi

if [ $TCOS_XORG_DRI_ATI ]; then
  stat_before
    copy_dri r128_dri.so
    copy_dri r200_dri.so
    copy_dri r300_dri.so
    copy_dri r600_dri.so
    copy_dri radeon_dri.so
  stat_after "ATI DRI"
fi

if [ $TCOS_XORG_DRI_SAVAGE ]; then
  stat_before
    copy_dri s3v_dri.so
    copy_dri savage_dri.so
  stat_after "Savage DRI"
fi

if [ $TCOS_XORG_DRI_SIS ]; then
  stat_before
    copy_dri sis_dri.so
  stat_after "SiS DRI"
fi

if [ $TCOS_XORG_DRI_TRIDENT ]; then
  stat_before
    copy_dri trident_dri.so
    copy_dri tdfx_dri.so
  stat_after "Trident DRI"
fi

if [ $TCOS_XORG_DRI_UNICHROME ]; then
  stat_before
    copy_dri unichrome_dri.so
  stat_after "Unichrome DRI"
fi

if [ $TCOS_XORG_DRI_MATROX ]; then
  stat_before
    copy_dri mach64_dri.so
    copy_dri mga_dri.so
  stat_after "Matrox DRI"
fi



if [ $TCOS_XORG_DRI ]; then
  _echo "  ** WARNING: TCOS_XORG_DRI is deprecated, generate new config."
fi

# Software Rendering DRI extension (always copy)
copy_dri swrast_dri.so

