summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>2026-09-24 13:29:52 -0400
committerAlex Deucher <alexander.deucher@amd.com>2026-10-01 11:21:47 -0400
commit04a45bbc0900199e0e86c094dfb984abb697a3d2 (patch)
tree5150ee3fb7eee130897843b8f0c60f4c9721d0ef /drivers/gpu
parentaa1a19e18e5307f22b71c2399b3ea2ebea1350ef (diff)
downloadlinux-next-04a45bbc0900199e0e86c094dfb984abb697a3d2.tar.gz
linux-next-04a45bbc0900199e0e86c094dfb984abb697a3d2.zip
drm/amdgpu: use pm_runtime_resume_and_get amdgpu_gem_create_ioctl
This ioctl might trigger GPU work through ttm so make sure the GPU is awake. Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Co-developed-by: Shahyan Soltani <shahyan.soltani@amd.com> Signed-off-by: Shahyan Soltani <shahyan.soltani@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index 56eaf05899a8..bcbee2a11419 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -33,6 +33,7 @@
#include <linux/dma-buf.h>
#include <linux/dma-fence-unwrap.h>
#include <linux/uaccess.h>
+#include <linux/pm_runtime.h>
#include <drm/amdgpu_drm.h>
#include <drm/drm_drv.h>
@@ -442,6 +443,12 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
uint32_t handle, initial_domain;
int r;
+ PM_RUNTIME_ACQUIRE_IF_ENABLED_AUTOSUSPEND(dev->dev, lock);
+
+ r = PM_RUNTIME_ACQUIRE_ERR(&lock);
+ if (r)
+ return r;
+
/* reject invalid gem flags */
if (flags & ~AMDGPU_GEM_CREATE_SETTABLE_MASK)
return -EINVAL;