summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorBen Skeggs <darktama@iinet.net.au>2006-12-24 00:13:34 +1100
committerBen Skeggs <darktama@iinet.net.au>2006-12-24 00:13:34 +1100
commitf54c725497cac19294e1465413d21a9416d4245f (patch)
tree8f33a5aa02c73898fd5cc3cf294f12860e659758 /src/mesa
parentcb6a400dcd26089101c8a29a4eee198bd7ad9a58 (diff)
nouveau: Modify span routines to use nouveau_renderbuffer instead of driRenderbuffer
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_buffers.c8
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_fifo.c7
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_span.c23
3 files changed, 30 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_buffers.c b/src/mesa/drivers/dri/nouveau/nouveau_buffers.c
index e3e2a8099e..f6a03ecd9c 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_buffers.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_buffers.c
@@ -288,6 +288,12 @@ nouveau_build_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb)
return GL_TRUE;
}
+static void
+nouveauDrawBuffer(GLcontext *ctx, GLenum buffer)
+{
+ nouveau_build_framebuffer(ctx, ctx->DrawBuffer);
+}
+
static struct gl_framebuffer *
nouveauNewFramebuffer(GLcontext *ctx, GLuint name)
{
@@ -341,6 +347,8 @@ nouveauFinishRenderTexture(GLcontext *ctx,
void
nouveauInitBufferFuncs(struct dd_function_table *func)
{
+ func->DrawBuffer = nouveauDrawBuffer;
+
func->NewFramebuffer = nouveauNewFramebuffer;
func->NewRenderbuffer = nouveauNewRenderbuffer;
func->BindFramebuffer = nouveauBindFramebuffer;
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fifo.c b/src/mesa/drivers/dri/nouveau/nouveau_fifo.c
index 0b745e1e74..fcfc0ebe14 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_fifo.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_fifo.c
@@ -77,6 +77,12 @@ void nouveauWaitForIdleLocked(nouveauContextPtr nmesa)
FIRE_RING();
while(RING_AHEAD()>0);
+ /* We can't wait on PGRAPH going idle..
+ * 1) We don't have the regs mapped
+ * 2) PGRAPH may not go idle with multiple channels active
+ * Look into replacing this with a NOTIFY/NOP + wait notifier sequence.
+ */
+#if 0
for(i=0;i<1000000;i++) /* 1 second */
{
switch(nmesa->screen->card->type)
@@ -100,6 +106,7 @@ void nouveauWaitForIdleLocked(nouveauContextPtr nmesa)
return;
DO_USLEEP(1);
}
+#endif
}
void nouveauWaitForIdle(nouveauContextPtr nmesa)
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_span.c b/src/mesa/drivers/dri/nouveau/nouveau_span.c
index 6d99728b85..74dec66afc 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_span.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_span.c
@@ -37,12 +37,21 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define HAVE_HW_STENCIL_SPANS 0
#define HAVE_HW_STENCIL_PIXELS 0
+#define HW_CLIPLOOP() \
+ do { \
+ int _nc = nmesa->numClipRects; \
+ while ( _nc-- ) { \
+ int minx = nmesa->pClipRects[_nc].x1 - nmesa->drawX; \
+ int miny = nmesa->pClipRects[_nc].y1 - nmesa->drawY; \
+ int maxx = nmesa->pClipRects[_nc].x2 - nmesa->drawX; \
+ int maxy = nmesa->pClipRects[_nc].y2 - nmesa->drawY;
+
#define LOCAL_VARS \
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx); \
- __DRIscreenPrivate *sPriv = nmesa->driScreen; \
- __DRIdrawablePrivate *dPriv = nmesa->driDrawable; \
- driRenderbuffer *drb = (driRenderbuffer *) rb; \
- GLuint height = dPriv->h; \
+ nouveau_renderbuffer *nrb = (nouveau_renderbuffer *)rb; \
+ GLuint height = nrb->mesa.Height; \
+ GLubyte *map = (GLubyte *)(nrb->map ? nrb->map : nrb->mem->map) + \
+ (nmesa->drawY * nrb->pitch) + (nmesa->drawX * nrb->cpp); \
GLuint p; \
(void) p;
@@ -64,8 +73,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define TAG(x) nouveau##x##_RGB565
#define TAG2(x,y) nouveau##x##_RGB565##y
-#define GET_PTR(X,Y) (sPriv->pFB + drb->flippedOffset \
- + ((dPriv->y + (Y)) * drb->flippedPitch + (dPriv->x + (X))) * drb->cpp)
+#define GET_PTR(X,Y) (map + (Y)*nrb->pitch + (X)*nrb->cpp)
#include "spantmp2.h"
@@ -75,8 +83,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define TAG(x) nouveau##x##_ARGB8888
#define TAG2(x,y) nouveau##x##_ARGB8888##y
-#define GET_PTR(X,Y) (sPriv->pFB + drb->flippedOffset \
- + ((dPriv->y + (Y)) * drb->flippedPitch + (dPriv->x + (X))) * drb->cpp)
+#define GET_PTR(X,Y) (map + (Y)*nrb->pitch + (X)*nrb->cpp)
#include "spantmp2.h"
static void