~ubuntu-branches/ubuntu/intrepid/xserver-xgl/intrepid

« back to all changes in this revision

Viewing changes to hw/kdrive/mach64/mach64draw.h

  • Committer: Bazaar Package Importer
  • Author(s): Matthew Garrett
  • Date: 2006-02-13 14:21:43 UTC
  • Revision ID: james.westby@ubuntu.com-20060213142143-mad6z9xzem7hzxz9
Tags: upstream-7.0.0
Import upstream version 7.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Id: tridentdraw.h,v 1.1 1999/11/02 03:54:47 keithp Exp $
 
3
 *
 
4
 * Copyright � 1999 Keith Packard
 
5
 *
 
6
 * Permission to use, copy, modify, distribute, and sell this software and its
 
7
 * documentation for any purpose is hereby granted without fee, provided that
 
8
 * the above copyright notice appear in all copies and that both that
 
9
 * copyright notice and this permission notice appear in supporting
 
10
 * documentation, and that the name of Keith Packard not be used in
 
11
 * advertising or publicity pertaining to distribution of the software without
 
12
 * specific, written prior permission.  Keith Packard makes no
 
13
 * representations about the suitability of this software for any purpose.  It
 
14
 * is provided "as is" without express or implied warranty.
 
15
 *
 
16
 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 
17
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
 
18
 * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
 
19
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
 
20
 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
 
21
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 
22
 * PERFORMANCE OF THIS SOFTWARE.
 
23
 */
 
24
/* $RCSId: xc/programs/Xserver/hw/kdrive/trident/tridentdraw.h,v 1.4 2000/10/11 06:04:40 keithp Exp $ */
 
25
 
 
26
#ifndef _TRIDENTDRAW_H_
 
27
#define _TRIDENTDRAW_H_
 
28
 
 
29
#define SetupTrident(s) KdScreenPriv(s); \
 
30
                    tridentCardInfo(pScreenPriv); \
 
31
                    Cop     *cop = tridentc->cop
 
32
 
 
33
#define TridentAlpha    (COP_MULTI_ALPHA|COP_ALPHA_WRITE_ENABLE)
 
34
 
 
35
#define _tridentInit(cop,tridentc) { \
 
36
    if ((cop)->status == 0xffffffff) tridentSetMMIO(tridentc); \
 
37
    (cop)->multi = (tridentc)->cop_depth; \
 
38
    (cop)->multi = (tridentc)->cop_stride; \
 
39
    (cop)->multi = TridentAlpha; \
 
40
} \
 
41
 
 
42
#define _tridentSetSolidRect(cop,pix,alu,cmd) {\
 
43
    cop->multi = COP_MULTI_PATTERN; \
 
44
    cop->multi = COP_MULTI_ROP | tridentRop[alu]; \
 
45
    cop->fg = (pix); \
 
46
    cmd = COP_OP_BLT | COP_SCL_OPAQUE | COP_OP_ROP | COP_OP_FG; \
 
47
}
 
48
 
 
49
#define _tridentRect(cop,x1,y1,x2,y2,cmd) { \
 
50
    (cop)->dst_start_xy = TRI_XY (x1,y1); \
 
51
    (cop)->dst_end_xy = TRI_XY(x2,y2); \
 
52
    _tridentWaitDone(cop); \
 
53
    (cop)->command = (cmd); \
 
54
}
 
55
 
 
56
#define COP_STATUS_BUSY (COP_STATUS_BE_BUSY | \
 
57
                         COP_STATUS_DPE_BUSY | \
 
58
                         COP_STATUS_MI_BUSY)
 
59
 
 
60
#define _tridentWaitDone(cop)   { \
 
61
    int __q__ = 500000; \
 
62
    while (__q__-- && (cop)->status & COP_STATUS_BUSY) \
 
63
        ; \
 
64
    if (!__q__) \
 
65
        (cop)->status = 0;  \
 
66
}
 
67
 
 
68
#define _tridentWaitIdleEmpty(cop)      _tridentWaitDone(cop)
 
69
 
 
70
#define sourceInvarient(alu)    (((alu) & 3) == (((alu) >> 2) & 3))
 
71
 
 
72
#endif