summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkem <kem>2000-03-21 16:53:02 +0000
committerkem <kem>2000-03-21 16:53:02 +0000
commit669b2e1f7d9829453f99590bb08210a39409cae7 (patch)
treee4eb0157bab4b3063f1ab721a19c1806c081a41d
parent557403d05de964924b5b0e96679c2e969371a4b5 (diff)
Enable DD_TRI_OFFSET and DD_TRI_LIGHT_TWOSIDE supportati-4-0-1-alpha
Points/lines are not yet supported, so use software rendering for them Enable front/back/depth buffer initialization in r128 ddx driver Applied patch for AGP from Rik Faith <faith@precisioninsight.com>
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_tris.c12
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/r128/r128_dri.c21
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/agpsupport.c7
3 files changed, 33 insertions, 7 deletions
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_tris.c b/xc/lib/GL/mesa/src/drv/r128/r128_tris.c
index 48e6cef09..c738d0587 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_tris.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_tris.c
@@ -172,6 +172,13 @@ void r128ChooseRenderState(GLcontext *ctx)
r128ctx->IndirectTriangles = 0;
}
+#if 1
+ /* FIXME: Only triangles are currently supported in hardware */
+ if (!r128ctx->SWfallbackDisable) {
+ /* Force SW rendering of points and lines */
+ flags |= DD_POINT_SMOOTH | DD_LINE_SMOOTH;
+ }
+#endif
if (flags) {
CARD32 index = 0;
CARD32 shared = 0;
@@ -208,13 +215,8 @@ void r128ChooseRenderState(GLcontext *ctx)
/* Setup TriangleFunc and QuadFunc */
index = shared;
if (flags & DD_TRI_SMOOTH) index |= fallback;
-#if 1
- if (flags & DD_TRI_OFFSET) index |= fallback;
- if (flags & DD_TRI_LIGHT_TWOSIDE) index |= fallback;
-#else
if (flags & DD_TRI_OFFSET) index |= R128_OFFSET_BIT;
if (flags & DD_TRI_LIGHT_TWOSIDE) index |= R128_TWOSIDE_BIT;
-#endif
if (flags & DD_TRI_UNFILLED) index |= fallback;
if (flags & DD_TRI_STIPPLE) index |= fallback;
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/r128/r128_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/r128/r128_dri.c
index f5e5aefb8..2ba79a5b8 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/r128/r128_dri.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/r128/r128_dri.c
@@ -352,13 +352,22 @@ static void R128DRISwapContext(ScreenPtr pScreen, DRISyncType syncType,
/* Initialize the state of the back and depth buffers. */
static void R128DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index)
{
-#if 0
+#if 1
/* FIXME: This routine needs to have acceleration turned on */
ScreenPtr pScreen = pWin->drawable.pScreen;
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
R128InfoPtr pR128 = R128PTR(pScrn);
BoxPtr pbox;
int nbox;
+ int depth;
+
+ switch (pScrn->bitsPerPixel) {
+ case 8: depth = 0x000000ff; break;
+ case 16: depth = 0x0000ffff; break;
+ case 24: depth = 0x00ffffff; break;
+ case 32: depth = 0xffffffff; break;
+ default: depth = 0x00000000; break;
+ }
/* FIXME: Copy XAAPaintWindow() and use REGION_TRANSLATE() */
/* FIXME: Only initialize the back and depth buffers for contexts
@@ -370,16 +379,24 @@ static void R128DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index)
(*pR128->accel->SetupForSolidFill)(pScrn, 0, GXcopy, -1);
for (; nbox; nbox--, pbox++) {
(*pR128->accel->SubsequentSolidFillRect)(pScrn,
+ pbox->x1 + pR128->fbX,
+ pbox->y1 + pR128->fbY,
+ pbox->x2 - pbox->x1,
+ pbox->y2 - pbox->y1);
+ (*pR128->accel->SubsequentSolidFillRect)(pScrn,
pbox->x1 + pR128->backX,
pbox->y1 + pR128->backY,
pbox->x2 - pbox->x1,
pbox->y2 - pbox->y1);
+ }
+
+ (*pR128->accel->SetupForSolidFill)(pScrn, depth, GXcopy, -1);
+ for (; nbox; nbox--, pbox++)
(*pR128->accel->SubsequentSolidFillRect)(pScrn,
pbox->x1 + pR128->depthX,
pbox->y1 + pR128->depthY,
pbox->x2 - pbox->x1,
pbox->y2 - pbox->y1);
- }
pR128->accel->NeedToSync = TRUE;
#endif
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/agpsupport.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/agpsupport.c
index d60edc2ed..e5793d81e 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/agpsupport.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/agpsupport.c
@@ -256,6 +256,7 @@ int drm_agp_free(struct inode *inode, struct file *filp, unsigned int cmd,
if (!(entry = drm_agp_lookup_entry(dev, request.handle)))
return -EINVAL;
#if 0
+#if 0
if (entry->bound) drm_unbind_agp(entry->memory);
#endif
if(entry->prev) entry->prev->next = entry->next;
@@ -264,6 +265,12 @@ int drm_agp_free(struct inode *inode, struct file *filp, unsigned int cmd,
(entry->prev == NULL)) {
dev->agp->memory = NULL;
}
+#else
+ if (entry->bound) drm_unbind_agp(entry->memory);
+ if (entry->prev) entry->prev->next = entry->next;
+ else dev->agp->memory = entry->next;
+ if (entry->next) entry->next->prev = entry->prev;
+#endif
drm_free_agp(entry->memory, entry->pages);
drm_free(entry, sizeof(*entry), DRM_MEM_AGPLISTS);
return 0;