mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 09:12:24 +03:00
gpu: nvgpu: Modify device node path for iGPU-PCIe
Create device nodes for iGPU-PCIe at /dev/nvgpu/igpu-XXXX:XX:XX.X/ This helps to identify the GPU type and its location at PCIe bus. Example dev node entry: /dev/nvgpu/igpu-0000:01:00.0/power JIRA NVGPU-9451 Change-Id: If66714467a989370c85c1e81d6e6c0c02ce0e6f4 Signed-off-by: Ramalingam C <ramalingamc@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2847618 Reviewed-by: Martin Radev <mradev@nvidia.com> Reviewed-by: Seema Khowala <seemaj@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
a765a76c81
commit
14cb86727c
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* NVGPU IOCTLs
|
||||
*
|
||||
* Copyright (c) 2011-2022, NVIDIA CORPORATION. All rights reserved.
|
||||
* Copyright (c) 2011-2023, NVIDIA CORPORATION. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
@@ -253,8 +253,18 @@ static char *nvgpu_pci_devnode_v2(struct device *dev, umode_t *mode)
|
||||
static char *nvgpu_pci_devnode_v2(const struct device *dev, umode_t *mode)
|
||||
#endif
|
||||
{
|
||||
return kasprintf(GFP_KERNEL, "nvgpu/dgpu-%s/%s", dev_name(dev->parent),
|
||||
dev_name(dev));
|
||||
return kasprintf(GFP_KERNEL, "nvgpu/dgpu-%s/%s",
|
||||
dev_name(dev->parent), dev_name(dev));
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0))
|
||||
static char *nvgpu_pci_igpu_devnode_v2(struct device *dev, umode_t *mode)
|
||||
#else
|
||||
static char *nvgpu_pci_igpu_devnode_v2(const struct device *dev, umode_t *mode)
|
||||
#endif
|
||||
{
|
||||
return kasprintf(GFP_KERNEL, "nvgpu/igpu-%s/%s",
|
||||
dev_name(dev->parent), dev_name(dev));
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0))
|
||||
@@ -553,7 +563,12 @@ static int nvgpu_prepare_default_dev_node_class_list(struct gk20a *g,
|
||||
if (class == NULL) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
class->class->devnode = nvgpu_pci_devnode_v2;
|
||||
|
||||
if (g->is_pci_igpu) {
|
||||
class->class->devnode = nvgpu_pci_igpu_devnode_v2;
|
||||
} else {
|
||||
class->class->devnode = nvgpu_pci_devnode_v2;
|
||||
}
|
||||
count++;
|
||||
} else {
|
||||
if (power_node) {
|
||||
|
||||
Reference in New Issue
Block a user