mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
drm/amdgpu: Change the virtual_display type from int to char*.
For virtual display feature, as there may be multiple GPUs, for user could choose whiche GPU need to enable this feature, change the type of virtual_display from int to char*. The variable will be set like this virtual_display="xxxx:xx:xx.x;xxxx:xx:xx.x;". Signed-off-by: Emily Deng <Emily.Deng@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
#endif
|
||||
#include "vi.h"
|
||||
#include "bif/bif_4_1_d.h"
|
||||
#include <linux/pci.h>
|
||||
|
||||
static int amdgpu_debugfs_regs_init(struct amdgpu_device *adev);
|
||||
static void amdgpu_debugfs_regs_cleanup(struct amdgpu_device *adev);
|
||||
@@ -1181,11 +1182,37 @@ int amdgpu_ip_block_version_cmp(struct amdgpu_device *adev,
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void amdgpu_whether_enable_virtual_display(struct amdgpu_device *adev)
|
||||
{
|
||||
adev->enable_virtual_display = false;
|
||||
|
||||
if (amdgpu_virtual_display) {
|
||||
struct drm_device *ddev = adev->ddev;
|
||||
const char *pci_address_name = pci_name(ddev->pdev);
|
||||
char *pciaddstr, *pciaddstr_tmp, *pciaddname;
|
||||
|
||||
pciaddstr = kstrdup(amdgpu_virtual_display, GFP_KERNEL);
|
||||
pciaddstr_tmp = pciaddstr;
|
||||
while ((pciaddname = strsep(&pciaddstr_tmp, ";"))) {
|
||||
if (!strcmp(pci_address_name, pciaddname)) {
|
||||
adev->enable_virtual_display = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DRM_INFO("virtual display string:%s, %s:virtual_display:%d\n",
|
||||
amdgpu_virtual_display, pci_address_name,
|
||||
adev->enable_virtual_display);
|
||||
|
||||
kfree(pciaddstr);
|
||||
}
|
||||
}
|
||||
|
||||
static int amdgpu_early_init(struct amdgpu_device *adev)
|
||||
{
|
||||
int i, r;
|
||||
|
||||
DRM_INFO("virtual display enabled:%d\n", amdgpu_virtual_display);
|
||||
amdgpu_whether_enable_virtual_display(adev);
|
||||
|
||||
switch (adev->asic_type) {
|
||||
case CHIP_TOPAZ:
|
||||
|
||||
Reference in New Issue
Block a user