Christoph Bumiller
2009-Dec-30 17:28 UTC
[PATCH] nv50: check drawable.bitsPerPixel instead of depth to get format
--- src/nv50_exa.c | 6 +++--- src/nv50_xv.c | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/nv50_exa.c b/src/nv50_exa.c index 1f5a4ac..bddc463 100644 --- a/src/nv50_exa.c +++ b/src/nv50_exa.c @@ -77,7 +77,7 @@ NV50EXA2DSurfaceFormat(PixmapPtr ppix, uint32_t *fmt) { NV50EXA_LOCALS(ppix); - switch (ppix->drawable.depth) { + switch (ppix->drawable.bitsPerPixel) { case 8 : *fmt = NV50_2D_SRC_FORMAT_R8_UNORM; break; case 15: *fmt = NV50_2D_SRC_FORMAT_X1R5G5B5_UNORM; break; case 16: *fmt = NV50_2D_SRC_FORMAT_R5G6B5_UNORM; break; @@ -86,7 +86,7 @@ NV50EXA2DSurfaceFormat(PixmapPtr ppix, uint32_t *fmt) case 32: *fmt = NV50_2D_SRC_FORMAT_A8R8G8B8_UNORM; break; default: NOUVEAU_FALLBACK("Unknown surface format for bpp=%d\n", - ppix->drawable.depth); + ppix->drawable.bitsPerPixel); return FALSE; } @@ -179,7 +179,7 @@ NV50EXASetROP(PixmapPtr pdpix, int alu, Pixel planemask) } BEGIN_RING(chan, eng2d, NV50_2D_PATTERN_FORMAT, 2); - switch (pdpix->drawable.depth) { + switch (pdpix->drawable.bitsPerPixel) { case 8: OUT_RING (chan, 3); break; case 15: OUT_RING (chan, 1); break; case 16: OUT_RING (chan, 0); break; diff --git a/src/nv50_xv.c b/src/nv50_xv.c index b0eccfd..bb9bb43 100644 --- a/src/nv50_xv.c +++ b/src/nv50_xv.c @@ -41,10 +41,11 @@ extern Atom xvSyncToVBlank, xvSetDefaults; static Bool nv50_xv_check_image_put(PixmapPtr ppix) { - switch (ppix->drawable.depth) { + switch (ppix->drawable.bitsPerPixel) { case 32: case 24: case 16: + case 15: break; default: return FALSE; @@ -78,10 +79,11 @@ nv50_xv_state_emit(PixmapPtr ppix, int id, struct nouveau_bo *src, MARK_UNDO(chan); return FALSE; } - switch (ppix->drawable.depth) { + switch (ppix->drawable.bitsPerPixel) { case 32: OUT_RING (chan, NV50TCL_RT_FORMAT_A8R8G8B8_UNORM); break; case 24: OUT_RING (chan, NV50TCL_RT_FORMAT_X8R8G8B8_UNORM); break; case 16: OUT_RING (chan, NV50TCL_RT_FORMAT_R5G6B5_UNORM); break; + case 15: OUT_RING (chan, NV50TCL_RT_FORMAT_X1R5G5B5_UNORM); break; } OUT_RING (chan, bo->tile_mode << 4); OUT_RING (chan, 0); -- 1.6.4.4 --------------010501060201030906090507--