OSDN Git Service

minigbm: virtio_gpu: set vma->length when mmap.
authorTao Wu <lepton@google.com>
Tue, 13 Mar 2018 01:07:43 +0000 (18:07 -0700)
committerchrome-bot <chrome-bot@chromium.org>
Tue, 13 Mar 2018 14:36:49 +0000 (07:36 -0700)
Othewise bo_unmap won't work. Also add a ifdef guard for PAGE_SIZE
to make it also compile under ARC++.

BUG=b:70179880
TEST=Run /usr/local/autotest/bin/screenshot.py with qemu+virgl
TEST=Run Android App under ARC++ with qemu+virgl

Change-Id: I586446c56da091dd82d9bc9c1010d9b4ee4d92ee
Reviewed-on: https://chromium-review.googlesource.com/959527
Commit-Ready: Lepton Wu <lepton@chromium.org>
Tested-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
virtio_virgl.c

index b33677b..d5429bd 100644 (file)
@@ -19,7 +19,9 @@
 #include "util.h"
 #include "virgl_hw.h"
 
+#ifndef PAGE_SIZE
 #define PAGE_SIZE 0x1000
+#endif
 #define PIPE_TEXTURE_2D 2
 
 static const uint32_t render_target_formats[] = { DRM_FORMAT_ABGR8888, DRM_FORMAT_ARGB8888,
@@ -139,6 +141,7 @@ static void *virgl_bo_map(struct bo *bo, struct vma *vma, size_t plane, uint32_t
                return MAP_FAILED;
        }
 
+       vma->length = bo->total_size;
        return mmap(0, bo->total_size, drv_get_prot(map_flags), MAP_SHARED, bo->drv->fd,
                    gem_map.offset);
 }