minigbm: Align BO tile size for llvmpipe on dumb driver
Mesa's llvmpipe software renderer generates instructions that require memory to be aligned properly, otherwise it will crash with general protection exception. To support crosvm on headless VM with vkms we'd like to always align memory properly on dumb driver. BUG=b:239110721 TEST=Run betty-arc-r on headless VM with vkms enabled Change-Id: I4b119f450cbb9b36d0d35d37be9ca97102924963 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/4134929 Tested-by: Yi Xie <yixie@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Commit-Queue: Yi Xie <yixie@chromium.org>
This commit is contained in:
parent
8d3d4eb347
commit
464fee5671
3 changed files with 9 additions and 5 deletions
|
|
@ -353,6 +353,9 @@ int drv_dumb_bo_create_ex(struct bo *bo, uint32_t width, uint32_t height, uint32
|
|||
DIV_ROUND_UP(aligned_width * layout_from_format(format)->bytes_per_pixel[0], 4);
|
||||
create_dumb.bpp = 32;
|
||||
} else {
|
||||
/* Align for llvmpipe 64-byte tile size for dumb_driver */
|
||||
aligned_width = ALIGN(aligned_width, MESA_LLVMPIPE_TILE_SIZE);
|
||||
aligned_height = ALIGN(aligned_height, MESA_LLVMPIPE_TILE_SIZE);
|
||||
create_dumb.bpp = layout_from_format(format)->bytes_per_pixel[0] * 8;
|
||||
}
|
||||
create_dumb.width = aligned_width;
|
||||
|
|
|
|||
|
|
@ -125,6 +125,12 @@ struct backend {
|
|||
#endif
|
||||
|
||||
#define LINEAR_METADATA (struct format_metadata) { 1, 0, DRM_FORMAT_MOD_LINEAR }
|
||||
|
||||
#define MESA_LLVMPIPE_MAX_TEXTURE_2D_LEVELS 15
|
||||
#define MESA_LLVMPIPE_MAX_TEXTURE_2D_SIZE (1 << (MESA_LLVMPIPE_MAX_TEXTURE_2D_LEVELS - 1))
|
||||
#define MESA_LLVMPIPE_TILE_ORDER 6
|
||||
#define MESA_LLVMPIPE_TILE_SIZE (1 << MESA_LLVMPIPE_TILE_ORDER)
|
||||
|
||||
// clang-format on
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -22,11 +22,6 @@
|
|||
|
||||
#define PIPE_TEXTURE_2D 2
|
||||
|
||||
#define MESA_LLVMPIPE_MAX_TEXTURE_2D_LEVELS 15
|
||||
#define MESA_LLVMPIPE_MAX_TEXTURE_2D_SIZE (1 << (MESA_LLVMPIPE_MAX_TEXTURE_2D_LEVELS - 1))
|
||||
#define MESA_LLVMPIPE_TILE_ORDER 6
|
||||
#define MESA_LLVMPIPE_TILE_SIZE (1 << MESA_LLVMPIPE_TILE_ORDER)
|
||||
|
||||
// This comes from a combination of SwiftShader's VkPhysicalDeviceLimits::maxFramebufferWidth and
|
||||
// VkPhysicalDeviceLimits::maxImageDimension2D (see https://crrev.com/c/1917130).
|
||||
#define ANGLE_ON_SWIFTSHADER_MAX_TEXTURE_2D_SIZE 8192
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue