diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2011-12-06 09:21:25 +0100 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2011-12-06 18:22:55 +0100 |
commit | 1736a76246f0a0dab01f5a1066332168d34b2803 (patch) | |
tree | 15fab4184ee8e79fd04f46c97608bfbcd85f0ef7 | |
parent | fb35176958bba2f86d6d466ccb7baadcff806512 (diff) |
vmwgfx: Adapt to the dri state tracker sending depth instead of bpp
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
-rw-r--r-- | vmwgfx/vmwgfx_dri2.c | 14 | ||||
-rw-r--r-- | vmwgfx/vmwgfx_xa_surface.c | 3 |
2 files changed, 12 insertions, 5 deletions
diff --git a/vmwgfx/vmwgfx_dri2.c b/vmwgfx/vmwgfx_dri2.c index bf6e178..1b82ac4 100644 --- a/vmwgfx/vmwgfx_dri2.c +++ b/vmwgfx/vmwgfx_dri2.c @@ -157,10 +157,16 @@ dri2_do_create_buffer(DrawablePtr pDraw, DRI2Buffer2Ptr buffer, unsigned int for case DRI2BufferDepth: depth = (format) ? vmwgfx_z_format_to_depth(format) : pDraw->bitsPerPixel; - srf = xa_surface_create(ms->xat, pDraw->width, pDraw->height, - depth, - xa_type_z, xa_format_unknown, - XA_FLAG_SHARED); + + if (depth == 24) + srf = xa_surface_create(ms->xat, pDraw->width, pDraw->height, + depth, xa_type_zs, xa_format_unknown, + XA_FLAG_SHARED ); + else + srf = xa_surface_create(ms->xat, pDraw->width, pDraw->height, + depth, + xa_type_z, xa_format_unknown, + XA_FLAG_SHARED); if (!srf) return FALSE; diff --git a/vmwgfx/vmwgfx_xa_surface.c b/vmwgfx/vmwgfx_xa_surface.c index 7542413..2a18762 100644 --- a/vmwgfx/vmwgfx_xa_surface.c +++ b/vmwgfx/vmwgfx_xa_surface.c @@ -225,8 +225,9 @@ vmwgfx_choose_accel_format(unsigned int depth) { switch(depth) { case 32: - case 24: return xa_format_a8r8g8b8; + case 24: + return xa_format_x8r8g8b8; case 16: return xa_format_r5g6b5; case 15: |