drm-tests: use new buffer creation flags
CL:758618 adds GBM_BO_USE_SW_{READ,WRITE}_{OFTEN,RARELY} flags.
This is distinct from GBM_BO_USE_LINEAR -- which means the buffer
must be dma-buf mmap-able. Let's use GBM_BO_USE_LINEAR with dumb
buffers as well.
The new flags just mean the buffer will seem linear when
accessed by gbm_bo_map().
Let's modify our various tests to reflect this distinction.
BUG=chromium:777706
TEST=graphics_Drm.bvt passes on Kevin
CQ-DEPEND=CL:758618
Change-Id: I14dd4ccf12dada1f5464a2323fdd848f8ac0a8b8
Reviewed-on: https://chromium-review.googlesource.com/759325
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Joe Kniss <djmk@google.com>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
diff --git a/mmap_test.c b/mmap_test.c
index 3ac027e..cf16dfa 100644
--- a/mmap_test.c
+++ b/mmap_test.c
@@ -208,19 +208,22 @@
}
int c;
- uint32_t flags = GBM_BO_USE_SCANOUT | GBM_BO_USE_LINEAR;
+ uint32_t flags = GBM_BO_USE_SCANOUT;
while ((c = getopt_long(argc, argv, "bgdvsh", longopts, NULL)) != -1) {
switch (c) {
case 'b':
ctx.mapper = bs_mapper_dma_buf_new();
+ flags |= GBM_BO_USE_LINEAR;
printf("started dma-buf mmap.\n");
break;
case 'g':
ctx.mapper = bs_mapper_gem_new();
+ flags |= GBM_BO_USE_SW_READ_OFTEN | GBM_BO_USE_SW_WRITE_OFTEN;
printf("started GEM map.\n");
break;
case 'd':
ctx.mapper = bs_mapper_dumb_new(gbm_device_get_fd(gbm));
+ flags |= GBM_BO_USE_LINEAR;
printf("started dumb map.\n");
break;
case 'v':