From 7050c8da56676b60a602dce9abbdb61a7c4fa61e Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 4 Nov 2013 09:31:05 +0000 Subject: [PATCH] sna: Use the unoptimized pwrite for general buffers When we call kgem_bo_write() we have less control over the allocation of the buffer, and do not ensure it meets the alignment criteria required for the cacheline optimisation. So use the simple pwrite routine to avoid reading beyond the end of the allocation. Reported-and-tested-by: Mark Kettenis Signed-off-by: Chris Wilson --- src/sna/kgem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 264a3799..1217367f 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -482,7 +482,7 @@ bool kgem_bo_write(struct kgem *kgem, struct kgem_bo *bo, assert(length <= bytes(bo)); retry: - if (gem_write(kgem->fd, bo->handle, 0, length, data)) { + if (__gem_write(kgem->fd, bo->handle, 0, length, data)) { int err = errno; assert(err != EINVAL);