drm-tests: atomictest: use minigbm better
We use the GBM_BO_USE_SW_WRITE_RARELY flag, which is a holdever
from Android which Android doesn't even use anymore.
Ideally, we'd go to a modifier based creation method. Stop using
these deprecated flags and do the simple thing: linear buffers.
BUG=b:175734754
TEST=atomictest, CQ will test
Change-Id: I8a36cd8810df33304f3a32b291b638f2a85985b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/drm-tests/+/2706098
Reviewed-by: Ilja H. Friedel <ihf@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Ilja H. Friedel <ihf@chromium.org>
Tested-by: Ilja H. Friedel <ihf@chromium.org>
diff --git a/atomictest.c b/atomictest.c
index 6e1bc77..aee52dd 100644
--- a/atomictest.c
+++ b/atomictest.c
@@ -440,7 +440,7 @@
CHECK_RESULT(remove_plane_fb(ctx, plane));
uint32_t flags = (plane->type.value == DRM_PLANE_TYPE_CURSOR) ? GBM_BO_USE_CURSOR
: GBM_BO_USE_SCANOUT;
- flags |= GBM_BO_USE_SW_WRITE_RARELY;
+ flags |= GBM_BO_USE_LINEAR;
if (ctx->modifier != DRM_FORMAT_MOD_INVALID) {
plane->bo = gbm_bo_create_with_modifiers(
gbm, plane->crtc_w.value, plane->crtc_h.value,
@@ -497,8 +497,9 @@
for (uint32_t format_idx = 0; format_idx < plane->drm_plane.count_formats;
format_idx++) {
- if (!gbm_device_is_format_supported(
- gbm, plane->drm_plane.formats[format_idx], GBM_BO_USE_SCANOUT))
+ if (!gbm_device_is_format_supported(gbm,
+ plane->drm_plane.formats[format_idx],
+ GBM_BO_USE_SCANOUT | GBM_BO_USE_LINEAR))
continue;
if (!init_plane(ctx, plane, plane->drm_plane.formats[format_idx], x, y, w,
@@ -652,6 +653,8 @@
for (uint32_t i = 0; i < plane->drm_plane.count_formats; i++) {
flags = (plane->type.value == DRM_PLANE_TYPE_CURSOR) ? GBM_BO_USE_CURSOR
: GBM_BO_USE_SCANOUT;
+
+ flags |= GBM_BO_USE_LINEAR;
if (!gbm_device_is_format_supported(gbm, plane->drm_plane.formats[i], flags))
continue;