diff options
author | Dave Airlie <[email protected]> | 2007-10-12 11:02:46 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2007-10-12 11:02:46 +1000 |
commit | bf805d3bf5bf191aa669b6155316a78917cf9b0e (patch) | |
tree | d76223fb22381485f7ecc8f6c7d026dcd88d80f3 /src/mesa/drivers/dri/nouveau/nouveau_context.c | |
parent | 9e06cf00cfb24528653913fc90eded4d370c1149 (diff) | |
parent | 72c888869f4e5074e57c349ec356798959be791e (diff) |
Merge branch 'master' into i915-superioctl
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.c')
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_context.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index f36483a3d49..a8569a9f153 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -378,3 +378,39 @@ void nouveauCopySubBuffer(__DRIdrawablePrivate *dPriv, { } +void nouveauClearBuffer(GLcontext *ctx, nouveau_renderbuffer_t *buffer, + int fill, int mask) +{ + nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx); + int dimensions; + + if (!buffer) { + return; + } + + /* FIXME: only support 32 bits atm */ + + /* Surface that we will work on */ + nouveauObjectOnSubchannel(nmesa, NvSubCtxSurf2D, NvCtxSurf2D); + + BEGIN_RING_SIZE(NvSubCtxSurf2D, NV10_CONTEXT_SURFACES_2D_FORMAT, 4); + OUT_RING(0x0b); /* Y32 color format */ + OUT_RING((buffer->pitch<<16)|buffer->pitch); + OUT_RING(buffer->offset); + OUT_RING(buffer->offset); + + /* Now clear a rectangle */ + dimensions = ((buffer->mesa.Height)<<16) | (buffer->mesa.Width); + + nouveauObjectOnSubchannel(nmesa, NvSubGdiRectText, NvGdiRectText); + + BEGIN_RING_SIZE(NvSubGdiRectText, NV04_GDI_RECTANGLE_TEXT_OPERATION, 1); + OUT_RING(3); /* SRCCOPY */ + + BEGIN_RING_SIZE(NvSubGdiRectText, NV04_GDI_RECTANGLE_TEXT_BLOCK_LEVEL1_TL, 5); + OUT_RING(0); /* top left */ + OUT_RING(dimensions); /* bottom right */ + OUT_RING(fill); + OUT_RING(0); /* top left */ + OUT_RING(dimensions); /* bottom right */ +} |