mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 01:50:07 +03:00
gpu: nvgpu: Expose PCI device id info
Expose PCI device id info for PCI devices. Bug 1643487 Change-Id: Ib0e3295b33c2343d99553a5c48e3f67d419d207b Signed-off-by: Sami Kiminki <skiminki@nvidia.com> Reviewed-on: http://git-master/r/1214946 (cherry picked from commit a6e23a315a094f1df1f7db8e4307a10d06f28411) Reviewed-on: http://git-master/r/1216336 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
f5224bde14
commit
7303dd33ef
@@ -2014,6 +2014,13 @@ int gk20a_init_gpu_characteristics(struct gk20a *g)
|
|||||||
|
|
||||||
gpu->local_video_memory_size = g->mm.vidmem.size;
|
gpu->local_video_memory_size = g->mm.vidmem.size;
|
||||||
|
|
||||||
|
gpu->pci_vendor_id = g->pci_vendor_id;
|
||||||
|
gpu->pci_device_id = g->pci_device_id;
|
||||||
|
gpu->pci_subsystem_vendor_id = g->pci_subsystem_vendor_id;
|
||||||
|
gpu->pci_subsystem_device_id = g->pci_subsystem_device_id;
|
||||||
|
gpu->pci_class = g->pci_class;
|
||||||
|
gpu->pci_revision = g->pci_revision;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -908,6 +908,12 @@ struct gk20a {
|
|||||||
struct debugfs_blob_wrapper bios_blob;
|
struct debugfs_blob_wrapper bios_blob;
|
||||||
|
|
||||||
struct gk20a_ce_app ce_app;
|
struct gk20a_ce_app ce_app;
|
||||||
|
|
||||||
|
/* PCI device identifier */
|
||||||
|
u16 pci_vendor_id, pci_device_id;
|
||||||
|
u16 pci_subsystem_vendor_id, pci_subsystem_device_id;
|
||||||
|
u16 pci_class;
|
||||||
|
u8 pci_revision;
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline unsigned long gk20a_get_gr_idle_timeout(struct gk20a *g)
|
static inline unsigned long gk20a_get_gr_idle_timeout(struct gk20a *g)
|
||||||
|
|||||||
@@ -201,6 +201,13 @@ static int nvgpu_pci_probe(struct pci_dev *pdev,
|
|||||||
return err;
|
return err;
|
||||||
pci_set_master(pdev);
|
pci_set_master(pdev);
|
||||||
|
|
||||||
|
g->pci_vendor_id = pdev->vendor;
|
||||||
|
g->pci_device_id = pdev->device;
|
||||||
|
g->pci_subsystem_vendor_id = pdev->subsystem_vendor;
|
||||||
|
g->pci_subsystem_device_id = pdev->subsystem_device;
|
||||||
|
g->pci_class = (pdev->class >> 8) & 0xFFFFU; // we only want base/sub
|
||||||
|
g->pci_revision = pdev->revision;
|
||||||
|
|
||||||
g->irq_stall = pdev->irq;
|
g->irq_stall = pdev->irq;
|
||||||
g->irq_nonstall = pdev->irq;
|
g->irq_nonstall = pdev->irq;
|
||||||
if (g->irq_stall < 0)
|
if (g->irq_stall < 0)
|
||||||
|
|||||||
@@ -198,6 +198,13 @@ struct nvgpu_gpu_characteristics {
|
|||||||
|
|
||||||
__u64 local_video_memory_size; /* in bytes, non-zero only for dGPUs */
|
__u64 local_video_memory_size; /* in bytes, non-zero only for dGPUs */
|
||||||
|
|
||||||
|
/* These are meaningful only for PCI devices */
|
||||||
|
__u16 pci_vendor_id, pci_device_id;
|
||||||
|
__u16 pci_subsystem_vendor_id, pci_subsystem_device_id;
|
||||||
|
__u16 pci_class;
|
||||||
|
__u8 pci_revision;
|
||||||
|
__u8 reserved2[5];
|
||||||
|
|
||||||
/* Notes:
|
/* Notes:
|
||||||
- This struct can be safely appended with new fields. However, always
|
- This struct can be safely appended with new fields. However, always
|
||||||
keep the structure size multiple of 8 and make sure that the binary
|
keep the structure size multiple of 8 and make sure that the binary
|
||||||
|
|||||||
Reference in New Issue
Block a user