From 4ce47fd328cd885d66abdd42db1f7c054bd44498 Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Sun, 1 Jun 2008 16:17:31 -0400 Subject: [FreeBSD] Get rid of vbl_lock and re-use irq_lock. --- bsd-core/drmP.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'bsd-core/drmP.h') diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index 4c35cdb2..21cf623a 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -788,11 +788,10 @@ struct drm_device { wait_queue_head_t *vbl_queue; /* vblank wait queue */ atomic_t *_vblank_count; /* number of VBLANK interrupts */ /* (driver must alloc the right number of counters) */ - struct mtx vbl_lock; struct drm_vbl_sig_list *vbl_sigs; /* signal list to send on VBLANK */ atomic_t vbl_signal_pending; /* number of signals pending on all crtcs*/ atomic_t *vblank_refcount; /* number of users of vblank interrupts per crtc */ - u32 *last_vblank; /* protected by dev->vbl_lock, used */ + u32 *last_vblank; /* protected by dev->irq_lock, used */ /* for wraparound handling */ u32 *vblank_offset; /* used to track how many vblanks */ @@ -802,8 +801,6 @@ struct drm_device { struct callout vblank_disable_timer; unsigned long max_vblank_count; /* size of vblank counter register */ int num_crtcs; - atomic_t vbl_received; - atomic_t vbl_received2; #ifdef __FreeBSD__ struct sigio *buf_sigio; /* Processes waiting for SIGIO */ -- cgit v1.2.3 From fc74c2e9d65dbd0c611e1610886df098c6e3273b Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Mon, 2 Jun 2008 13:12:59 -0400 Subject: [FreeBSD] Go back to using vbl_lock and move init/destroy to load/unload. --- bsd-core/drmP.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bsd-core/drmP.h') diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index 21cf623a..d3f53b86 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -733,6 +733,7 @@ struct drm_device { /* Locks */ #if defined(__FreeBSD__) && __FreeBSD_version > 500000 + struct mtx vbl_lock; /* protects vblank operations */ struct mtx dma_lock; /* protects dev->dma */ struct mtx irq_lock; /* protects irq condition checks */ struct mtx dev_lock; /* protects everything else */ @@ -791,7 +792,7 @@ struct drm_device { struct drm_vbl_sig_list *vbl_sigs; /* signal list to send on VBLANK */ atomic_t vbl_signal_pending; /* number of signals pending on all crtcs*/ atomic_t *vblank_refcount; /* number of users of vblank interrupts per crtc */ - u32 *last_vblank; /* protected by dev->irq_lock, used */ + u32 *last_vblank; /* protected by dev->vbl_lock, used */ /* for wraparound handling */ u32 *vblank_offset; /* used to track how many vblanks */ -- cgit v1.2.3 From 6d6921719c7d475856199ddbe88bbe11fc882ba6 Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Tue, 3 Jun 2008 16:21:13 -0400 Subject: [FreeBSD] Incorporate vblank fixes for bsd. --- bsd-core/drmP.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'bsd-core/drmP.h') diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index d3f53b86..88ea4e69 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -794,13 +794,12 @@ struct drm_device { atomic_t *vblank_refcount; /* number of users of vblank interrupts per crtc */ u32 *last_vblank; /* protected by dev->vbl_lock, used */ /* for wraparound handling */ - - u32 *vblank_offset; /* used to track how many vblanks */ int *vblank_enabled; /* so we don't call enable more than */ /* once per disable */ - u32 *vblank_premodeset; /* were lost during modeset */ + u32 *vblank_premodeset; /* for compensation of spurious wraparounds */ + int *vblank_suspend; /* Don't wait while crtc is likely disabled */ struct callout vblank_disable_timer; - unsigned long max_vblank_count; /* size of vblank counter register */ + u32 max_vblank_count; /* size of vblank counter register */ int num_crtcs; #ifdef __FreeBSD__ -- cgit v1.2.3 From 74cf1f91be7f4139601624af0343e3d411190dec Mon Sep 17 00:00:00 2001 From: Owain Gordon Ainsworth Date: Mon, 7 Jul 2008 17:23:48 +0100 Subject: BSD: change drm_locked_task*() to use the same scheme as linux. The current code can sleep in an interrupt handler, that is bad. So instead if we can't grab the lock, flag it and run the tasklet on unlock. Signed-off-by: Robert Noland --- bsd-core/drmP.h | 1 + 1 file changed, 1 insertion(+) (limited to 'bsd-core/drmP.h') diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index 88ea4e69..65d7fae4 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -739,6 +739,7 @@ struct drm_device { struct mtx dev_lock; /* protects everything else */ #endif DRM_SPINTYPE drw_lock; + DRM_SPINTYPE tsk_lock; /* Usage Counters */ int open_count; /* Outstanding files open */ -- cgit v1.2.3 From b0e4619a396f2db8c594cd0a26fd2f0ab9358095 Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Wed, 16 Jul 2008 23:39:25 -0400 Subject: FreeBSD: Fix radeon build --- bsd-core/drmP.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bsd-core/drmP.h') diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index 65d7fae4..b0a23e9c 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -1088,6 +1088,8 @@ drm_dma_handle_t *drm_pci_alloc(struct drm_device *dev, size_t size, size_t align, dma_addr_t maxaddr); void drm_pci_free(struct drm_device *dev, drm_dma_handle_t *dmah); +#define drm_core_ioremap_wc drm_core_ioremap + /* Inline replacements for DRM_IOREMAP macros */ static __inline__ void drm_core_ioremap(struct drm_local_map *map, struct drm_device *dev) -- cgit v1.2.3 From 480c317a6ae634d777931eee54fadd2a50a2f650 Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Thu, 17 Jul 2008 14:01:04 -0400 Subject: [FreeBSD] drm_irq.c updates for vblank fixes. --- bsd-core/drmP.h | 1 + 1 file changed, 1 insertion(+) (limited to 'bsd-core/drmP.h') diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index b0a23e9c..2f2ffb3c 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -787,6 +787,7 @@ struct drm_device { atomic_t context_flag; /* Context swapping flag */ int last_context; /* Last current context */ + int vblank_disable_allowed; wait_queue_head_t *vbl_queue; /* vblank wait queue */ atomic_t *_vblank_count; /* number of VBLANK interrupts */ /* (driver must alloc the right number of counters) */ -- cgit v1.2.3 From f57f01f02843747d423f2e1c2936f0b987c5b067 Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Mon, 21 Jul 2008 18:04:02 -0400 Subject: [FreeBSD] Improve upper_32_bits define. Thanks to airlied. --- bsd-core/drmP.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bsd-core/drmP.h') diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index 2f2ffb3c..6b91a76b 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -632,7 +632,7 @@ struct drm_ati_pcigart_info { #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : (1ULL<<(n)) - 1) #endif -#define upper_32_bits(_val) (((u64)(_val)) >> 32) +#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16)) struct drm_driver_info { int (*load)(struct drm_device *, unsigned long flags); -- cgit v1.2.3 From 2580a065d81be645a14af1e91b8441f7e72fcbe4 Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Thu, 24 Jul 2008 00:21:00 -0400 Subject: [FreeBSD] Catch up to linux on vblank-rework --- bsd-core/drmP.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'bsd-core/drmP.h') diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index 6b91a76b..326b2202 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -798,8 +798,7 @@ struct drm_device { /* for wraparound handling */ int *vblank_enabled; /* so we don't call enable more than */ /* once per disable */ - u32 *vblank_premodeset; /* for compensation of spurious wraparounds */ - int *vblank_suspend; /* Don't wait while crtc is likely disabled */ + int *vblank_inmodeset; /* Display driver is setting mode */ struct callout vblank_disable_timer; u32 max_vblank_count; /* size of vblank counter register */ int num_crtcs; @@ -932,7 +931,6 @@ void drm_handle_vblank(struct drm_device *dev, int crtc); u32 drm_vblank_count(struct drm_device *dev, int crtc); int drm_vblank_get(struct drm_device *dev, int crtc); void drm_vblank_put(struct drm_device *dev, int crtc); -void drm_update_vblank_count(struct drm_device *dev, int crtc); int drm_vblank_wait(struct drm_device *dev, unsigned int *vbl_seq); int drm_vblank_init(struct drm_device *dev, int num_crtcs); void drm_vbl_send_signals(struct drm_device *dev, int crtc); -- cgit v1.2.3