drv_add_combinations(drv, texture_source_formats, ARRAY_SIZE(texture_source_formats),
&metadata, BO_USE_TEXTURE_MASK);
+ /* Android CTS tests require this. */
+ drv_add_combination(drv, DRM_FORMAT_BGR888, &metadata, BO_USE_SW_MASK);
+
/* Linear formats supported by display. */
drv_modify_combination(drv, DRM_FORMAT_ARGB8888, &metadata, BO_USE_CURSOR | BO_USE_SCANOUT);
drv_modify_combination(drv, DRM_FORMAT_XRGB8888, &metadata, BO_USE_CURSOR | BO_USE_SCANOUT);
/* YUV formats for camera and display. */
drv_modify_combination(drv, DRM_FORMAT_NV12, &metadata,
- BO_USE_CAMERA_READ | BO_USE_CAMERA_WRITE | BO_USE_SCANOUT);
+ BO_USE_CAMERA_READ | BO_USE_CAMERA_WRITE | BO_USE_SCANOUT |
+ BO_USE_HW_VIDEO_DECODER);
drv_modify_combination(drv, DRM_FORMAT_NV21, &metadata, BO_USE_SCANOUT);
return dri_bo_create(bo, width, height, format, use_flags);
stride = drv_stride_from_format(format, width, 0);
- if (format == DRM_FORMAT_YVU420_ANDROID)
- stride = ALIGN(stride, 128);
- else
- stride = ALIGN(stride, 64);
+ stride = ALIGN(stride, 256);
drv_bo_from_format(bo, stride, height, format);
gem_create.in.alignment = 256;
gem_create.in.domain_flags = 0;
- if (use_flags & (BO_USE_LINEAR | BO_USE_SW))
+ if (use_flags & (BO_USE_LINEAR | BO_USE_SW_MASK))
gem_create.in.domain_flags |= AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED;
- if (use_flags & (BO_USE_SCANOUT | BO_USE_CURSOR)) {
- /* TODO(dbehr) do not use VRAM after we enable display VM */
- gem_create.in.domains = AMDGPU_GEM_DOMAIN_VRAM;
- } else {
- gem_create.in.domains = AMDGPU_GEM_DOMAIN_GTT;
- if (!(use_flags & BO_USE_SW_READ_OFTEN))
- gem_create.in.domain_flags |= AMDGPU_GEM_CREATE_CPU_GTT_USWC;
- }
+ gem_create.in.domains = AMDGPU_GEM_DOMAIN_GTT;
+ if (!(use_flags & (BO_USE_SW_READ_OFTEN | BO_USE_SCANOUT)))
+ gem_create.in.domain_flags |= AMDGPU_GEM_CREATE_CPU_GTT_USWC;
/* If drm_version >= 21 everything exposes explicit synchronization primitives
and chromeos/arc++ will use them. Disable implicit synchronization. */