[PATCH driver/intel] In sna_pixmap_alloc_gpu() process user selected tiling thru kgem_choose_tiling()

Egbert Eich eich at freedesktop.org
Tue Sep 23 23:18:32 PDT 2014


From: Egbert Eich <eich at suse.de>

In sna_pixmap_alloc_gpu() a different than the default tiling may be picked
by a usage hint. Before passing the tiling to kgem_create_2d() fix it up
by calling kgem_choose_tiling(). This avoids kgem_surface_size() not being able
to find a surface size for the tiling value.

Signed-off-by: Egbert Eich <eich at freedesktop.org>
---
 src/sna/sna_accel.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index ab43831..16726ee 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1618,6 +1618,11 @@ static bool sna_pixmap_alloc_gpu(struct sna *sna,
 	if (pixmap->usage_hint == SNA_CREATE_FB && (sna->flags & SNA_LINEAR_FB) == 0) {
 		flags |= CREATE_SCANOUT;
 		tiling = -I915_TILING_X;
+		tiling = kgem_choose_tiling(&sna->kgem,
+					    tiling,
+					    pixmap->drawable.width,
+					    pixmap->drawable.height,
+					    pixmap->drawable.bitsPerPixel);
 	} else
 		tiling = sna_pixmap_default_tiling(sna, pixmap);
 
-- 
1.8.4.5



More information about the xorg-devel mailing list