Back to home page

OSCL-LXR

 
 

    


0001 /* sis_drv.h -- Private header for sis driver -*- linux-c -*- */
0002 /*
0003  * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
0004  * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
0005  * All rights reserved.
0006  *
0007  * Permission is hereby granted, free of charge, to any person obtaining a
0008  * copy of this software and associated documentation files (the "Software"),
0009  * to deal in the Software without restriction, including without limitation
0010  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
0011  * and/or sell copies of the Software, and to permit persons to whom the
0012  * Software is furnished to do so, subject to the following conditions:
0013  *
0014  * The above copyright notice and this permission notice (including the next
0015  * paragraph) shall be included in all copies or substantial portions of the
0016  * Software.
0017  *
0018  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0019  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0020  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
0021  * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
0022  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
0023  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
0024  * DEALINGS IN THE SOFTWARE.
0025  *
0026  */
0027 
0028 #ifndef _SIS_DRV_H_
0029 #define _SIS_DRV_H_
0030 
0031 #include <drm/drm_ioctl.h>
0032 #include <drm/drm_legacy.h>
0033 #include <drm/drm_mm.h>
0034 
0035 /* General customization:
0036  */
0037 
0038 #define DRIVER_AUTHOR       "SIS, Tungsten Graphics"
0039 #define DRIVER_NAME     "sis"
0040 #define DRIVER_DESC     "SIS 300/630/540 and XGI V3XE/V5/V8"
0041 #define DRIVER_DATE     "20070626"
0042 #define DRIVER_MAJOR        1
0043 #define DRIVER_MINOR        3
0044 #define DRIVER_PATCHLEVEL   0
0045 
0046 enum sis_family {
0047     SIS_OTHER = 0,
0048     SIS_CHIP_315 = 1,
0049 };
0050 
0051 #define SIS_READ(reg)         readl(((void __iomem *)dev_priv->mmio->handle) + (reg))
0052 #define SIS_WRITE(reg, val)   writel(val, ((void __iomem *)dev_priv->mmio->handle) + (reg))
0053 
0054 typedef struct drm_sis_private {
0055     drm_local_map_t *mmio;
0056     unsigned int idle_fault;
0057     unsigned int chipset;
0058     int vram_initialized;
0059     int agp_initialized;
0060     unsigned long vram_offset;
0061     unsigned long agp_offset;
0062     struct drm_mm vram_mm;
0063     struct drm_mm agp_mm;
0064     /** Mapping of userspace keys to mm objects */
0065     struct idr object_idr;
0066 } drm_sis_private_t;
0067 
0068 struct sis_file_private {
0069     struct list_head obj_list;
0070 };
0071 
0072 extern int sis_idle(struct drm_device *dev);
0073 extern void sis_reclaim_buffers_locked(struct drm_device *dev,
0074                        struct drm_file *file_priv);
0075 extern void sis_lastclose(struct drm_device *dev);
0076 
0077 extern const struct drm_ioctl_desc sis_ioctls[];
0078 extern int sis_max_ioctl;
0079 
0080 #endif