summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2003-03-17 23:28:16 +0000
committerIan Romanick <idr@us.ibm.com>2003-03-17 23:28:16 +0000
commitf28be77dd4001df6068546b3ecdb4d70ee908e91 (patch)
tree319dd9454317f2d0ebeb727852c83be1f658c5bb
parent5a599398101b5a8966ee46febe64cde970584f26 (diff)
Hack to generate vblank interrupts.texmem-0-0-1-20030328-freeze
-rw-r--r--shared-core/mga_irq.c15
-rw-r--r--shared/mga_irq.c15
2 files changed, 30 insertions, 0 deletions
diff --git a/shared-core/mga_irq.c b/shared-core/mga_irq.c
index 28e9a262d..b3e674bd5 100644
--- a/shared-core/mga_irq.c
+++ b/shared-core/mga_irq.c
@@ -36,6 +36,8 @@
#include "mga_drm.h"
#include "mga_drv.h"
+#define IDR_VBLANK_HACK 1
+
void mga_dma_service( DRM_IRQ_ARGS )
{
drm_device_t *dev = (drm_device_t *) arg;
@@ -46,12 +48,21 @@ void mga_dma_service( DRM_IRQ_ARGS )
status = MGA_READ( MGA_STATUS );
/* VBLANK interrupt */
+#if IDR_VBLANK_HACK
+ if ( status & 0x08 ) {
+ MGA_WRITE( MGA_ICLEAR, status );
+ atomic_inc(&dev->vbl_received);
+ DRM_WAKEUP(&dev->vbl_queue);
+ DRM(vbl_send_signals)( dev );
+ }
+#else
if ( status & MGA_VLINEPEN ) {
MGA_WRITE( MGA_ICLEAR, MGA_VLINEICLR );
atomic_inc(&dev->vbl_received);
DRM_WAKEUP(&dev->vbl_queue);
DRM(vbl_send_signals)( dev );
}
+#endif
}
int mga_vblank_wait(drm_device_t *dev, unsigned int *sequence)
@@ -87,7 +98,11 @@ void mga_driver_irq_postinstall( drm_device_t *dev ) {
(drm_mga_private_t *)dev->dev_private;
/* Turn on VBL interrupt */
+#if IDR_VBLANK_HACK
+ MGA_WRITE( MGA_IEN, 0x0000000c );
+#else
MGA_WRITE( MGA_IEN, MGA_VLINEIEN );
+#endif
}
void mga_driver_irq_uninstall( drm_device_t *dev ) {
diff --git a/shared/mga_irq.c b/shared/mga_irq.c
index 28e9a262d..b3e674bd5 100644
--- a/shared/mga_irq.c
+++ b/shared/mga_irq.c
@@ -36,6 +36,8 @@
#include "mga_drm.h"
#include "mga_drv.h"
+#define IDR_VBLANK_HACK 1
+
void mga_dma_service( DRM_IRQ_ARGS )
{
drm_device_t *dev = (drm_device_t *) arg;
@@ -46,12 +48,21 @@ void mga_dma_service( DRM_IRQ_ARGS )
status = MGA_READ( MGA_STATUS );
/* VBLANK interrupt */
+#if IDR_VBLANK_HACK
+ if ( status & 0x08 ) {
+ MGA_WRITE( MGA_ICLEAR, status );
+ atomic_inc(&dev->vbl_received);
+ DRM_WAKEUP(&dev->vbl_queue);
+ DRM(vbl_send_signals)( dev );
+ }
+#else
if ( status & MGA_VLINEPEN ) {
MGA_WRITE( MGA_ICLEAR, MGA_VLINEICLR );
atomic_inc(&dev->vbl_received);
DRM_WAKEUP(&dev->vbl_queue);
DRM(vbl_send_signals)( dev );
}
+#endif
}
int mga_vblank_wait(drm_device_t *dev, unsigned int *sequence)
@@ -87,7 +98,11 @@ void mga_driver_irq_postinstall( drm_device_t *dev ) {
(drm_mga_private_t *)dev->dev_private;
/* Turn on VBL interrupt */
+#if IDR_VBLANK_HACK
+ MGA_WRITE( MGA_IEN, 0x0000000c );
+#else
MGA_WRITE( MGA_IEN, MGA_VLINEIEN );
+#endif
}
void mga_driver_irq_uninstall( drm_device_t *dev ) {