From 351d3c59f2a1153047d45fcdb23cc487f231683d Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Thu, 25 Oct 2012 14:11:17 +0200 Subject: [PATCH] nv50,nvc0: fix 2d engine stencil-only copies --- src/gallium/drivers/nv50/nv50_2d.xml.h | 59 +++++++++++++++++-------- src/gallium/drivers/nv50/nv50_surface.c | 4 +- src/gallium/drivers/nvc0/nvc0_2d.xml.h | 4 +- src/gallium/drivers/nvc0/nvc0_surface.c | 3 +- 4 files changed, 48 insertions(+), 22 deletions(-) diff --git a/src/gallium/drivers/nv50/nv50_2d.xml.h b/src/gallium/drivers/nv50/nv50_2d.xml.h index bc9bcf7839e..dfbef2c6a30 100644 --- a/src/gallium/drivers/nv50/nv50_2d.xml.h +++ b/src/gallium/drivers/nv50/nv50_2d.xml.h @@ -1,5 +1,5 @@ -#ifndef NV50_2D_XML -#define NV50_2D_XML +#ifndef RNNDB_NV50_2D_XML +#define RNNDB_NV50_2D_XML /* Autogenerated file, DO NOT EDIT manually! @@ -8,14 +8,14 @@ http://0x04.net/cgit/index.cgi/rules-ng-ng git clone git://0x04.net/rules-ng-ng The rules-ng-ng source files this header was generated from are: -- nv50_2d.xml ( 9799 bytes, from 2010-12-28 17:17:11) -- copyright.xml ( 6452 bytes, from 2010-12-15 23:45:18) -- nv_object.xml ( 11898 bytes, from 2010-12-28 17:17:11) -- nvchipsets.xml ( 3074 bytes, from 2010-12-15 23:45:18) -- nv_defs.xml ( 4437 bytes, from 2010-12-15 23:45:18) -- nv50_defs.xml ( 4487 bytes, from 2010-12-15 23:45:18) - -Copyright (C) 2006-2010 by the following authors: +- rnndb/nv50_2d.xml ( 11113 bytes, from 2011-07-09 13:43:58) +- ./rnndb/copyright.xml ( 6452 bytes, from 2011-07-09 13:43:58) +- ./rnndb/nv_object.xml ( 12912 bytes, from 2012-07-12 09:41:09) +- ./rnndb/nvchipsets.xml ( 3736 bytes, from 2012-07-12 09:41:09) +- ./rnndb/nv_defs.xml ( 4437 bytes, from 2011-07-09 13:43:58) +- ./rnndb/nv50_defs.xml ( 5468 bytes, from 2011-07-09 13:43:58) + +Copyright (C) 2006-2011 by the following authors: - Artur Huillet (ahuillet) - Ben Skeggs (darktama, darktama_) - B. R. (koala_br) @@ -106,6 +106,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define NV50_2D_UNK228 0x00000228 +#define NVC0_2D_UNK228 0x00000228 + #define NV50_2D_SRC_FORMAT 0x00000230 #define NV50_2D_SRC_LINEAR 0x00000234 @@ -116,6 +118,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define NV50_2D_SRC_LAYER 0x00000240 +#define NVC0_2D_UNK0240 0x00000240 + #define NV50_2D_SRC_PITCH 0x00000244 #define NV50_2D_SRC_PITCH__MAX 0x00040000 @@ -170,23 +174,33 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define NV50_2D_ROP 0x000002a0 #define NV50_2D_BETA1 0x000002a4 +#define NV50_2D_BETA1_BETA1__MASK 0x7f800000 +#define NV50_2D_BETA1_BETA1__SHIFT 23 #define NV50_2D_BETA4 0x000002a8 +#define NV50_2D_BETA4_B__MASK 0x000000ff +#define NV50_2D_BETA4_B__SHIFT 0 +#define NV50_2D_BETA4_G__MASK 0x0000ff00 +#define NV50_2D_BETA4_G__SHIFT 8 +#define NV50_2D_BETA4_R__MASK 0x00ff0000 +#define NV50_2D_BETA4_R__SHIFT 16 +#define NV50_2D_BETA4_A__MASK 0xff000000 +#define NV50_2D_BETA4_A__SHIFT 24 #define NV50_2D_OPERATION 0x000002ac #define NV50_2D_OPERATION_SRCCOPY_AND 0x00000000 #define NV50_2D_OPERATION_ROP_AND 0x00000001 -#define NV50_2D_OPERATION_BLEND_AND 0x00000002 +#define NV50_2D_OPERATION_BLEND 0x00000002 #define NV50_2D_OPERATION_SRCCOPY 0x00000003 -#define NV50_2D_OPERATION_UNK4 0x00000004 +#define NV50_2D_OPERATION_ROP 0x00000004 #define NV50_2D_OPERATION_SRCCOPY_PREMULT 0x00000005 #define NV50_2D_OPERATION_BLEND_PREMULT 0x00000006 -#define NV50_2D_UNK2B0 0x000002b0 -#define NV50_2D_UNK2B0_UNK0__MASK 0x0000003f -#define NV50_2D_UNK2B0_UNK0__SHIFT 0 -#define NV50_2D_UNK2B0_UNK1__MASK 0x00003f00 -#define NV50_2D_UNK2B0_UNK1__SHIFT 8 +#define NV50_2D_PATTERN_OFFSET 0x000002b0 +#define NV50_2D_PATTERN_OFFSET_X__MASK 0x0000003f +#define NV50_2D_PATTERN_OFFSET_X__SHIFT 0 +#define NV50_2D_PATTERN_OFFSET_Y__MASK 0x00003f00 +#define NV50_2D_PATTERN_OFFSET_Y__SHIFT 8 #define NV50_2D_PATTERN_SELECT 0x000002b4 #define NV50_2D_PATTERN_SELECT_MONO_8X8 0x00000000 @@ -194,6 +208,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define NV50_2D_PATTERN_SELECT_MONO_1X64 0x00000002 #define NV50_2D_PATTERN_SELECT_COLOR 0x00000003 +#define NVC0_2D_UNK2DC 0x000002dc + +#define NVC0_2D_UNK2E0 0x000002e0 + #define NV50_2D_PATTERN_COLOR_FORMAT 0x000002e8 #define NV50_2D_PATTERN_COLOR_FORMAT_16BPP 0x00000000 #define NV50_2D_PATTERN_COLOR_FORMAT_15BPP 0x00000001 @@ -201,6 +219,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define NV50_2D_PATTERN_COLOR_FORMAT_8BPP 0x00000003 #define NV50_2D_PATTERN_COLOR_FORMAT_UNK4 0x00000004 #define NV50_2D_PATTERN_COLOR_FORMAT_UNK5 0x00000005 +#define NV50_2D_PATTERN_COLOR_FORMAT_UNK6 0x00000006 #define NV50_2D_PATTERN_MONO_FORMAT 0x000002ec #define NV50_2D_PATTERN_MONO_FORMAT_CGA6 0x00000000 @@ -268,6 +287,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define NV50_2D_PATTERN_Y8_Y3__MASK 0xff000000 #define NV50_2D_PATTERN_Y8_Y3__SHIFT 24 +#define NVC0_2D_DRAW_COLOR_LONG(i0) (0x00000540 + 0x4*(i0)) +#define NVC0_2D_DRAW_COLOR_LONG__ESIZE 0x00000004 +#define NVC0_2D_DRAW_COLOR_LONG__LEN 0x00000004 + #define NV50_2D_DRAW_SHAPE 0x00000580 #define NV50_2D_DRAW_SHAPE_POINTS 0x00000000 #define NV50_2D_DRAW_SHAPE_LINES 0x00000001 @@ -390,4 +413,4 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define NVC0_2D_FIRMWARE__LEN 0x00000020 -#endif /* NV50_2D_XML */ +#endif /* RNNDB_NV50_2D_XML */ diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c index f315a235aef..511ee8fdbec 100644 --- a/src/gallium/drivers/nv50/nv50_surface.c +++ b/src/gallium/drivers/nv50/nv50_surface.c @@ -1072,6 +1072,8 @@ nv50_blit_eng2d(struct nv50_context *nv50, const struct pipe_blit_info *info) } if (mask != 0xffffffff) { + BEGIN_NV04(push, NV50_2D(ROP), 1); + PUSH_DATA (push, 0xca); /* DPSDxax */ BEGIN_NV04(push, NV50_2D(PATTERN_COLOR_FORMAT), 1); PUSH_DATA (push, NV50_2D_PATTERN_COLOR_FORMAT_32BPP); BEGIN_NV04(push, NV50_2D(PATTERN_COLOR(0)), 4); @@ -1080,7 +1082,7 @@ nv50_blit_eng2d(struct nv50_context *nv50, const struct pipe_blit_info *info) PUSH_DATA (push, 0xffffffff); PUSH_DATA (push, 0xffffffff); BEGIN_NV04(push, NV50_2D(OPERATION), 1); - PUSH_DATA (push, NV50_2D_OPERATION_SRCCOPY_PREMULT); + PUSH_DATA (push, NV50_2D_OPERATION_ROP); } if (src->ms_x > dst->ms_x || src->ms_y > dst->ms_y) { diff --git a/src/gallium/drivers/nvc0/nvc0_2d.xml.h b/src/gallium/drivers/nvc0/nvc0_2d.xml.h index aebcd510e8e..93dba340899 100644 --- a/src/gallium/drivers/nvc0/nvc0_2d.xml.h +++ b/src/gallium/drivers/nvc0/nvc0_2d.xml.h @@ -167,9 +167,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define NVC0_2D_OPERATION 0x000002ac #define NVC0_2D_OPERATION_SRCCOPY_AND 0x00000000 #define NVC0_2D_OPERATION_ROP_AND 0x00000001 -#define NVC0_2D_OPERATION_BLEND_AND 0x00000002 +#define NVC0_2D_OPERATION_BLEND 0x00000002 #define NVC0_2D_OPERATION_SRCCOPY 0x00000003 -#define NVC0_2D_OPERATION_UNK4 0x00000004 +#define NVC0_2D_OPERATION_ROP 0x00000004 #define NVC0_2D_OPERATION_SRCCOPY_PREMULT 0x00000005 #define NVC0_2D_OPERATION_BLEND_PREMULT 0x00000006 diff --git a/src/gallium/drivers/nvc0/nvc0_surface.c b/src/gallium/drivers/nvc0/nvc0_surface.c index 4f79020518e..dbd4fa3b794 100644 --- a/src/gallium/drivers/nvc0/nvc0_surface.c +++ b/src/gallium/drivers/nvc0/nvc0_surface.c @@ -964,6 +964,7 @@ nvc0_blit_eng2d(struct nvc0_context *nvc0, const struct pipe_blit_info *info) } if (mask != 0xffffffff) { + IMMED_NVC0(push, NVC0_2D(ROP), 0xca); /* DPSDxax */ IMMED_NVC0(push, NVC0_2D(PATTERN_COLOR_FORMAT), NVC0_2D_PATTERN_COLOR_FORMAT_32BPP); BEGIN_NVC0(push, NVC0_2D(PATTERN_COLOR(0)), 4); @@ -971,7 +972,7 @@ nvc0_blit_eng2d(struct nvc0_context *nvc0, const struct pipe_blit_info *info) PUSH_DATA (push, mask); PUSH_DATA (push, 0xffffffff); PUSH_DATA (push, 0xffffffff); - IMMED_NVC0(push, NVC0_2D(OPERATION), NVC0_2D_OPERATION_SRCCOPY_PREMULT); + IMMED_NVC0(push, NVC0_2D(OPERATION), NVC0_2D_OPERATION_ROP); } if (src->ms_x > dst->ms_x || src->ms_y > dst->ms_y) { -- 2.30.2