summaryrefslogtreecommitdiff
path: root/xc/programs/Xserver/hw/xfree86/os-support/xf86drmR128.h
blob: 99bbeaa5a84b19eb5d52955a3f80ffea39fcdb81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/* xf86drm.h -- OS-independent header for DRM user-level library interface
 * Created: Sun Apr  9 18:16:28 2000 by kevin@precisioninsight.com
 *
 * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
 * All Rights Reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * 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
 * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * 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.
 *
 * Author:
 *   Gareth Hughes <gareth@valinux.com>
 *   Kevin E. Martin <martin@valinux.com>
 *
 * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86drmR128.h,v 3.5 2000/12/12 17:17:13 dawes Exp $
 *
 */

#ifndef __XF86DRI_R128_H__
#define __XF86DRI_R128_H__

#include "X11/Xmd.h"

/*
 * WARNING: If you change any of these defines, make sure to change
 * the kernel include file as well (r128_drm.h)
 */

#define DRM_R128_FRONT		0x1
#define DRM_R128_BACK		0x2
#define DRM_R128_DEPTH		0x4

typedef struct {
   int sarea_priv_offset;
   int is_pci;
   int cce_mode;
   int cce_secure;		/* FIXME: Deprecated, we should remove this */
   int ring_size;
   int usec_timeout;

   unsigned int fb_bpp;
   unsigned int front_offset, front_pitch;
   unsigned int back_offset, back_pitch;
   unsigned int depth_bpp;
   unsigned int depth_offset, depth_pitch;
   unsigned int span_offset;

   unsigned int fb_offset;
   unsigned int mmio_offset;
   unsigned int ring_offset;
   unsigned int ring_rptr_offset;
   unsigned int buffers_offset;
   unsigned int agp_textures_offset;
} drmR128Init;

extern int drmR128InitCCE( int fd, drmR128Init *info );
extern int drmR128CleanupCCE( int fd );

extern int drmR128StartCCE( int fd );
extern int drmR128StopCCE( int fd );
extern int drmR128ResetCCE( int fd );
extern int drmR128WaitForIdleCCE( int fd );

extern int drmR128EngineReset( int fd );

extern int drmR128FullScreen( int fd, int enable );

extern int drmR128SwapBuffers( int fd );
extern int drmR128Clear( int fd, unsigned int flags,
			 int x, int y, int w, int h,
			 unsigned int clear_color,
			 unsigned int clear_depth );

extern int drmR128FlushVertexBuffer( int fd, int prim, int indx,
				     int count, int discard );
extern int drmR128FlushIndices( int fd, int prim, int indx,
				int start, int end, int discard );

extern int drmR128TextureBlit( int fd, int index,
			       int offset, int pitch, int format,
			       int x, int y, int width, int height );

extern int drmR128WriteDepthSpan( int fd, int n, int x, int y,
				  const unsigned int depth[],
				  const unsigned char mask[] );
extern int drmR128WriteDepthPixels( int fd, int n,
				    const int x[], const int y[],
				    const unsigned int depth[],
				    const unsigned char mask[] );
extern int drmR128ReadDepthSpan( int fd, int n, int x, int y );
extern int drmR128ReadDepthPixels( int fd, int n,
				   const int x[], const int y[] );

extern int drmR128PolygonStipple( int fd, unsigned int *mask );

extern int drmR128FlushIndirectBuffer( int fd, int index,
				       int start, int end, int discard );

#endif