From: <mla...@ke...> - 2015-03-20 22:45:55
|
src/nv_accel_common.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) New commits: commit 7319b54291d59e1cd3cbe4f39ea8cc6dc8bf45bc Author: Maarten Lankhorst <de...@mb...> Date: Fri Mar 20 23:24:50 2015 +0100 Simplify nouveau_allocate_surface's pitch calculation. Judging from previous commits all linear buffers should have a 256 byte alignment. diff --git a/src/nv_accel_common.c b/src/nv_accel_common.c index 4484c1c..f0c2d62 100644 --- a/src/nv_accel_common.c +++ b/src/nv_accel_common.c @@ -48,22 +48,15 @@ nouveau_allocate_surface(ScrnInfoPtr scrn, int width, int height, int bpp, if (bpp >= 8) flags |= shared ? NOUVEAU_BO_GART : NOUVEAU_BO_VRAM; + if (scanout && pNv->tiled_scanout) + tiled = TRUE; + if (pNv->Architecture >= NV_TESLA) { - if (scanout) { - if (pNv->tiled_scanout) { - tiled = TRUE; - *pitch = NOUVEAU_ALIGN(width * cpp, 64); - } else { - *pitch = NOUVEAU_ALIGN(width * cpp, 256); - } - } else { - if (bpp >= 8 && !shared) - tiled = TRUE; - *pitch = NOUVEAU_ALIGN(width * cpp, shared ? 256 : 64); - } - } else { - if (scanout && pNv->tiled_scanout) + if (!scanout && bpp >= 8 && !shared) tiled = TRUE; + + *pitch = NOUVEAU_ALIGN(width * cpp, !tiled ? 256 : 64); + } else { *pitch = NOUVEAU_ALIGN(width * cpp, 64); } |