91
90
mode->yViewportStep = 1;
92
91
mode->viewportFlags = DGA_FLIP_RETRACE;
94
mode->address = (unsigned char *) xf86_config->dga_address;
95
mode->bytesPerScanline = xf86_config->dga_stride;
96
mode->imageWidth = xf86_config->dga_width;
97
mode->imageHeight = xf86_config->dga_height;
94
mode->imageWidth = mode->viewportWidth;
95
mode->imageHeight = mode->viewportHeight;
96
mode->bytesPerScanline = (mode->imageWidth * scrn->bitsPerPixel) >> 3;
98
97
mode->pixmapWidth = mode->imageWidth;
99
98
mode->pixmapHeight = mode->imageHeight;
100
mode->maxViewportX = mode->imageWidth - mode->viewportWidth;
101
mode->maxViewportY = mode->imageHeight - mode->viewportHeight;
99
mode->maxViewportX = 0;
100
mode->maxViewportY = 0;
103
102
display_mode = display_mode->next;
104
103
if (display_mode == scrn->modes)
107
if (xf86_config->dga_modes)
108
xfree (xf86_config->dga_modes);
106
free(xf86_config->dga_modes);
109
107
xf86_config->dga_nmode = num;
110
108
xf86_config->dga_modes = modes;
152
xf86_dga_get_drawable_and_gc (ScrnInfoPtr scrn, DrawablePtr *ppDrawable, GCPtr *ppGC)
154
ScreenPtr pScreen = scrn->pScreen;
155
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
159
pPixmap = GetScratchPixmapHeader (pScreen, xf86_config->dga_width, xf86_config->dga_height,
160
scrn->depth, scrn->bitsPerPixel, xf86_config->dga_stride,
161
(char *) scrn->memPhysBase + scrn->fbOffset);
164
pGC = GetScratchGC (scrn->depth, pScreen);
167
FreeScratchPixmapHeader (pPixmap);
170
*ppDrawable = &pPixmap->drawable;
176
xf86_dga_release_drawable_and_gc (ScrnInfoPtr scrn, DrawablePtr pDrawable, GCPtr pGC)
179
FreeScratchPixmapHeader ((PixmapPtr) pDrawable);
183
xf86_dga_fill_rect(ScrnInfoPtr scrn, int x, int y, int w, int h, unsigned long color)
186
DrawablePtr pDrawable;
190
if (!xf86_dga_get_drawable_and_gc (scrn, &pDrawable, &pGC))
193
ChangeGC (pGC, GCForeground, vals);
194
ValidateGC (pDrawable, pGC);
199
pGC->ops->PolyFillRect (pDrawable, pGC, 1, &r);
200
xf86_dga_release_drawable_and_gc (scrn, pDrawable, pGC);
204
xf86_dga_sync(ScrnInfoPtr scrn)
206
ScreenPtr pScreen = scrn->pScreen;
207
WindowPtr pRoot = WindowTable [pScreen->myNum];
210
pScreen->GetImage (&pRoot->drawable, 0, 0, 1, 1, ZPixmap, ~0L, buffer);
214
xf86_dga_blit_rect(ScrnInfoPtr scrn, int srcx, int srcy, int w, int h, int dstx, int dsty)
216
DrawablePtr pDrawable;
219
if (!xf86_dga_get_drawable_and_gc (scrn, &pDrawable, &pGC))
221
ValidateGC (pDrawable, pGC);
222
pGC->ops->CopyArea (pDrawable, pDrawable, pGC, srcx, srcy, w, h, dstx, dsty);
223
xf86_dga_release_drawable_and_gc (scrn, pDrawable, pGC);
227
150
xf86_dga_open_framebuffer(ScrnInfoPtr scrn,
229
152
unsigned char **mem, int *size, int *offset, int *flags)
231
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
233
*size = xf86_config->dga_stride * xf86_config->dga_height;
234
*mem = (unsigned char *) (xf86_config->dga_address);
236
*flags = DGA_NEED_ROOT;
271
196
xf86DiDGAInit (ScreenPtr pScreen, unsigned long dga_address)
202
_xf86_di_dga_init_internal (ScreenPtr pScreen)
273
204
ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
274
205
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
276
207
xf86_config->dga_flags = 0;
277
xf86_config->dga_address = dga_address;
278
xf86_config->dga_width = scrn->virtualX;
279
xf86_config->dga_height = scrn->virtualY;
280
xf86_config->dga_stride = scrn->displayWidth * scrn->bitsPerPixel >> 3;
208
xf86_config->dga_address = 0;
209
xf86_config->dga_width = 0;
210
xf86_config->dga_height = 0;
211
xf86_config->dga_stride = 0;
282
213
if (!xf86_dga_get_modes (pScreen))