[PATCH v2 0/2] drm/imagination: improve UAPI heap and static areas query ioctls

From: Luigi Santivetti

Date: Mon Nov 09 2026 - 15:37:58 EST


This series is about better protecting userspace when either one of the
heap or the static data areas query IOCTL is made as we go forward and
extend the UAPI introducing new heaps or new fields to their related
data types.

Please refer to each patch commit message which describes in some detail
the nature of the issue and the solution for it.

In general terms this series makes the UAPI more flexible, introducing a
distinction between a legacy (or minimum) and a current (or maximum) value
for both the stride and the count that is returned to userspace.

With the new pattern in place, an older[*] version of userspace defaults
to requesting and to obtaining the legacy (or minimum) value of both stride
and count and this makes safe to update their maximum value going forward.

[*] before https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/44456

Signed-off-by: Luigi Santivetti <luigi.santivetti@xxxxxxxxxx>
---
Changes in v2:
- Rebase on drm-misc-next only
- Link to v1: https://patch.msgid.link/20261104-ioctl-query-count-stride-fixes-v1-0-2bf86dd7cf29@xxxxxxxxxx

---
Luigi Santivetti (2):
drm/imagination: clamp stride of heaps and static areas for legacy UM
drm/imagination: clamp count of heaps and static areas for legacy UM

drivers/gpu/drm/imagination/pvr_drv.h | 33 ++++++++++++++++++++++
drivers/gpu/drm/imagination/pvr_vm.c | 32 ++++++++++++++++++---
include/uapi/drm/pvr_drm.h | 53 +++++++++++++++++++++++++++++++----
3 files changed, 108 insertions(+), 10 deletions(-)
---
base-commit: 8deaade4a5a4ff635df91e246e42139ab2b33f6d
change-id: 20261104-ioctl-query-count-stride-fixes-43b4df2c2fc8

Best regards,
--
Luigi Santivetti <luigi.santivetti@xxxxxxxxxx>