aboutsummaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorGareth Hughes <gareth@users.sourceforge.net>2001-01-24 15:34:46 +0000
committerGareth Hughes <gareth@users.sourceforge.net>2001-01-24 15:34:46 +0000
commit4d2a4455b4e7bc65952aa6167c34b488c4ca3b8d (patch)
tree853b80f2484ac679f46f6c8319807b6e0ec24b0c /linux-core
parent642bb6fbb0bfbc6e549e61bd0ece72abcbd399b7 (diff)
- Misc cleanups.
- Fix drmR128Clear parameters (Radeon to follow). - Add some helper macros to r128/radeon kernel modules.
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/drmP.h51
-rw-r--r--linux-core/r128_drv.c2
2 files changed, 37 insertions, 16 deletions
diff --git a/linux-core/drmP.h b/linux-core/drmP.h
index affeae70..9a8fe61f 100644
--- a/linux-core/drmP.h
+++ b/linux-core/drmP.h
@@ -11,11 +11,11 @@
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
@@ -23,10 +23,10 @@
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
- *
+ *
* Authors:
* Rickard E. (Rik) Faith <faith@valinux.com>
- *
+ *
*/
#ifndef _DRM_P_H_
@@ -284,6 +284,27 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
len += sprintf(&buf[len], fmt , ##arg); \
if (len > DRM_PROC_LIMIT) { ret; return len; }
+ /* Mapping helper macros */
+#define DRM_IOREMAP(map) \
+ (map)->handle = drm_ioremap( (map)->offset, (map)->size )
+
+#define DRM_IOREMAPFREE(map) \
+ do { \
+ if ( (map)->handle && (map)->size ) \
+ drm_ioremapfree( (map)->handle, (map)->size ); \
+ } while (0)
+
+#define DRM_FIND_MAP(map, o) \
+ do { \
+ int i; \
+ for ( i = 0 ; i < dev->map_count ; i++ ) { \
+ if ( dev->maplist[i]->offset == o ) { \
+ map = dev->maplist[i]; \
+ break; \
+ } \
+ } \
+ } while (0)
+
/* Internal types and structures */
#define DRM_ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
#define DRM_MIN(a,b) ((a)<(b)?(a):(b))
@@ -304,7 +325,7 @@ typedef struct drm_ioctl_desc {
typedef struct drm_devstate {
pid_t owner; /* X server pid holding x_lock */
-
+
} drm_devstate_t;
typedef struct drm_magic_entry {
@@ -365,14 +386,14 @@ typedef struct drm_buf {
#define DRM_DMA_HISTOGRAM_NEXT(current) ((current)*10)
typedef struct drm_histogram {
atomic_t total;
-
+
atomic_t queued_to_dispatched[DRM_DMA_HISTOGRAM_SLOTS];
atomic_t dispatched_to_completed[DRM_DMA_HISTOGRAM_SLOTS];
atomic_t completed_to_freed[DRM_DMA_HISTOGRAM_SLOTS];
-
+
atomic_t queued_to_completed[DRM_DMA_HISTOGRAM_SLOTS];
atomic_t queued_to_freed[DRM_DMA_HISTOGRAM_SLOTS];
-
+
atomic_t dma[DRM_DMA_HISTOGRAM_SLOTS];
atomic_t schedule[DRM_DMA_HISTOGRAM_SLOTS];
atomic_t ctx[DRM_DMA_HISTOGRAM_SLOTS];
@@ -396,7 +417,7 @@ typedef struct drm_freelist {
int initialized; /* Freelist in use */
atomic_t count; /* Number of free buffers */
drm_buf_t *next; /* End pointer */
-
+
wait_queue_head_t waiting; /* Processes waiting on free bufs */
int low_mark; /* Low water mark */
int high_mark; /* High water mark */
@@ -462,7 +483,7 @@ typedef struct drm_device_dma {
atomic_t total_prio; /* Total DRM_DMA_PRIORITY */
atomic_t total_bytes; /* Total bytes DMA'd */
atomic_t total_dmas; /* Total DMA buffers dispatched */
-
+
atomic_t total_missed_dma; /* Missed drm_do_dma */
atomic_t total_missed_lock; /* Missed lock in drm_do_dma */
atomic_t total_missed_free; /* Missed drm_free_this_buffer */
@@ -475,7 +496,7 @@ typedef struct drm_device_dma {
drm_buf_entry_t bufs[DRM_MAX_ORDER+1];
int buf_count;
drm_buf_t **buflist; /* Vector of pointers info bufs */
- int seg_count;
+ int seg_count;
int page_count;
unsigned long *pagelist;
unsigned long byte_count;
@@ -523,7 +544,7 @@ typedef struct drm_device {
int unique_len; /* Length of unique field */
dev_t device; /* Device number for mknod */
char *devname; /* For /proc/interrupts */
-
+
int blocked; /* Blocked due to VC switch? */
struct proc_dir_entry *root; /* Root for this device's entries */
@@ -544,7 +565,7 @@ typedef struct drm_device {
atomic_t total_ioctl;
atomic_t total_irq; /* Total interruptions */
atomic_t total_ctx; /* Total context switches */
-
+
atomic_t total_locks;
atomic_t total_unlocks;
atomic_t total_contends;
@@ -585,7 +606,7 @@ typedef struct drm_device {
#if DRM_DMA_HISTOGRAM
drm_histogram_t histo;
#endif
-
+
/* Callback to X server for context switch
and for heavy-handed reset. */
char buf[DRM_BSZ]; /* Output buffer */
@@ -595,7 +616,7 @@ typedef struct drm_device {
struct fasync_struct *buf_async;/* Processes waiting for SIGIO */
wait_queue_head_t buf_readers; /* Processes waiting to read */
wait_queue_head_t buf_writers; /* Processes waiting to ctx switch */
-
+
#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE)
drm_agp_head_t *agp;
#endif
diff --git a/linux-core/r128_drv.c b/linux-core/r128_drv.c
index cf258925..62185b58 100644
--- a/linux-core/r128_drv.c
+++ b/linux-core/r128_drv.c
@@ -37,7 +37,7 @@
#define R128_NAME "r128"
#define R128_DESC "ATI Rage 128"
-#define R128_DATE "20010101"
+#define R128_DATE "20010125"
#define R128_MAJOR 2
#define R128_MINOR 1
#define R128_PATCHLEVEL 4