panfrost: fix panfrost drm-shim

The panfrost driver now makes an ioctl to retrieve some new memory
parameters, and DRM_PANFROST_PARAM_MEM_FEATURES is required (does not
default in the caller). This caused drm-shim to stop working. This
patch adds some defaults to get drm-shim working again.

Signed-off-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Fixes: 91fe8a0d28 ("panfrost: Back panfrost_device with pan_kmod_dev object")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27162>
(cherry picked from commit a50b2f8f258eb71984a3d63ca031b8051c380344)
This commit is contained in:
Eric R. Smith 2024-01-18 18:12:17 -04:00 committed by Eric Engestrom
parent 812bcc29af
commit 2e4623bd19
2 changed files with 10 additions and 1 deletions

View file

@ -324,7 +324,7 @@
"description": "panfrost: fix panfrost drm-shim",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "91fe8a0d2859e0b869edf83a56c463cf548ac10a",
"notes": null

View file

@ -1,6 +1,7 @@
/*
* Copyright (C) 2021 Icecream95
* Copyright (C) 2019 Google LLC
* Copyright (C) 2024 Collabora, Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@ -75,6 +76,14 @@ pan_ioctl_get_param(int fd, unsigned long request, void *arg)
case DRM_PANFROST_PARAM_AFBC_FEATURES:
gp->value = 0;
return 0;
case DRM_PANFROST_PARAM_MEM_FEATURES:
/* lazy default, but works for the purposes of drm_shim */
gp->value = 0x0;
return 0;
case DRM_PANFROST_PARAM_MMU_FEATURES:
/* default for most hardware so far */
gp->value = 0x00280030;
return 0;
default:
fprintf(stderr, "Unknown DRM_IOCTL_PANFROST_GET_PARAM %d\n", gp->param);
return -1;