Skip to contentSkip to conversation

accel_common: do not initialise the flags twice

PATCH New Emil Velikov 1 participant 2 messages Sep 9, 2014 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 accel_common: do not initialise the flags twice

---
 src/nv_accel_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/nv_accel_common.c +1 -1
index 4484c1c..eebb0ab 100644
@@ -37,7 +37,7 @@ nouveau_allocate_surface(ScrnInfoPtr scrn, int width, int height, int bpp,
 	Bool tiled = (usage_hint & NOUVEAU_CREATE_PIXMAP_TILED);
 	Bool shared = FALSE;
 	union nouveau_bo_config cfg = {};
-	int flags = NOUVEAU_BO_MAP | (bpp >= 8 ? NOUVEAU_BO_VRAM : 0);
+	int flags;
 	int cpp = bpp / 8, ret;
 
 #ifdef NOUVEAU_PIXMAP_SHARING
Signature · 1 line
2.1.0

A message that is not in the archive (sent off-list or not yet received): 1410274052-17794-1-git-send-email-emil.l.velikov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#2 lore raw

PATCH 2/2 accel_common: use scanout variable over checking the usage_hint every time

---
 src/nv_accel_common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
src/nv_accel_common.c +2 -2
index eebb0ab..a2557e0 100644
@@ -91,7 +91,7 @@ nouveau_allocate_surface(ScrnInfoPtr scrn, int width, int height, int bpp,
 
 			if (usage_hint & NOUVEAU_CREATE_PIXMAP_ZETA)
 				cfg.nv50.memtype = (bpp == 16) ? 0x16c : 0x128;
-			else if (usage_hint & NOUVEAU_CREATE_PIXMAP_SCANOUT)
+			else if (scanout)
 				cfg.nv50.memtype = (bpp == 16) ? 0x070 : 0x07a;
 			else
 				cfg.nv50.memtype = 0x070;
@@ -117,7 +117,7 @@ nouveau_allocate_surface(ScrnInfoPtr scrn, int width, int height, int bpp,
 			cfg.nv04.surf_flags |= NV04_BO_ZETA;
 	}
 
-	if (usage_hint & NOUVEAU_CREATE_PIXMAP_SCANOUT)
+	if (scanout)
 		flags |= NOUVEAU_BO_CONTIG;
 
 	ret = nouveau_bo_new(pNv->dev, flags, 0, *pitch * height, &cfg, bo);
Signature · 1 line
2.1.0