change PREINSTALL/POSTINSTALL/UNINSTALL irq code to real functions as per
the other driversmain
parent
9c5d16216d
commit
879e3d335c
|
@ -95,53 +95,6 @@
|
|||
#define __HAVE_DMA_IRQ 1
|
||||
#define __HAVE_DMA_IRQ_BH 1
|
||||
|
||||
#if 1
|
||||
#define DRIVER_PREINSTALL() do { \
|
||||
drm_gamma_private_t *dev_priv = \
|
||||
(drm_gamma_private_t *)dev->dev_private;\
|
||||
while(GAMMA_READ(GAMMA_INFIFOSPACE) < 2); \
|
||||
GAMMA_WRITE( GAMMA_GCOMMANDMODE, 0x00000004 ); \
|
||||
GAMMA_WRITE( GAMMA_GDMACONTROL, 0x00000000 ); \
|
||||
} while (0)
|
||||
#define DRIVER_POSTINSTALL() do { \
|
||||
drm_gamma_private_t *dev_priv = \
|
||||
(drm_gamma_private_t *)dev->dev_private;\
|
||||
while(GAMMA_READ(GAMMA_INFIFOSPACE) < 2); \
|
||||
while(GAMMA_READ(GAMMA_INFIFOSPACE) < 3); \
|
||||
GAMMA_WRITE( GAMMA_GINTENABLE, 0x00002001 ); \
|
||||
GAMMA_WRITE( GAMMA_COMMANDINTENABLE, 0x00000008 ); \
|
||||
GAMMA_WRITE( GAMMA_GDELAYTIMER, 0x00039090 ); \
|
||||
} while (0)
|
||||
#else
|
||||
#define DRIVER_POSTINSTALL() do { \
|
||||
drm_gamma_private_t *dev_priv = \
|
||||
(drm_gamma_private_t *)dev->dev_private;\
|
||||
while(GAMMA_READ(GAMMA_INFIFOSPACE) < 2); \
|
||||
while(GAMMA_READ(GAMMA_INFIFOSPACE) < 2); \
|
||||
GAMMA_WRITE( GAMMA_GINTENABLE, 0x00002000 ); \
|
||||
GAMMA_WRITE( GAMMA_COMMANDINTENABLE, 0x00000004 ); \
|
||||
} while (0)
|
||||
|
||||
#define DRIVER_PREINSTALL() do { \
|
||||
drm_gamma_private_t *dev_priv = \
|
||||
(drm_gamma_private_t *)dev->dev_private;\
|
||||
while(GAMMA_READ(GAMMA_INFIFOSPACE) < 2); \
|
||||
while(GAMMA_READ(GAMMA_INFIFOSPACE) < 2); \
|
||||
GAMMA_WRITE( GAMMA_GCOMMANDMODE, GAMMA_QUEUED_DMA_MODE );\
|
||||
GAMMA_WRITE( GAMMA_GDMACONTROL, 0x00000000 );\
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#define DRIVER_UNINSTALL() do { \
|
||||
drm_gamma_private_t *dev_priv = \
|
||||
(drm_gamma_private_t *)dev->dev_private;\
|
||||
while(GAMMA_READ(GAMMA_INFIFOSPACE) < 2); \
|
||||
while(GAMMA_READ(GAMMA_INFIFOSPACE) < 3); \
|
||||
GAMMA_WRITE( GAMMA_GDELAYTIMER, 0x00000000 ); \
|
||||
GAMMA_WRITE( GAMMA_COMMANDINTENABLE, 0x00000000 ); \
|
||||
GAMMA_WRITE( GAMMA_GINTENABLE, 0x00000000 ); \
|
||||
} while (0)
|
||||
|
||||
#define DRIVER_AGP_BUFFERS_MAP( dev ) \
|
||||
((drm_gamma_private_t *)((dev)->dev_private))->buffers
|
||||
|
||||
|
|
|
@ -811,3 +811,35 @@ int gamma_setsareactx(struct inode *inode, struct file *filp,
|
|||
up(&dev->struct_sem);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void DRM(driver_irq_preinstall)( drm_device_t *dev ) {
|
||||
drm_gamma_private_t *dev_priv =
|
||||
(drm_gamma_private_t *)dev->dev_private;
|
||||
|
||||
while(GAMMA_READ(GAMMA_INFIFOSPACE) < 2);
|
||||
|
||||
GAMMA_WRITE( GAMMA_GCOMMANDMODE, 0x00000004 );
|
||||
GAMMA_WRITE( GAMMA_GDMACONTROL, 0x00000000 );
|
||||
}
|
||||
|
||||
void DRM(driver_irq_postinstall)( drm_device_t *dev ) {
|
||||
drm_gamma_private_t *dev_priv =
|
||||
(drm_gamma_private_t *)dev->dev_private;
|
||||
|
||||
while(GAMMA_READ(GAMMA_INFIFOSPACE) < 3);
|
||||
|
||||
GAMMA_WRITE( GAMMA_GINTENABLE, 0x00002001 );
|
||||
GAMMA_WRITE( GAMMA_COMMANDINTENABLE, 0x00000008 );
|
||||
GAMMA_WRITE( GAMMA_GDELAYTIMER, 0x00039090 );
|
||||
}
|
||||
|
||||
void DRM(driver_irq_uninstall)( drm_device_t *dev ) {
|
||||
drm_gamma_private_t *dev_priv =
|
||||
(drm_gamma_private_t *)dev->dev_private;
|
||||
|
||||
while(GAMMA_READ(GAMMA_INFIFOSPACE) < 3);
|
||||
|
||||
GAMMA_WRITE( GAMMA_GDELAYTIMER, 0x00000000 );
|
||||
GAMMA_WRITE( GAMMA_COMMANDINTENABLE, 0x00000000 );
|
||||
GAMMA_WRITE( GAMMA_GINTENABLE, 0x00000000 );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue