dri2: fix allocation of Z16 depth attachments
PATCH 1/1 dri2: fix allocation of Z16 depth attachments
--- src/nouveau_dri2.c | 4 +++- src/nv_accel_common.c | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-)
src/nouveau_dri2.c +3 -1
@@ -46,6 +46,8 @@ nouveau_dri2_create_buffer(DrawablePtr pDraw, unsigned int attachment, ppix->refcnt++; }else { +/* 'format' is just depth */ +unsigned int depth =NOUVEAU_ALIGN (format,2 );unsigned int usage_hint =NOUVEAU_CREATE_PIXMAP_TILED ; if (attachment == DRI2BufferDepth ||
@@ -55,7 +57,7 @@ nouveau_dri2_create_buffer(DrawablePtr pDraw, unsigned int attachment, usage_hint |=NOUVEAU_CREATE_PIXMAP_SCANOUT ; ppix = pScreen->CreatePixmap (pScreen, pDraw->width, - pDraw->height, pDraw->depth, + pDraw->height, depth, usage_hint); }
src/nv_accel_common.c +2 -2
@@ -71,7 +71,7 @@ nouveau_allocate_surface(ScrnInfoPtr scrn, int width, int height, int bpp, tile_mode =0x00 ;if (usage_hint &NOUVEAU_CREATE_PIXMAP_ZETA ) - tile_flags =0x1100 ;/* S8Z24 */ + tile_flags = (bpp ==16 ) ?0x0100 :0x1100 ;/* Z16 : Z24S8 */ else tile_flags =0xfe00 ;
@@ -90,7 +90,7 @@ nouveau_allocate_surface(ScrnInfoPtr scrn, int width, int height, int bpp, tile_mode =0 ;if (usage_hint &NOUVEAU_CREATE_PIXMAP_ZETA ) - tile_flags =0x22800 ; + tile_flags = (bpp ==16 ) ?0x26c00 :0x22800 ;else if (usage_hint &NOUVEAU_CREATE_PIXMAP_SCANOUT ) tile_flags = (bpp ==16 ?0x7000 :0x7a00 );else
Signature · 1 line
1.7.3.4