nouveau: nv10: create objects needed to clear buffer
authorPatrice Mandin <pmandin@caramail.com>
Thu, 16 Aug 2007 18:53:29 +0000 (20:53 +0200)
committerPatrice Mandin <pmandin@caramail.com>
Thu, 16 Aug 2007 18:53:29 +0000 (20:53 +0200)
src/mesa/drivers/dri/nouveau/nouveau_object.c
src/mesa/drivers/dri/nouveau/nouveau_object.h

index aff6954f066a5a22bddb959e8a094127fd7119f6..4169530be672af80b612f7b02473772417a56dad 100644 (file)
@@ -43,6 +43,11 @@ void nouveauObjectInit(nouveauContextPtr nmesa)
        } else {
                nouveauCreateContextObject(nmesa, NvImageBlit, NV_IMAGE_BLIT);
        }
+       if ((nmesa->screen->card->type>=NV_10) && (nmesa->screen->card->type<NV_20)) {
+               nouveauCreateContextObject(nmesa, NvGdiRectText, NV04_GDI_RECTANGLE_TEXT);
+               nouveauCreateContextObject(nmesa, NvRasterOp, NV03_PRIMITIVE_RASTER_OP);
+               nouveauCreateContextObject(nmesa, NvPattern, NV04_IMAGE_PATTERN);
+       }
        nouveauCreateContextObject(nmesa, NvMemFormat, NV_MEMORY_TO_MEMORY_FORMAT);
 
        nouveauObjectOnSubchannel(nmesa, NvSubCtxSurf2D, NvCtxSurf2D);
@@ -56,6 +61,34 @@ void nouveauObjectInit(nouveauContextPtr nmesa)
        BEGIN_RING_SIZE(NvSubImageBlit, NV10_IMAGE_BLIT_SET_OPERATION, 1);
        OUT_RING(3); /* SRCCOPY */
 
+       if ((nmesa->screen->card->type>=NV_10) && (nmesa->screen->card->type<NV_20)) {
+               nouveauObjectOnSubchannel(nmesa, NvSubPattern, NvPattern);
+
+               BEGIN_RING_SIZE(NvSubPattern, NV04_IMAGE_PATTERN_COLOR_FORMAT, 4);
+               OUT_RING(1);    /* A16R5G6B5 */
+               OUT_RING(1);    /* little endian */
+               OUT_RING(0);    /* 8x8 */
+               OUT_RING(1);    /* monochrome */
+
+               nouveauObjectOnSubchannel(nmesa, NvSubRasterOp, NvRasterOp);
+
+               BEGIN_RING_SIZE(NvSubRasterOp, NV03_PRIMITIVE_RASTER_OP_DMA_NOTIFY, 1);
+               OUT_RING(NvDmaFB);
+
+               nouveauObjectOnSubchannel(nmesa, NvSubGdiRectText, NvGdiRectText);
+
+               BEGIN_RING_SIZE(NvSubGdiRectText, NV04_GDI_RECTANGLE_TEXT_SET_DMA_NOTIFY, 1);
+               OUT_RING(NvDmaFB);
+               BEGIN_RING_SIZE(NvSubGdiRectText, NV04_GDI_RECTANGLE_TEXT_PATTERN, 2);
+               OUT_RING(NvPattern);
+               OUT_RING(NvRasterOp);
+               BEGIN_RING_SIZE(NvSubGdiRectText, NV04_GDI_RECTANGLE_TEXT_SURFACE, 1);
+               OUT_RING(NvCtxSurf2D);
+               BEGIN_RING_SIZE(NvSubGdiRectText, NV04_GDI_RECTANGLE_TEXT_FORMAT, 2);
+               OUT_RING(1);    /* X1R5G5B5 */
+               OUT_RING(1);    /* little endian */
+       }
+
        nouveauObjectOnSubchannel(nmesa, NvSubMemFormat, NvMemFormat);
 
        nouveauObjectOnSubchannel(nmesa, NvSub3D, Nv3D);
index 730738ad34b8de8cf68ac693a3ee3bfbf3f9ed54..10859de1190742bd98708b952535ae5d98ba90ad 100644 (file)
@@ -11,6 +11,9 @@ enum DMAObjects {
        NvImageBlit             = 0x80000021,
        NvMemFormat             = 0x80000022,
        NvCtxSurf3D             = 0x80000023,
+       NvGdiRectText           = 0x80000024,
+       NvPattern               = 0x80000025,
+       NvRasterOp              = 0x80000026,
        NvDmaFB                 = 0xD0FB0001,
        NvDmaTT                 = 0xD0AA0001,
        NvSyncNotify            = 0xD0000001,
@@ -22,6 +25,9 @@ enum DMASubchannel {
        NvSubImageBlit  = 1,
        NvSubMemFormat  = 2,
        NvSubCtxSurf3D  = 3,
+       NvSubGdiRectText= 4,
+       NvSubPattern    = 5,
+       NvSubRasterOp   = 6,
        NvSub3D         = 7,
 };