diff options
author | Michel Dänzer <daenzer@vmware.com> | 2009-08-27 20:29:32 +0200 |
---|---|---|
committer | Michel Dänzer <daenzer@vmware.com> | 2009-08-27 20:29:32 +0200 |
commit | 416ee3c53eeb1664784f224a42e293e5fed783bc (patch) | |
tree | 458f5bcddf20d94d5d1a437d0e3a74b64768b2e3 /src/gallium/state_trackers/xorg/xorg_dri2.c | |
parent | bfbfcdd7036add7121eb728daad6131fd77304d0 (diff) |
st/xorg: Set shared usage of pixmaps for use via DRI2.
Also allow pixmaps to have both the shared and displayed usage flags, as is
the case for the screen pixmap now.
Diffstat (limited to 'src/gallium/state_trackers/xorg/xorg_dri2.c')
-rw-r--r-- | src/gallium/state_trackers/xorg/xorg_dri2.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gallium/state_trackers/xorg/xorg_dri2.c b/src/gallium/state_trackers/xorg/xorg_dri2.c index 111024692e..1a4677b50e 100644 --- a/src/gallium/state_trackers/xorg/xorg_dri2.c +++ b/src/gallium/state_trackers/xorg/xorg_dri2.c @@ -92,7 +92,6 @@ driCreateBuffers(DrawablePtr pDraw, unsigned int *attachments, int count) else pPixmap = (*pScreen->GetWindowPixmap)((WindowPtr) pDraw); pPixmap->refcnt++; - tex = xorg_exa_get_texture(pPixmap); } else if (attachments[i] == DRI2BufferStencil) { pipe_texture_reference(&tex, depth); } else if (attachments[i] == DRI2BufferDepth) { @@ -110,19 +109,24 @@ driCreateBuffers(DrawablePtr pDraw, unsigned int *attachments, int count) template.height[0] = pDraw->height; template.depth[0] = 1; template.last_level = 0; - template.tex_usage = PIPE_TEXTURE_USAGE_DEPTH_STENCIL; + template.tex_usage = PIPE_TEXTURE_USAGE_DEPTH_STENCIL | + PIPE_TEXTURE_USAGE_DISPLAY_TARGET; tex = ms->screen->texture_create(ms->screen, &template); depth = tex; } else if (attachments[i] == DRI2BufferFakeFrontLeft && pDraw->type == DRAWABLE_PIXMAP) { pPixmap = (PixmapPtr) pDraw; pPixmap->refcnt++; - tex = xorg_exa_get_texture(pPixmap); } else { pPixmap = (*pScreen->CreatePixmap)(pScreen, pDraw->width, pDraw->height, pDraw->depth, 0); + } + + if (pPixmap) { + xorg_exa_set_shared_usage(pPixmap); + pScreen->ModifyPixmapHeader(pPixmap, 0, 0, 0, 0, 0, NULL); tex = xorg_exa_get_texture(pPixmap); } |