summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaarten Lankhorst <dev@mblankhorst.nl>2015-03-20 23:24:50 +0100
committerMaarten Lankhorst <dev@mblankhorst.nl>2015-03-20 23:44:35 +0100
commit7319b54291d59e1cd3cbe4f39ea8cc6dc8bf45bc (patch)
tree97691bb895962d636dafdc5b8ce91d4c09d37477
parent91e51a7571e6e8cb9338fc168f817f56438b1901 (diff)
Simplify nouveau_allocate_surface's pitch calculation.
Judging from previous commits all linear buffers should have a 256 byte alignment.
-rw-r--r--src/nv_accel_common.c21
1 files changed, 7 insertions, 14 deletions
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);
}