Revert^2 "Merge upstream-main into main"

This reverts commit b7a9a2b7d5.

Reason for revert: Crash resolved by Ieb07b5bbc206f07f69e4afba921149f49d6fe8c4
Bug: 349870098

Change-Id: I49848f6e7311c1f44e6c988cb42107ed79da3a6b
This commit is contained in:
Jean-François Thibert 2024-07-03 18:21:13 +00:00 committed by Gerrit Code Review
parent b7a9a2b7d5
commit fd19358a25
16 changed files with 232 additions and 86 deletions

View file

@ -52,6 +52,11 @@ static const uint32_t texture_source_formats[] = {
DRM_FORMAT_ABGR2101010, DRM_FORMAT_ABGR16161616F
};
static const uint32_t depth_stencil_formats[] = {
DRM_FORMAT_DEPTH16, DRM_FORMAT_DEPTH24, DRM_FORMAT_DEPTH24_STENCIL8,
DRM_FORMAT_DEPTH32, DRM_FORMAT_DEPTH32_STENCIL8
};
extern struct virtgpu_param params[];
struct virgl_blob_metadata_cache {
@ -108,6 +113,16 @@ static uint32_t translate_format(uint32_t drm_fourcc)
case DRM_FORMAT_YVU420:
case DRM_FORMAT_YVU420_ANDROID:
return VIRGL_FORMAT_YV12;
case DRM_FORMAT_DEPTH16:
return VIRGL_FORMAT_Z16_UNORM;
case DRM_FORMAT_DEPTH24:
return VIRGL_FORMAT_Z24X8_UNORM;
case DRM_FORMAT_DEPTH24_STENCIL8:
return VIRGL_FORMAT_Z24_UNORM_S8_UINT;
case DRM_FORMAT_DEPTH32:
return VIRGL_FORMAT_Z32_FLOAT;
case DRM_FORMAT_DEPTH32_STENCIL8:
return VIRGL_FORMAT_Z32_FLOAT_S8X24_UINT;
default:
drv_loge("Unhandled format:%d\n", drm_fourcc);
return 0;
@ -639,6 +654,9 @@ static int virgl_init(struct driver *drv)
virgl_add_combinations(drv, texture_source_formats,
ARRAY_SIZE(texture_source_formats), &LINEAR_METADATA,
BO_USE_TEXTURE_MASK);
virgl_add_combinations(drv, depth_stencil_formats,
ARRAY_SIZE(depth_stencil_formats), &LINEAR_METADATA,
BO_USE_RENDER_MASK | BO_USE_TEXTURE_MASK);
/* NV12 with scanout must flow through virgl_add_combination, so that the native
* support is checked and scanout use_flag can be conditionally stripped. */
virgl_add_combination(drv, DRM_FORMAT_NV12, &LINEAR_METADATA,