sw-exa.c 3.73 KB
Newer Older
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/* Texas Instruments OMAP framebuffer driver for X.Org
 * Copyright 2008 Kalle Vahlman, <zuh@iki.fi>
 *
 * Permission to use, copy, modify, distribute and sell this software and its
 * documentation for any purpose is hereby granted without fee, provided that
 * the above copyright notice appear in all copies and that both that
 * copyright notice and this permission notice appear in supporting
 * documentation, and that the names of the authors and/or copyright holders
 * not be used in advertising or publicity pertaining to distribution of the
 * software without specific, written prior permission.  The authors and
 * copyright holders make no representations about the suitability of this
 * software for any purpose.  It is provided "as is" without any express
 * or implied warranty.
 *
 * THE AUTHORS AND COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO
 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS, IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
 * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
 * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
 * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "xorgVersion.h"
#include "xf86.h"
#include "fb.h"

#include "fbdev_priv.h"
#include "sw-exa.h"

#ifdef LOG_CALLS
# define FALLBACK do { ErrorF("Fallback from %s\n", __FUNCTION__); } while (0)
#else
# define FALLBACK do { } while (0) 
#endif

/*** Solid fill */

static Bool
SWPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg)
{
	FALLBACK;
	return FALSE;
}

static void
SWSolid(PixmapPtr pPixmap, int x1, int y1, int x2, int y2)
{
	FALLBACK;
}

static void
SWDoneSolid(PixmapPtr pPixmap)
{
	FALLBACK;
}

/*** Copy */

static Bool
SWPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int dx, int dy, int alu, Pixel planemask) 
{
	FALLBACK;
	return FALSE;
}

static void
SWCopy(PixmapPtr pDstPixmap, int srcX, int srcY, int dstX, int dstY, int width, int height) 
{
	FALLBACK;
}

static void
SWDoneCopy(PixmapPtr pDstPixmap) 
{
	FALLBACK;
}

/*** Composite */

static Bool
SWCheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture) 
{
	FALLBACK;
	return FALSE;
}

static Bool
SWPrepareComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture, PixmapPtr pSrc, PixmapPtr pMask, PixmapPtr pDst)
{
	FALLBACK;
	return FALSE;
}

static void
SWComposite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, int width, int height)
{
}

static void
SWDoneComposite(PixmapPtr pDst)
{
}

/*** General */

static void
SWWaitMarker(ScreenPtr pScreen, int marker)
{
}

static Bool
SWPrepareAccess(PixmapPtr pPix, int index)
{
	return TRUE;
}

static void
SWFinishAccess(PixmapPtr pPix, int index)
{
}

/*** Setup */

Bool OMAPFBSetupExa(ScreenPtr pScreen, FBDevPtr ofb)
{
	ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];

	ofb->exa->exa_major = 2;
	ofb->exa->exa_minor = 0;
	ofb->exa->flags = EXA_OFFSCREEN_PIXMAPS;
	
	ofb->exa->memoryBase = ofb->fbmem;
	ofb->exa->memorySize = ofb->lineLength * pScrn->virtualY;
	ofb->exa->offScreenBase = ofb->exa->memorySize;

	ofb->exa->pixmapOffsetAlign = 4;
	ofb->exa->pixmapPitchAlign = 4;

	ofb->exa->maxX = 8192;
	ofb->exa->maxY = 8192;

#define EXA_FUNC(s) ofb->exa->s = SW ## s
	
	EXA_FUNC(PrepareSolid);
	EXA_FUNC(Solid);
	EXA_FUNC(DoneSolid);

	EXA_FUNC(PrepareCopy);
	EXA_FUNC(Copy);
	EXA_FUNC(DoneCopy);

	EXA_FUNC(CheckComposite);
	EXA_FUNC(PrepareComposite);
	EXA_FUNC(Composite);
	EXA_FUNC(DoneComposite);

	EXA_FUNC(WaitMarker);
	EXA_FUNC(PrepareAccess);
	EXA_FUNC(FinishAccess);

	return TRUE;
}