@@ -127,6 +127,18 @@ void igt_panfrost_bo_mmap(int fd, struct panfrost_bo *bo)
igt_assert(bo->map);
}
+bool igt_panfrost_bo_madvise(int fd, struct panfrost_bo *bo, uint32_t madv)
+{
+ struct drm_panfrost_madvise madvise = {
+ .handle = bo->handle,
+ .madv = madv,
+ };
+
+ do_ioctl(fd, DRM_IOCTL_PANFROST_MADVISE, &madvise);
+
+ return madvise.retained;
+}
+
struct panfrost_submit *igt_panfrost_trivial_job(int fd, bool do_crash, int width, int height, uint32_t color)
{
struct panfrost_submit *submit;
@@ -56,5 +56,6 @@ uint32_t igt_panfrost_get_param(int fd, int param);
void *igt_panfrost_mmap_bo(int fd, uint32_t handle, uint32_t size, unsigned prot);
void igt_panfrost_bo_mmap(int fd, struct panfrost_bo *bo);
+bool igt_panfrost_bo_madvise(int fd, struct panfrost_bo *bo, uint32_t madv);
#endif /* IGT_PANFROST_H */
Signed-off-by: Neil Roberts <nroberts@igalia.com> --- lib/igt_panfrost.c | 12 ++++++++++++ lib/igt_panfrost.h | 1 + 2 files changed, 13 insertions(+)