mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
pan/kmod: Reject pre 1.1 panfrost kernel drivers
Panfrost kernel driver has been around long enough to bump the minimal requirement to 1.1. This allows us to get rid of the texture_features hack we had to cope with the absence of DRM_PANFROST_PARAM_TEXTURE_FEATURES[0-3] kernel side. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Suggested-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com> Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
This commit is contained in:
parent
0b5f1b6cb1
commit
73da66706e
2 changed files with 15 additions and 33 deletions
|
|
@ -108,10 +108,6 @@ panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param)
|
|||
/* Native MRT is introduced with v5 */
|
||||
bool has_mrt = (dev->arch >= 5);
|
||||
|
||||
/* Only kernel drivers >= 1.1 can allocate HEAP BOs */
|
||||
bool has_heap = panfrost_device_kmod_version_major(dev) > 1 ||
|
||||
panfrost_device_kmod_version_minor(dev) >= 1;
|
||||
|
||||
switch (param) {
|
||||
case PIPE_CAP_NPOT_TEXTURES:
|
||||
case PIPE_CAP_MIXED_COLOR_DEPTH_BITS:
|
||||
|
|
@ -333,7 +329,7 @@ panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param)
|
|||
return 0;
|
||||
|
||||
case PIPE_CAP_DRAW_INDIRECT:
|
||||
return has_heap;
|
||||
return 1;
|
||||
|
||||
case PIPE_CAP_START_INSTANCE:
|
||||
case PIPE_CAP_DRAW_PARAMETERS:
|
||||
|
|
|
|||
|
|
@ -41,6 +41,13 @@ static struct pan_kmod_dev *
|
|||
panfrost_kmod_dev_create(int fd, uint32_t flags, drmVersionPtr version,
|
||||
const struct pan_kmod_allocator *allocator)
|
||||
{
|
||||
if (version->version_major < 1 ||
|
||||
(version->version_major == 1 && version->version_minor < 1)) {
|
||||
mesa_loge("kernel driver is too old (requires at least 1.1, found %d.%d)",
|
||||
version->version_major, version->version_minor);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct panfrost_kmod_dev *panfrost_dev =
|
||||
pan_kmod_alloc(allocator, sizeof(*panfrost_dev));
|
||||
if (!panfrost_dev) {
|
||||
|
|
@ -96,44 +103,23 @@ panfrost_dev_query_props(const struct pan_kmod_dev *dev,
|
|||
props->gpu_revision =
|
||||
panfrost_query_raw(fd, DRM_PANFROST_PARAM_GPU_REVISION, true, 0);
|
||||
props->shader_present =
|
||||
panfrost_query_raw(fd, DRM_PANFROST_PARAM_SHADER_PRESENT, false, 0xffff);
|
||||
panfrost_query_raw(fd, DRM_PANFROST_PARAM_SHADER_PRESENT, true, 0);
|
||||
props->tiler_features =
|
||||
panfrost_query_raw(fd, DRM_PANFROST_PARAM_TILER_FEATURES, false, 0x809);
|
||||
panfrost_query_raw(fd, DRM_PANFROST_PARAM_TILER_FEATURES, true, 0);
|
||||
props->mem_features =
|
||||
panfrost_query_raw(fd, DRM_PANFROST_PARAM_MEM_FEATURES, true, 0);
|
||||
props->mmu_features =
|
||||
panfrost_query_raw(fd, DRM_PANFROST_PARAM_MMU_FEATURES, false, 0);
|
||||
panfrost_query_raw(fd, DRM_PANFROST_PARAM_MMU_FEATURES, true, 0);
|
||||
|
||||
for (unsigned i = 0; i < ARRAY_SIZE(props->texture_features); i++) {
|
||||
/* If unspecified, assume ASTC/ETC only. Factory default for Juno, and
|
||||
* should exist on any Mali configuration. All hardware should report
|
||||
* these texture formats but the kernel might not be new enough. */
|
||||
static const uint32_t default_tex_features[4] = {
|
||||
(1 << 1) | // ETC2 RGB8
|
||||
(1 << 2) | // ETC2 R11 UNORM
|
||||
(1 << 3) | // ETC2 RGBA8
|
||||
(1 << 4) | // ETC2 RG11 UNORM
|
||||
(1 << 17) | // ETC2 R11 SNORM
|
||||
(1 << 18) | // ETC2 RG11 SNORM
|
||||
(1 << 19) | // ETC2 RGB8A1
|
||||
(1 << 20) | // ASTC 3D LDR
|
||||
(1 << 21) | // ASTC 3D HDR
|
||||
(1 << 22) | // ASTC 2D LDR
|
||||
(1 << 23), // ASTC 2D HDR
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
};
|
||||
|
||||
props->texture_features[i] =
|
||||
panfrost_query_raw(fd, DRM_PANFROST_PARAM_TEXTURE_FEATURES0 + i, false,
|
||||
default_tex_features[i]);
|
||||
props->texture_features[i] = panfrost_query_raw(
|
||||
fd, DRM_PANFROST_PARAM_TEXTURE_FEATURES0 + i, true, 0);
|
||||
}
|
||||
|
||||
props->thread_tls_alloc =
|
||||
panfrost_query_raw(fd, DRM_PANFROST_PARAM_THREAD_TLS_ALLOC, false, 0);
|
||||
panfrost_query_raw(fd, DRM_PANFROST_PARAM_THREAD_TLS_ALLOC, true, 0);
|
||||
props->afbc_features =
|
||||
panfrost_query_raw(fd, DRM_PANFROST_PARAM_AFBC_FEATURES, false, 0);
|
||||
panfrost_query_raw(fd, DRM_PANFROST_PARAM_AFBC_FEATURES, true, 0);
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue