Commit 9938333a authored by James Zhu's avatar James Zhu Committed by Alex Deucher

drm/amdgpu: use amdxcp platform device as spatial partition

Use amdxcp platform device as spatial partition device.

-v2: remove unused variable
Signed-off-by: default avatarJames Zhu <James.Zhu@amd.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent ab1270a2
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#include "amdgpu_ras.h" #include "amdgpu_ras.h"
#include "amdgpu_xgmi.h" #include "amdgpu_xgmi.h"
#include "amdgpu_reset.h" #include "amdgpu_reset.h"
#include "../amdxcp/amdgpu_xcp_drv.h"
/* /*
* KMS wrapper. * KMS wrapper.
...@@ -2948,6 +2949,7 @@ static void __exit amdgpu_exit(void) ...@@ -2948,6 +2949,7 @@ static void __exit amdgpu_exit(void)
amdgpu_sync_fini(); amdgpu_sync_fini();
amdgpu_fence_slab_fini(); amdgpu_fence_slab_fini();
mmu_notifier_synchronize(); mmu_notifier_synchronize();
amdgpu_xcp_drv_release();
} }
module_init(amdgpu_init); module_init(amdgpu_init);
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "amdgpu_drv.h" #include "amdgpu_drv.h"
#include <drm/drm_drv.h> #include <drm/drm_drv.h>
#include "../amdxcp/amdgpu_xcp_drv.h"
static int __amdgpu_xcp_run(struct amdgpu_xcp_mgr *xcp_mgr, static int __amdgpu_xcp_run(struct amdgpu_xcp_mgr *xcp_mgr,
struct amdgpu_xcp_ip *xcp_ip, int xcp_state) 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) ...@@ -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) static int amdgpu_xcp_dev_alloc(struct amdgpu_device *adev)
{ {
struct drm_device *p_ddev; struct drm_device *p_ddev;
struct pci_dev *pdev;
struct drm_device *ddev; struct drm_device *ddev;
int i; int i, ret;
pdev = adev->pdev;
ddev = adev_to_drm(adev); ddev = adev_to_drm(adev);
for (i = 0; i < MAX_XCP; i++) { for (i = 0; i < MAX_XCP; i++) {
p_ddev = drm_dev_alloc(&amdgpu_partition_driver, ret = amdgpu_xcp_drm_dev_alloc(&p_ddev);
&pci_upstream_bridge(pdev)->dev); if (ret)
if (IS_ERR(p_ddev)) return ret;
return PTR_ERR(p_ddev);
/* Redirect all IOCTLs to the primary device */ /* Redirect all IOCTLs to the primary device */
adev->xcp_mgr->xcp[i].rdev = p_ddev->render->dev; adev->xcp_mgr->xcp[i].rdev = p_ddev->render->dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment