diff options
| author | Brendan King <brendan.king@imgtec.com> | 2024-10-18 15:41:36 +0000 |
|---|---|---|
| committer | Matt Coster <matt.coster@imgtec.com> | 2024-11-04 09:41:32 +0000 |
| commit | b0ef514bc6bbdeb8cc7492c0f473e14cb06b14d4 (patch) | |
| tree | 36771ea7b8d8307fd31053db56378414ebd07ad8 /drivers/gpu/drm/imagination/pvr_drv.c | |
| parent | add4163aca0d4a86e9fe4aa513865e4237db8aef (diff) | |
drm/imagination: Add a per-file PVR context list
This adds a linked list of VM contexts which is needed for the next patch
to be able to correctly track VM contexts for destruction on file close.
It is only safe for VM contexts to be removed from the list and destroyed
when not in interrupt context.
Signed-off-by: Brendan King <brendan.king@imgtec.com>
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Cc: stable@vger.kernel.org
Link: https://patchwork.freedesktop.org/patch/msgid/e57128ea-f0ce-4e93-a9d4-3f033a8b06fa@imgtec.com
Diffstat (limited to 'drivers/gpu/drm/imagination/pvr_drv.c')
| -rw-r--r-- | drivers/gpu/drm/imagination/pvr_drv.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/imagination/pvr_drv.c b/drivers/gpu/drm/imagination/pvr_drv.c index 1a0cb7aa9cea..fb17196e05f4 100644 --- a/drivers/gpu/drm/imagination/pvr_drv.c +++ b/drivers/gpu/drm/imagination/pvr_drv.c @@ -28,6 +28,7 @@ #include <linux/export.h> #include <linux/fs.h> #include <linux/kernel.h> +#include <linux/list.h> #include <linux/mod_devicetable.h> #include <linux/module.h> #include <linux/moduleparam.h> @@ -1326,6 +1327,8 @@ pvr_drm_driver_open(struct drm_device *drm_dev, struct drm_file *file) */ pvr_file->pvr_dev = pvr_dev; + INIT_LIST_HEAD(&pvr_file->contexts); + xa_init_flags(&pvr_file->ctx_handles, XA_FLAGS_ALLOC1); xa_init_flags(&pvr_file->free_list_handles, XA_FLAGS_ALLOC1); xa_init_flags(&pvr_file->hwrt_handles, XA_FLAGS_ALLOC1); |