Permalink
Browse files

nv04-nv40: always submit rect colour with each rect

METHOD_CNT from PGRAPH in some cases where PGRAPH decides that it can't
possibly remember 4 bytes of context...

Could've dealt with this by resubmitting all relevant state from a flush
callback like we did with the old libdrm, but, only this single method
appears to get forgotten, so this way seems nicer.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information...
1 parent 0c78508 commit 6acbb9046cebf73752161d13c0abc83da77d2bc8 @skeggsb committed Apr 13, 2012
Showing with 5 additions and 3 deletions.
  1. +4 −3 src/nv04_exa.c
  2. +1 −0 src/nv_type.h
View
7 src/nv04_exa.c
@@ -126,15 +126,14 @@ NV04EXAPrepareSolid(PixmapPtr ppix, int alu, Pixel planemask, Pixel fg)
NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
BEGIN_NV04(push, NV04_RECT(COLOR_FORMAT), 1);
PUSH_DATA (push, rect_fmt);
- BEGIN_NV04(push, NV04_RECT(COLOR1_A), 1);
- PUSH_DATA (push, fg);
nouveau_pushbuf_bufctx(push, pNv->bufctx);
if (nouveau_pushbuf_validate(push)) {
nouveau_pushbuf_bufctx(push, NULL);
return FALSE;
}
+ pNv->fg_colour = fg;
return TRUE;
}
@@ -147,9 +146,11 @@ NV04EXASolid (PixmapPtr pPixmap, int x, int y, int x2, int y2)
int w = x2 - x;
int h = y2 - y;
- if (!PUSH_SPACE(push, 3))
+ if (!PUSH_SPACE(push, 5))
return;
+ BEGIN_NV04(push, NV04_RECT(COLOR1_A), 1);
+ PUSH_DATA (push, pNv->fg_colour);
BEGIN_NV04(push, NV04_RECT(UNCLIPPED_RECTANGLE_POINT(0)), 2);
PUSH_DATA (push, (x << 16) | y);
PUSH_DATA (push, (w << 16) | h);
View
1 src/nv_type.h
@@ -109,6 +109,7 @@ typedef struct _NVRec {
/* Acceleration context */
PixmapPtr pspix, pmpix, pdpix;
PicturePtr pspict, pmpict;
+ Pixel fg_colour;
} NVRec;
#define NVPTR(p) ((NVPtr)((p)->driverPrivate))

0 comments on commit 6acbb90

Please sign in to comment.