summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
Diffstat (limited to 'linux')
-rw-r--r--linux/gamma.h47
-rw-r--r--linux/gamma_dma.c32
2 files changed, 32 insertions, 47 deletions
diff --git a/linux/gamma.h b/linux/gamma.h
index 1d4ab25d..a5090c84 100644
--- a/linux/gamma.h
+++ b/linux/gamma.h
@@ -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
diff --git a/linux/gamma_dma.c b/linux/gamma_dma.c
index af64d371..baa6b287 100644
--- a/linux/gamma_dma.c
+++ b/linux/gamma_dma.c
@@ -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 );
+}