summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@fairlite.demon.co.uk>2001-08-19 14:15:38 +0000
committerAlan Hourihane <alanh@fairlite.demon.co.uk>2001-08-19 14:15:38 +0000
commit4d3d182d8ae552a30778cdf0bdfc4ea1543d8a1d (patch)
tree90d03a8f0d31d1fdfa4fa636525e8409914726cf
parented1730707d7530600870c94af2d5010f26ec154f (diff)
tweaks for linux
-rw-r--r--linux-core/drm_fops.c2
-rw-r--r--linux-core/drm_lock.c3
-rw-r--r--linux/drm_fops.h2
-rw-r--r--linux/drm_lock.h3
-rw-r--r--linux/mga_dma.c5
5 files changed, 9 insertions, 6 deletions
diff --git a/linux-core/drm_fops.c b/linux-core/drm_fops.c
index 7812cae8..d94d8811 100644
--- a/linux-core/drm_fops.c
+++ b/linux-core/drm_fops.c
@@ -30,10 +30,10 @@
* Gareth Hughes <gareth@valinux.com>
*/
+#define __NO_VERSION__
#include "drmP.h"
#ifdef __linux__
-#define __NO_VERSION__
#include <linux/poll.h>
#endif
diff --git a/linux-core/drm_lock.c b/linux-core/drm_lock.c
index ac15fa2a..23a6285f 100644
--- a/linux-core/drm_lock.c
+++ b/linux-core/drm_lock.c
@@ -167,9 +167,9 @@ static int DRM(flush_queue)(drm_device_t *dev, int context)
atomic_inc(&q->use_count);
if (atomic_read(&q->use_count) > 1) {
atomic_inc(&q->block_write);
- atomic_inc(&q->block_count);
#ifdef __linux__
add_wait_queue(&q->flush_queue, &entry);
+ atomic_inc(&q->block_count);
for (;;) {
current->state = TASK_INTERRUPTIBLE;
if (!DRM_BUFCOUNT(&q->waitlist)) break;
@@ -181,6 +181,7 @@ static int DRM(flush_queue)(drm_device_t *dev, int context)
}
#endif
#ifdef __FreeBSD__
+ atomic_inc(&q->block_count);
error = tsleep(&q->flush_queue, PZERO|PCATCH, "drmfq", 0);
if (error)
return error;
diff --git a/linux/drm_fops.h b/linux/drm_fops.h
index 7812cae8..d94d8811 100644
--- a/linux/drm_fops.h
+++ b/linux/drm_fops.h
@@ -30,10 +30,10 @@
* Gareth Hughes <gareth@valinux.com>
*/
+#define __NO_VERSION__
#include "drmP.h"
#ifdef __linux__
-#define __NO_VERSION__
#include <linux/poll.h>
#endif
diff --git a/linux/drm_lock.h b/linux/drm_lock.h
index ac15fa2a..23a6285f 100644
--- a/linux/drm_lock.h
+++ b/linux/drm_lock.h
@@ -167,9 +167,9 @@ static int DRM(flush_queue)(drm_device_t *dev, int context)
atomic_inc(&q->use_count);
if (atomic_read(&q->use_count) > 1) {
atomic_inc(&q->block_write);
- atomic_inc(&q->block_count);
#ifdef __linux__
add_wait_queue(&q->flush_queue, &entry);
+ atomic_inc(&q->block_count);
for (;;) {
current->state = TASK_INTERRUPTIBLE;
if (!DRM_BUFCOUNT(&q->waitlist)) break;
@@ -181,6 +181,7 @@ static int DRM(flush_queue)(drm_device_t *dev, int context)
}
#endif
#ifdef __FreeBSD__
+ atomic_inc(&q->block_count);
error = tsleep(&q->flush_queue, PZERO|PCATCH, "drmfq", 0);
if (error)
return error;
diff --git a/linux/mga_dma.c b/linux/mga_dma.c
index 9d9df2e3..f4db5981 100644
--- a/linux/mga_dma.c
+++ b/linux/mga_dma.c
@@ -638,8 +638,9 @@ static int mga_do_init_dma( drm_device_t *dev, drm_mga_init_t *init )
dev_priv->prim.high_mark = 256 * DMA_BLOCK_SIZE;
- /* FIXME: This lock is unused */
- /* spin_lock_init( &dev_priv->prim.list_lock ); */
+#ifdef __linux__
+ spin_lock_init( &dev_priv->prim.list_lock );
+#endif
dev_priv->prim.status[0] = dev_priv->primary->offset;
dev_priv->prim.status[1] = 0;