summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorJames Zhu <James.Zhu@amd.com>2023-04-25 17:02:48 -0400
committerAlex Deucher <alexander.deucher@amd.com>2023-06-09 11:08:58 -0400
commit9938333a46c9e20539c85ca7df42a739541b0493 (patch)
treefcecf12f7710ea74ac24851e1b8f616885eb00bf /drivers/gpu
parentab1270a29b4f2b23aaa28d590d8361903c68b770 (diff)
drm/amdgpu: use amdxcp platform device as spatial partition
Use amdxcp platform device as spatial partition device. -v2: remove unused variable Signed-off-by: James Zhu <James.Zhu@amd.com> Acked-by: Alex Deucher <alexander.deucher@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_drv.c2
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c12
2 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 422c36ed8f36..7489b2b1a0d0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -50,6 +50,7 @@
#include "amdgpu_ras.h"
#include "amdgpu_xgmi.h"
#include "amdgpu_reset.h"
+#include "../amdxcp/amdgpu_xcp_drv.h"
/*
* KMS wrapper.
@@ -2948,6 +2949,7 @@ static void __exit amdgpu_exit(void)
amdgpu_sync_fini();
amdgpu_fence_slab_fini();
mmu_notifier_synchronize();
+ amdgpu_xcp_drv_release();
}
module_init(amdgpu_init);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c
index 86087faab689..d733fa6e7477 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c
@@ -25,6 +25,7 @@
#include "amdgpu_drv.h"
#include <drm/drm_drv.h>
+#include "../amdxcp/amdgpu_xcp_drv.h"
static int __amdgpu_xcp_run(struct amdgpu_xcp_mgr *xcp_mgr,
struct amdgpu_xcp_ip *xcp_ip, int xcp_state)
@@ -226,18 +227,15 @@ int amdgpu_xcp_query_partition_mode(struct amdgpu_xcp_mgr *xcp_mgr, u32 flags)
static int amdgpu_xcp_dev_alloc(struct amdgpu_device *adev)
{
struct drm_device *p_ddev;
- struct pci_dev *pdev;
struct drm_device *ddev;
- int i;
+ int i, ret;
- pdev = adev->pdev;
ddev = adev_to_drm(adev);
for (i = 0; i < MAX_XCP; i++) {
- p_ddev = drm_dev_alloc(&amdgpu_partition_driver,
- &pci_upstream_bridge(pdev)->dev);
- if (IS_ERR(p_ddev))
- return PTR_ERR(p_ddev);
+ ret = amdgpu_xcp_drm_dev_alloc(&p_ddev);
+ if (ret)
+ return ret;
/* Redirect all IOCTLs to the primary device */
adev->xcp_mgr->xcp[i].rdev = p_ddev->render->dev;