require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_VIA_DRV_H_)) {
    eval 'sub _VIA_DRV_H_ () {1;}' unless defined(&_VIA_DRV_H_);
    require 'drm_sman.ph';
    eval 'sub DRIVER_AUTHOR () {"Various";}' unless defined(&DRIVER_AUTHOR);
    eval 'sub DRIVER_NAME () {"via";}' unless defined(&DRIVER_NAME);
    eval 'sub DRIVER_DESC () {"VIA Unichrome / Pro";}' unless defined(&DRIVER_DESC);
    require 'via_verifier.ph';
    eval 'sub CMDBUF_ALIGNMENT_SIZE () {(0x100);}' unless defined(&CMDBUF_ALIGNMENT_SIZE);
    eval 'sub CMDBUF_ALIGNMENT_MASK () {(0xff);}' unless defined(&CMDBUF_ALIGNMENT_MASK);
    eval 'sub VIA_REG_STATUS () {0x400;}' unless defined(&VIA_REG_STATUS);
    eval 'sub VIA_REG_TRANSET () {0x43c;}' unless defined(&VIA_REG_TRANSET);
    eval 'sub VIA_REG_TRANSPACE () {0x440;}' unless defined(&VIA_REG_TRANSPACE);
    eval 'sub VIA_CMD_RGTR_BUSY () {0x80;}' unless defined(&VIA_CMD_RGTR_BUSY);
    eval 'sub VIA_2D_ENG_BUSY () {0x1;}' unless defined(&VIA_2D_ENG_BUSY);
    eval 'sub VIA_3D_ENG_BUSY () {0x2;}' unless defined(&VIA_3D_ENG_BUSY);
    eval 'sub VIA_VR_QUEUE_BUSY () {0x20000;}' unless defined(&VIA_VR_QUEUE_BUSY);
    if(defined( &__linux__)) {
	require 'via_dmablit.ph';
	eval 'sub VIA_HAVE_DMABLIT () {1;}' unless defined(&VIA_HAVE_DMABLIT);
	eval 'sub VIA_HAVE_CORE_MM () {1;}' unless defined(&VIA_HAVE_CORE_MM);
	eval 'sub VIA_HAVE_FENCE () {1;}' unless defined(&VIA_HAVE_FENCE);
	eval 'sub VIA_HAVE_BUFFER () {1;}' unless defined(&VIA_HAVE_BUFFER);
    }
    eval 'sub VIA_PCI_BUF_SIZE () {60000;}' unless defined(&VIA_PCI_BUF_SIZE);
    eval 'sub VIA_FIRE_BUF_SIZE () {1024;}' unless defined(&VIA_FIRE_BUF_SIZE);
    eval 'sub VIA_NUM_IRQS () {4;}' unless defined(&VIA_NUM_IRQS);
    if(defined(&VIA_HAVE_CORE_MM)) {
    }
    if(defined(&VIA_HAVE_DMABLIT)) {
    }
    if(defined(&VIA_HAVE_FENCE)) {
    }
    eval("sub VIA_OTHER () { 0; }") unless defined(&VIA_OTHER);
    eval("sub VIA_PRO_GROUP_A () { 1; }") unless defined(&VIA_PRO_GROUP_A);
    eval("sub VIA_DX9_0 () { 2; }") unless defined(&VIA_DX9_0);
    eval 'sub VIA_BASE () {(( ($dev_priv->{mmio})));}' unless defined(&VIA_BASE);
    eval 'sub VIA_READ {
        my($reg) = @_;
	    eval q( &DRM_READ32( &VIA_BASE, $reg));
    }' unless defined(&VIA_READ);
    eval 'sub VIA_WRITE {
        my($reg,$val) = @_;
	    eval q( &DRM_WRITE32( &VIA_BASE, $reg, $val));
    }' unless defined(&VIA_WRITE);
    eval 'sub VIA_READ8 {
        my($reg) = @_;
	    eval q( &DRM_READ8( &VIA_BASE, $reg));
    }' unless defined(&VIA_READ8);
    eval 'sub VIA_WRITE8 {
        my($reg,$val) = @_;
	    eval q( &DRM_WRITE8( &VIA_BASE, $reg, $val));
    }' unless defined(&VIA_WRITE8);
    if(defined(&VIA_HAVE_CORE_MM)) {
    } else {
    }
    if(defined(&VIA_HAVE_DMABLIT)) {
    }
    if(defined(&VIA_HAVE_BUFFER)) {
    }
}
1;
