require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_VIA_DRM_H_)) {
    eval 'sub _VIA_DRM_H_ () {1;}' unless defined(&_VIA_DRM_H_);
    unless(defined(&_VIA_DEFINES_)) {
	eval 'sub _VIA_DEFINES_ () {1;}' unless defined(&_VIA_DEFINES_);
	if(!defined( &__KERNEL__)  && !defined( &_KERNEL)) {
	    require 'via_drmclient.ph';
	}
	eval 'sub VIA_DRM_DRIVER_DATE () {"20070202";}' unless defined(&VIA_DRM_DRIVER_DATE);
	eval 'sub VIA_DRM_DRIVER_MAJOR () {2;}' unless defined(&VIA_DRM_DRIVER_MAJOR);
	eval 'sub VIA_DRM_DRIVER_MINOR () {11;}' unless defined(&VIA_DRM_DRIVER_MINOR);
	eval 'sub VIA_DRM_DRIVER_PATCHLEVEL () {1;}' unless defined(&VIA_DRM_DRIVER_PATCHLEVEL);
	eval 'sub VIA_DRM_DRIVER_VERSION () {((( &VIA_DRM_DRIVER_MAJOR) << 16) | ( &VIA_DRM_DRIVER_MINOR));}' unless defined(&VIA_DRM_DRIVER_VERSION);
	eval 'sub VIA_NR_SAREA_CLIPRECTS () {8;}' unless defined(&VIA_NR_SAREA_CLIPRECTS);
	eval 'sub VIA_NR_XVMC_PORTS () {10;}' unless defined(&VIA_NR_XVMC_PORTS);
	eval 'sub VIA_NR_XVMC_LOCKS () {5;}' unless defined(&VIA_NR_XVMC_LOCKS);
	eval 'sub VIA_MAX_CACHELINE_SIZE () {64;}' unless defined(&VIA_MAX_CACHELINE_SIZE);
	eval 'sub XVMCLOCKPTR {
	    my($saPriv,$lockNo) = @_;
    	    eval q((( &volatile \'struct drm_hw_lock\' *)(((( ($saPriv)-> &XvMCLockArea) + ( &VIA_MAX_CACHELINE_SIZE - 1)) & ~( &VIA_MAX_CACHELINE_SIZE - 1)) +  &VIA_MAX_CACHELINE_SIZE*($lockNo))));
	}' unless defined(&XVMCLOCKPTR);
	eval 'sub VIA_NR_TEX_REGIONS () {64;}' unless defined(&VIA_NR_TEX_REGIONS);
    }
    eval 'sub DRM_VIA_FENCE_TYPE_ACCEL () {0x2;}' unless defined(&DRM_VIA_FENCE_TYPE_ACCEL);
    eval 'sub DRM_VIA_ALLOCMEM () {0x;}' unless defined(&DRM_VIA_ALLOCMEM);
    eval 'sub DRM_VIA_FREEMEM () {0x1;}' unless defined(&DRM_VIA_FREEMEM);
    eval 'sub DRM_VIA_AGP_INIT () {0x2;}' unless defined(&DRM_VIA_AGP_INIT);
    eval 'sub DRM_VIA_FB_INIT () {0x3;}' unless defined(&DRM_VIA_FB_INIT);
    eval 'sub DRM_VIA_MAP_INIT () {0x4;}' unless defined(&DRM_VIA_MAP_INIT);
    eval 'sub DRM_VIA_DEC_FUTEX () {0x5;}' unless defined(&DRM_VIA_DEC_FUTEX);
    eval 'sub NOT_USED () {1;}' unless defined(&NOT_USED);
    eval 'sub DRM_VIA_DMA_INIT () {0x7;}' unless defined(&DRM_VIA_DMA_INIT);
    eval 'sub DRM_VIA_CMDBUFFER () {0x8;}' unless defined(&DRM_VIA_CMDBUFFER);
    eval 'sub DRM_VIA_FLUSH () {0x9;}' unless defined(&DRM_VIA_FLUSH);
    eval 'sub DRM_VIA_PCICMD () {0xa;}' unless defined(&DRM_VIA_PCICMD);
    eval 'sub DRM_VIA_CMDBUF_SIZE () {0xb;}' unless defined(&DRM_VIA_CMDBUF_SIZE);
    eval 'sub NOT_USED () {1;}' unless defined(&NOT_USED);
    eval 'sub DRM_VIA_WAIT_IRQ () {0xd;}' unless defined(&DRM_VIA_WAIT_IRQ);
    eval 'sub DRM_VIA_DMA_BLIT () {0xe;}' unless defined(&DRM_VIA_DMA_BLIT);
    eval 'sub DRM_VIA_BLIT_SYNC () {0xf;}' unless defined(&DRM_VIA_BLIT_SYNC);
    eval 'sub DRM_IOCTL_VIA_ALLOCMEM () { &DRM_IOWR( &DRM_COMMAND_BASE +  &DRM_VIA_ALLOCMEM,  &drm_via_mem_t);}' unless defined(&DRM_IOCTL_VIA_ALLOCMEM);
    eval 'sub DRM_IOCTL_VIA_FREEMEM () { &DRM_IOW(  &DRM_COMMAND_BASE +  &DRM_VIA_FREEMEM,  &drm_via_mem_t);}' unless defined(&DRM_IOCTL_VIA_FREEMEM);
    eval 'sub DRM_IOCTL_VIA_AGP_INIT () { &DRM_IOWR( &DRM_COMMAND_BASE +  &DRM_VIA_AGP_INIT,  &drm_via_agp_t);}' unless defined(&DRM_IOCTL_VIA_AGP_INIT);
    eval 'sub DRM_IOCTL_VIA_FB_INIT () { &DRM_IOWR( &DRM_COMMAND_BASE +  &DRM_VIA_FB_INIT,  &drm_via_fb_t);}' unless defined(&DRM_IOCTL_VIA_FB_INIT);
    eval 'sub DRM_IOCTL_VIA_MAP_INIT () { &DRM_IOWR( &DRM_COMMAND_BASE +  &DRM_VIA_MAP_INIT,  &drm_via_init_t);}' unless defined(&DRM_IOCTL_VIA_MAP_INIT);
    eval 'sub DRM_IOCTL_VIA_DEC_FUTEX () { &DRM_IOW(  &DRM_COMMAND_BASE +  &DRM_VIA_DEC_FUTEX,  &drm_via_futex_t);}' unless defined(&DRM_IOCTL_VIA_DEC_FUTEX);
    eval 'sub DRM_IOCTL_VIA_DMA_INIT () { &DRM_IOWR( &DRM_COMMAND_BASE +  &DRM_VIA_DMA_INIT,  &drm_via_dma_init_t);}' unless defined(&DRM_IOCTL_VIA_DMA_INIT);
    eval 'sub DRM_IOCTL_VIA_CMDBUFFER () { &DRM_IOW(  &DRM_COMMAND_BASE +  &DRM_VIA_CMDBUFFER,  &drm_via_cmdbuffer_t);}' unless defined(&DRM_IOCTL_VIA_CMDBUFFER);
    eval 'sub DRM_IOCTL_VIA_FLUSH () { &DRM_IO(  &DRM_COMMAND_BASE +  &DRM_VIA_FLUSH);}' unless defined(&DRM_IOCTL_VIA_FLUSH);
    eval 'sub DRM_IOCTL_VIA_PCICMD () { &DRM_IOW(  &DRM_COMMAND_BASE +  &DRM_VIA_PCICMD,  &drm_via_cmdbuffer_t);}' unless defined(&DRM_IOCTL_VIA_PCICMD);
    eval 'sub DRM_IOCTL_VIA_CMDBUF_SIZE () { &DRM_IOWR(  &DRM_COMMAND_BASE +  &DRM_VIA_CMDBUF_SIZE,  &drm_via_cmdbuf_size_t);}' unless defined(&DRM_IOCTL_VIA_CMDBUF_SIZE);
    eval 'sub DRM_IOCTL_VIA_WAIT_IRQ () { &DRM_IOWR(  &DRM_COMMAND_BASE +  &DRM_VIA_WAIT_IRQ,  &drm_via_irqwait_t);}' unless defined(&DRM_IOCTL_VIA_WAIT_IRQ);
    eval 'sub DRM_IOCTL_VIA_DMA_BLIT () { &DRM_IOW( &DRM_COMMAND_BASE +  &DRM_VIA_DMA_BLIT,  &drm_via_dmablit_t);}' unless defined(&DRM_IOCTL_VIA_DMA_BLIT);
    eval 'sub DRM_IOCTL_VIA_BLIT_SYNC () { &DRM_IOW( &DRM_COMMAND_BASE +  &DRM_VIA_BLIT_SYNC,  &drm_via_blitsync_t);}' unless defined(&DRM_IOCTL_VIA_BLIT_SYNC);
    eval 'sub VIA_TEX_SETUP_SIZE () {8;}' unless defined(&VIA_TEX_SETUP_SIZE);
    eval 'sub VIA_FRONT () {0x1;}' unless defined(&VIA_FRONT);
    eval 'sub VIA_BACK () {0x2;}' unless defined(&VIA_BACK);
    eval 'sub VIA_DEPTH () {0x4;}' unless defined(&VIA_DEPTH);
    eval 'sub VIA_STENCIL () {0x8;}' unless defined(&VIA_STENCIL);
    eval 'sub VIA_MEM_VIDEO () {0;}' unless defined(&VIA_MEM_VIDEO);
    eval 'sub VIA_MEM_AGP () {1;}' unless defined(&VIA_MEM_AGP);
    eval 'sub VIA_MEM_SYSTEM () {2;}' unless defined(&VIA_MEM_SYSTEM);
    eval 'sub VIA_MEM_MIXED () {3;}' unless defined(&VIA_MEM_MIXED);
    eval 'sub VIA_MEM_UNKNOWN () {4;}' unless defined(&VIA_MEM_UNKNOWN);
    eval("sub VIA_INIT_MAP () { 0x01; }") unless defined(&VIA_INIT_MAP);
    eval("sub VIA_CLEANUP_MAP () { 0x02; }") unless defined(&VIA_CLEANUP_MAP);
    eval("sub VIA_FUTEX_WAIT () { 0x00; }") unless defined(&VIA_FUTEX_WAIT);
    eval("sub VIA_FUTEX_WAKE () { 0X01; }") unless defined(&VIA_FUTEX_WAKE);
    eval("sub VIA_INIT_DMA () { 0x01; }") unless defined(&VIA_INIT_DMA);
    eval("sub VIA_CLEANUP_DMA () { 0x02; }") unless defined(&VIA_CLEANUP_DMA);
    eval("sub VIA_DMA_INITIALIZED () { 0x03; }") unless defined(&VIA_DMA_INITIALIZED);
    eval("sub VIA_CMDBUF_SPACE () { 0x01; }") unless defined(&VIA_CMDBUF_SPACE);
    eval("sub VIA_CMDBUF_LAG () { 0x02; }") unless defined(&VIA_CMDBUF_LAG);
    eval("sub VIA_IRQ_ABSOLUTE () { 0x0; }") unless defined(&VIA_IRQ_ABSOLUTE);
    eval("sub VIA_IRQ_RELATIVE () { 0x1; }") unless defined(&VIA_IRQ_RELATIVE);
    eval("sub VIA_IRQ_SIGNAL () { 0x10000000; }") unless defined(&VIA_IRQ_SIGNAL);
    eval("sub VIA_IRQ_FORCE_SEQUENCE () { 0x20000000; }") unless defined(&VIA_IRQ_FORCE_SEQUENCE);
    eval 'sub VIA_IRQ_FLAGS_MASK () {0xf0000000;}' unless defined(&VIA_IRQ_FLAGS_MASK);
    eval("sub drm_via_irq_hqv0 () { 0; }") unless defined(&drm_via_irq_hqv0);
    eval("sub drm_via_irq_hqv1 () { 1; }") unless defined(&drm_via_irq_hqv1);
    eval("sub drm_via_irq_dma0_dd () { 2; }") unless defined(&drm_via_irq_dma0_dd);
    eval("sub drm_via_irq_dma0_td () { 3; }") unless defined(&drm_via_irq_dma0_td);
    eval("sub drm_via_irq_dma1_dd () { 4; }") unless defined(&drm_via_irq_dma1_dd);
    eval("sub drm_via_irq_dma1_td () { 5; }") unless defined(&drm_via_irq_dma1_td);
    eval("sub drm_via_irq_num () { 6; }") unless defined(&drm_via_irq_num);
}
1;
