#!/bin/bash
# 4000-s3-trio.sh
# match S3 Trio family

XORG_CONF="$1"

[ -n "$XORG_CONF" ] || exit 2
[ -f "$XORG_CONF" ] || exit 2

[ "$PCI_VENDOR_ID" = "5333" ] || exit 1

case "$PCI_DEVICE_ID" in
    8810|8811|8812|8813|8814)
        ;;
    *)
        exit 1
        ;;
esac

logger -t retrodebian-xorg-autoconfig "Configuring S3 Trio s3 for $PCI_DEVICE_NAME [$PCI_DEVICE_ID]"

sed -i \
    -e "s|{DeviceDriver}|s3|g" \
    "$XORG_CONF" || exit 2

exit 0