Patch removes _SOLO definition needed for mesa-solo. mesa-solo
[mesa.git] / src / mesa / drivers / dri / unichrome / via_ioctl.h
1 /*
2 * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
3 * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sub license,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the
13 * next paragraph) shall be included in all copies or substantial portions
14 * of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
19 * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */
24
25 #ifndef _VIAIOCTL_H
26 #define _VIAIOCTL_H
27
28 #include "via_context.h"
29
30
31 void viaEmitPrim(viaContextPtr vmesa);
32 void viaFlushPrims(viaContextPtr vmesa);
33 void viaFlushPrimsLocked(viaContextPtr vmesa);
34
35 void viaDmaFinish(viaContextPtr vmesa);
36 void viaRegetLockQuiescent(viaContextPtr vmesa);
37 void viaInitIoctlFuncs(GLcontext *ctx);
38 void viaCopyBuffer(const __DRIdrawablePrivate *dpriv);
39 void viaPageFlip(const __DRIdrawablePrivate *dpriv);
40 int via_check_copy(int fd);
41 void viaFillFrontBuffer(viaContextPtr vmesa);
42 void viaFillFrontBufferSaam(viaContextPtr vmesa);
43 void viaFillFrontPBuffer(viaContextPtr vmesa);
44 void viaFillBackBuffer(viaContextPtr vmesa);
45 void viaFillDepthBuffer(viaContextPtr vmesa, GLuint pixel);
46 void viaFillStencilBuffer(viaContextPtr vmesa, GLuint pixel);
47 void viaFillStencilDepthBuffer(viaContextPtr vmesa, GLuint pixel);
48 void viaDoSwapBuffers(viaContextPtr vmesa);
49 void viaDoSwapBuffersSaam(viaContextPtr vmesa);
50 void viaDoSwapBufferSoft(viaContextPtr vmesa);
51 void viaDoSwapBufferSoftFront(viaContextPtr vmesa);
52 void viaDoSwapPBuffers(viaContextPtr vmesa);
53
54 int flush_agp(viaContextPtr vmesa, drm_via_flush_agp_t* agpCmd);
55 int flush_agp_saam(viaContextPtr vmesa, drm_via_flush_agp_t* agpCmd);
56 int flush_sys(viaContextPtr vmesa, drm_via_flush_sys_t* buf);
57
58 #define VIA_STATECHANGE(vmesa, flag) \
59 do { \
60 if (vmesa->dmaLow != vmesa->dmaLastPrim) \
61 viaFlushPrims(vmesa); \
62 vmesa->dirty |= flag; \
63 } while (0) \
64
65
66 #define VIA_FIREVERTICES(vmesa) \
67 do { \
68 if (vmesa->dmaLow) { \
69 viaFlushPrims(vmesa); \
70 } \
71 } while (0)
72
73
74 static __inline GLuint *viaCheckDma(viaContextPtr vmesa, int bytes)
75 {
76 if (vmesa->dmaLow + bytes > vmesa->dmaHigh) {
77 #ifdef DEBUG
78 if (VIA_DEBUG) fprintf(stderr, "buffer overflow in check dma = %d + %d = %d\n", vmesa->dmaLow, bytes, vmesa->dmaLow + bytes);
79 #endif
80 viaFlushPrims(vmesa);
81 }
82
83 {
84 GLuint *start = (GLuint *)(vmesa->dmaAddr + vmesa->dmaLow);
85 return start;
86 }
87 }
88 #endif