diff options
author | Konsta Holtta <kholtta@nvidia.com> | 2018-09-11 07:35:09 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2019-08-15 03:58:05 -0400 |
commit | eca2cf043e3f52734e2fbba68631a2ef70dad76d (patch) | |
tree | b714da5be2e95285cd01173a7a74d4e7c0340af1 /drivers/gpu/nvgpu/os/linux/pci.c | |
parent | 58ee7561f72653aea8acece9f5d33ff8fe6fb99d (diff) |
gpu: nvgpu: store bus addr of gpu regs
Usermode submit needs to access the usermode region of registers from
userspace. Store the start address of register resource in struct
nvgpu_os_linux to be used in remap to userspace.
Bug 200145225
Bug 200541476
Change-Id: I3796b6bf67942af0cc16c86accb82a013032bfc8
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1811838
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
(cherry picked from commit 38c11db264f776fa495a3ba74caadf4262062b78
in dev-main)
Reviewed-on: https://git-master.nvidia.com/r/2169921
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/os/linux/pci.c')
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/pci.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/pci.c b/drivers/gpu/nvgpu/os/linux/pci.c index 2e456abc..61e412f2 100644 --- a/drivers/gpu/nvgpu/os/linux/pci.c +++ b/drivers/gpu/nvgpu/os/linux/pci.c | |||
@@ -536,6 +536,13 @@ static int nvgpu_pci_init_support(struct pci_dev *pdev) | |||
536 | goto fail; | 536 | goto fail; |
537 | } | 537 | } |
538 | 538 | ||
539 | l->regs_bus_addr = pci_resource_start(pdev, 0); | ||
540 | if (!l->regs_bus_addr) { | ||
541 | nvgpu_err(g, "failed to read register bus offset"); | ||
542 | err = -ENODEV; | ||
543 | goto fail; | ||
544 | } | ||
545 | |||
539 | l->bar1 = nvgpu_devm_ioremap(dev, pci_resource_start(pdev, 1), | 546 | l->bar1 = nvgpu_devm_ioremap(dev, pci_resource_start(pdev, 1), |
540 | pci_resource_len(pdev, 1)); | 547 | pci_resource_len(pdev, 1)); |
541 | if (IS_ERR(l->bar1)) { | 548 | if (IS_ERR(l->bar1)) { |