Home | History | Annotate | Line # | Download | only in src
      1 /* r128_common.h -- common header definitions for R128 2D/3D/DRM suite
      2  * Created: Sun Apr  9 18:16:28 2000 by kevin (at) precisioninsight.com
      3  *
      4  * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
      5  * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas.
      6  * All Rights Reserved.
      7  *
      8  * Permission is hereby granted, free of charge, to any person obtaining a
      9  * copy of this software and associated documentation files (the "Software"),
     10  * to deal in the Software without restriction, including without limitation
     11  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
     12  * and/or sell copies of the Software, and to permit persons to whom the
     13  * Software is furnished to do so, subject to the following conditions:
     14  *
     15  * The above copyright notice and this permission notice (including the next
     16  * paragraph) shall be included in all copies or substantial portions of the
     17  * Software.
     18  *
     19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     20  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     21  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
     22  * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
     23  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
     24  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
     25  * DEALINGS IN THE SOFTWARE.
     26  *
     27  * Author:
     28  *   Gareth Hughes <gareth (at) valinux.com>
     29  *   Kevin E. Martin <martin (at) valinux.com>
     30  *
     31  * Converted to common header format:
     32  *   Jens Owen <jens (at) tungstengraphics.com>
     33  *
     34  */
     35 
     36 #ifndef _R128_COMMON_H_
     37 #define _R128_COMMON_H_
     38 
     39 #include <X11/Xmd.h>
     40 
     41 /*
     42  * WARNING: If you change any of these defines, make sure to change
     43  * the kernel include file as well (r128_drm.h)
     44  */
     45 
     46 /* Driver specific DRM command indices
     47  * NOTE: these are not OS specific, but they are driver specific
     48  */
     49 #define DRM_R128_INIT           0x00
     50 #define DRM_R128_CCE_START      0x01
     51 #define DRM_R128_CCE_STOP       0x02
     52 #define DRM_R128_CCE_RESET      0x03
     53 #define DRM_R128_CCE_IDLE       0x04
     54 #define DRM_R128_UNDEFINED1     0x05
     55 #define DRM_R128_RESET          0x06
     56 #define DRM_R128_SWAP           0x07
     57 #define DRM_R128_CLEAR          0x08
     58 #define DRM_R128_VERTEX         0x09
     59 #define DRM_R128_INDICES        0x0a
     60 #define DRM_R128_BLIT           0x0b
     61 #define DRM_R128_DEPTH          0x0c
     62 #define DRM_R128_STIPPLE        0x0d
     63 #define DRM_R128_UNDEFINED2     0x0e
     64 #define DRM_R128_INDIRECT       0x0f
     65 #define DRM_R128_FULLSCREEN     0x10
     66 #define DRM_R128_CLEAR2         0x11
     67 #define DRM_R128_GETPARAM       0x12
     68 #define DRM_R128_FLIP           0x13
     69 
     70 #define DRM_R128_FRONT_BUFFER	0x1
     71 #define DRM_R128_BACK_BUFFER	0x2
     72 #define DRM_R128_DEPTH_BUFFER	0x4
     73 
     74 typedef struct {
     75    enum {
     76       DRM_R128_INIT_CCE    = 0x01,
     77       DRM_R128_CLEANUP_CCE = 0x02
     78    } func;
     79    unsigned long sarea_priv_offset;
     80    int is_pci;
     81    int cce_mode;
     82    int cce_secure;		/* FIXME: Deprecated, we should remove this */
     83    int ring_size;
     84    int usec_timeout;
     85 
     86    unsigned int fb_bpp;
     87    unsigned int front_offset, front_pitch;
     88    unsigned int back_offset, back_pitch;
     89    unsigned int depth_bpp;
     90    unsigned int depth_offset, depth_pitch;
     91    unsigned int span_offset;
     92 
     93    unsigned long fb_offset;
     94    unsigned long mmio_offset;
     95    unsigned long ring_offset;
     96    unsigned long ring_rptr_offset;
     97    unsigned long buffers_offset;
     98    unsigned long agp_textures_offset;
     99 } drmR128Init;
    100 
    101 typedef struct {
    102    int flush;
    103    int idle;
    104 } drmR128CCEStop;
    105 
    106 typedef struct {
    107    int idx;
    108    int start;
    109    int end;
    110    int discard;
    111 } drmR128Indirect;
    112 
    113 typedef struct {
    114    int idx;
    115    int pitch;
    116    int offset;
    117    int format;
    118    unsigned short x, y;
    119    unsigned short width, height;
    120 } drmR128Blit;
    121 
    122 typedef struct {
    123    enum {
    124       DRM_R128_WRITE_SPAN         = 0x01,
    125       DRM_R128_WRITE_PIXELS       = 0x02,
    126       DRM_R128_READ_SPAN          = 0x03,
    127       DRM_R128_READ_PIXELS        = 0x04
    128    } func;
    129    int n;
    130    int *x;
    131    int *y;
    132    unsigned int *buffer;
    133    unsigned char *mask;
    134 } drmR128Depth;
    135 
    136 typedef struct {
    137    int prim;
    138    int idx;                        /* Index of vertex buffer */
    139    int count;                      /* Number of vertices in buffer */
    140    int discard;                    /* Client finished with buffer? */
    141 } drmR128Vertex;
    142 
    143 typedef struct {
    144    unsigned int *mask;
    145 } drmR128Stipple;
    146 
    147 typedef struct {
    148    unsigned int flags;
    149    unsigned int clear_color;
    150    unsigned int clear_depth;
    151    unsigned int color_mask;
    152    unsigned int depth_mask;
    153 } drmR128Clear;
    154 
    155 typedef struct {
    156    enum {
    157       DRM_R128_INIT_FULLSCREEN    = 0x01,
    158       DRM_R128_CLEANUP_FULLSCREEN = 0x02
    159    } func;
    160 } drmR128Fullscreen;
    161 
    162 typedef struct drm_r128_getparam {
    163 	int param;
    164 	int *value;
    165 } drmR128GetParam;
    166 
    167 #define R128_PARAM_IRQ_NR            1
    168 
    169 #endif
    170