search for: nv_device_is_pci

Displaying 20 results from an estimated 20 matches for "nv_device_is_pci".

2014 Feb 13
0
[PATCH v2] drm/nouveau: support for platform devices
...platform bus instead >> of PCI to which Nouveau is tightly dependent. This patch allows Nouveau >> to handle platform devices by: >> >> - abstracting PCI-dependent functions that were typically used for >> resource querying and page mapping, >> - introducing a nv_device_is_pci() function that allows to make >> PCI-dependent code conditional, >> - providing a nouveau_drm_platform_probe() function that takes a GPU >> platform device to be probed. >> >> Core code as well as engine/subdev drivers are updated wherever possible >> to m...
2014 Feb 01
0
[RFC 02/16] drm/nouveau: basic support for platform devices
...te api disable mask into internal mapping */ disable = args->debug0; @@ -446,6 +446,60 @@ nouveau_device_dtor(struct nouveau_object *object) nouveau_engine_destroy(&device->base); } +resource_size_t +nv_device_resource_start(struct nouveau_device *device, unsigned int bar) +{ + if (nv_device_is_pci(device)) { + return pci_resource_start(device->pdev, bar); + } else { + struct resource *res; + res = platform_get_resource(device->platformdev, + IORESOURCE_MEM, bar); + if (!res) + return 0; + return res->start; + } +} + +resource_size_t +nv_device_resource_len(struct nouv...
2014 Feb 11
2
[PATCH] drm/nouveau: support for platform devices
...urbot wrote: > [...] >> diff --git a/drivers/gpu/drm/nouveau/core/engine/device/base.c b/drivers/gpu/drm/nouveau/core/engine/device/base.c > [...] >> +resource_size_t >> +nv_device_resource_start(struct nouveau_device *device, unsigned int bar) >> +{ >> + if (nv_device_is_pci(device)) { >> + return pci_resource_start(device->pdev, bar); >> + } else { >> + struct resource *res; >> + res = platform_get_resource(device->platformdev, >> + IORESOURCE_MEM, bar);...
2014 Feb 12
2
[PATCH v2] drm/nouveau: support for platform devices
...(such as GK20A) use the platform bus instead > of PCI to which Nouveau is tightly dependent. This patch allows Nouveau > to handle platform devices by: > > - abstracting PCI-dependent functions that were typically used for > resource querying and page mapping, > - introducing a nv_device_is_pci() function that allows to make > PCI-dependent code conditional, > - providing a nouveau_drm_platform_probe() function that takes a GPU > platform device to be probed. > > Core code as well as engine/subdev drivers are updated wherever possible > to make use of these function...
2014 Feb 10
2
[PATCH] drm/nouveau: support for platform devices
Upcoming mobile Kepler GPUs (such as GK20A) use the platform bus instead of PCI to which Nouveau is tightly dependent. This patch allows Nouveau to handle platform devices by: - abstracting PCI-dependent functions that were typically used for resource querying and page mapping, - introducing a nv_device_is_pci() function that allows to make PCI-dependent code conditional, - providing a nouveau_drm_platform_probe() function that takes a GPU platform device to be probed. Core code as well as engine/subdev drivers are updated wherever possible to make use of these functions. Some older drivers are too...
2014 Feb 10
0
[PATCH] drm/nouveau: support for platform devices
...at 02:53:00PM +0900, Alexandre Courbot wrote: [...] > diff --git a/drivers/gpu/drm/nouveau/core/engine/device/base.c b/drivers/gpu/drm/nouveau/core/engine/device/base.c [...] > +resource_size_t > +nv_device_resource_start(struct nouveau_device *device, unsigned int bar) > +{ > + if (nv_device_is_pci(device)) { > + return pci_resource_start(device->pdev, bar); > + } else { > + struct resource *res; > + res = platform_get_resource(device->platformdev, > + IORESOURCE_MEM, bar); > + if (!res) > + return 0; > + return res->start; > + } > +} >...
2014 Feb 12
0
[PATCH v2] drm/nouveau: support for platform devices
Upcoming mobile Kepler GPUs (such as GK20A) use the platform bus instead of PCI to which Nouveau is tightly dependent. This patch allows Nouveau to handle platform devices by: - abstracting PCI-dependent functions that were typically used for resource querying and page mapping, - introducing a nv_device_is_pci() function that allows to make PCI-dependent code conditional, - providing a nouveau_drm_platform_probe() function that takes a GPU platform device to be probed. Core code as well as engine/subdev drivers are updated wherever possible to make use of these functions. Some older drivers are too...
2014 Dec 30
0
[PATCH] mc: add missing braces
...--git a/nvkm/subdev/mc/base.c b/nvkm/subdev/mc/base.c index ca7cee3a314a..25e3b9644a3f 100644 --- a/nvkm/subdev/mc/base.c +++ b/nvkm/subdev/mc/base.c @@ -124,7 +124,7 @@ nouveau_mc_create_(struct nouveau_object *parent, struct nouveau_object *engine, pmc->unk260 = nouveau_mc_unk260; - if (nv_device_is_pci(device)) + if (nv_device_is_pci(device)) { switch (device->pdev->device & 0x0ff0) { case 0x00f0: case 0x02e0: @@ -138,6 +138,7 @@ nouveau_mc_create_(struct nouveau_object *parent, struct nouveau_object *engine, default: pmc->use_msi = true; break; + } }...
2014 Jul 10
3
[PATCH v4 2/6] drm/nouveau: map pages using DMA API on platform devices
...ormdev->dev, page, 0, > + PAGE_SIZE, DMA_BIDIRECTIONAL); > + if (dma_mapping_error(&device->platformdev->dev, ret)) > + ret = 0; > } > > return ret; > @@ -501,6 +504,9 @@ nv_device_unmap_page(struct nouveau_device *device, dma_addr_t addr) > if (nv_device_is_pci(device)) > pci_unmap_page(device->pdev, addr, PAGE_SIZE, > PCI_DMA_BIDIRECTIONAL); pci_map/unmap alias to dma_unmap/map when called on the underlying struct device embedded in pci_device (like for platform drivers). Dunno whether it's worth to track a pointer to the stru...
2014 Jul 31
2
[PATCH v5] drm/nouveau: map pages using DMA API
...a..6c16dabe13b3 100644 --- a/nvkm/engine/device/base.c +++ b/nvkm/engine/device/base.c @@ -487,31 +487,6 @@ nv_device_resource_len(struct nouveau_device *device, unsigned int bar) } } -dma_addr_t -nv_device_map_page(struct nouveau_device *device, struct page *page) -{ - dma_addr_t ret; - - if (nv_device_is_pci(device)) { - ret = pci_map_page(device->pdev, page, 0, PAGE_SIZE, - PCI_DMA_BIDIRECTIONAL); - if (pci_dma_mapping_error(device->pdev, ret)) - ret = 0; - } else { - ret = page_to_phys(page); - } - - return ret; -} - -void -nv_device_unmap_page(struct nouveau_device *device, dma_addr...
2014 Jul 08
8
[PATCH v4 0/6] drm: nouveau: memory coherency on ARM
Another revision of this patchset critical for GK20A to operate. Previous attempts were exclusively using either TTM's regular page allocator or the DMA API one. Both have their advantages and drawbacks: the page allocator is fast but requires explicit synchronization on non-coherent architectures, whereas the DMA allocator always returns coherent memory, but is also slower, creates a
2014 Jul 08
0
[PATCH v4 4/6] drm/nouveau: synchronize BOs when required
..._drm *drm = nouveau_bdev(nvbo->bo.bdev); + struct nouveau_device *device = nouveau_dev(drm->dev); + struct ttm_dma_tt *ttm_dma = (struct ttm_dma_tt *)nvbo->bo.ttm; + int i; + + if (!ttm_dma) + return; + + if (nv_device_is_cpu_coherent(device) || nvbo->force_coherent) + return; + + if (nv_device_is_pci(device)) { + for (i = 0; i < ttm_dma->ttm.num_pages; i++) + pci_dma_sync_single_for_device(device->pdev, + ttm_dma->dma_address[i], PAGE_SIZE, + PCI_DMA_TODEVICE); + } else { + for (i = 0; i < ttm_dma->ttm.num_pages; i++) + dma_sync_single_for_device(nv_device_base(dev...
2014 Aug 04
0
[PATCH v5] drm/nouveau: map pages using DMA API
...> +++ b/nvkm/engine/device/base.c > @@ -487,31 +487,6 @@ nv_device_resource_len(struct nouveau_device *device, unsigned int bar) > } > } > > -dma_addr_t > -nv_device_map_page(struct nouveau_device *device, struct page *page) > -{ > - dma_addr_t ret; > - > - if (nv_device_is_pci(device)) { > - ret = pci_map_page(device->pdev, page, 0, PAGE_SIZE, > - PCI_DMA_BIDIRECTIONAL); > - if (pci_dma_mapping_error(device->pdev, ret)) > - ret = 0; > - } else { > - ret = page_to_phys(page); > - } > - > - return ret; > -} > - > -void &...
2014 Jul 10
2
[PATCH v4 4/6] drm/nouveau: synchronize BOs when required
...or_foo should be a noop. It's the dma api's job to encapsulate this knowledge so that drivers can be blissfully ignorant. The explicit is_coherent check makes this a bit leaky. And same comment that underlying the bus-specifics dma-mapping functions are identical. -Daniel > + > + if (nv_device_is_pci(device)) { > + for (i = 0; i < ttm_dma->ttm.num_pages; i++) > + pci_dma_sync_single_for_device(device->pdev, > + ttm_dma->dma_address[i], PAGE_SIZE, > + PCI_DMA_TODEVICE); > + } else { > + for (i = 0; i < ttm_dma->ttm.num_pages; i++) > + dma_sync_s...
2014 Jul 11
2
[PATCH v4 2/6] drm/nouveau: map pages using DMA API on platform devices
...r(&device->platformdev->dev, ret)) >>> + ret = 0; >>> } >>> >>> return ret; >>> @@ -501,6 +504,9 @@ nv_device_unmap_page(struct nouveau_device *device, >>> dma_addr_t addr) >>> if (nv_device_is_pci(device)) >>> pci_unmap_page(device->pdev, addr, PAGE_SIZE, >>> PCI_DMA_BIDIRECTIONAL); >> >> >> pci_map/unmap alias to dma_unmap/map when called on the underlying struct >> device embedded in pci_device (lik...
2014 Feb 01
28
[RFC 00/16] drm/nouveau: initial support for GK20A (Tegra K1)
Hello everyone, GK20A is the Kepler-based GPU used in the upcoming Tegra K1 chips. The following patches perform architectural changes to Nouveau that are necessary to support non-PCI GPUs and add initial support for GK20A. Although the support is still very basic and more user-space changes will be needed to make the full graphics stack run on top of it, we were able to successfully open
2014 Jul 08
0
[PATCH v4 2/6] drm/nouveau: map pages using DMA API on platform devices
...ret = dma_map_page(&device->platformdev->dev, page, 0, + PAGE_SIZE, DMA_BIDIRECTIONAL); + if (dma_mapping_error(&device->platformdev->dev, ret)) + ret = 0; } return ret; @@ -501,6 +504,9 @@ nv_device_unmap_page(struct nouveau_device *device, dma_addr_t addr) if (nv_device_is_pci(device)) pci_unmap_page(device->pdev, addr, PAGE_SIZE, PCI_DMA_BIDIRECTIONAL); + else + dma_unmap_page(&device->platformdev->dev, addr, + PAGE_SIZE, DMA_BIDIRECTIONAL); } int -- 2.0.0
2014 Jul 11
0
[PATCH v4 2/6] drm/nouveau: map pages using DMA API on platform devices
...+ PAGE_SIZE, DMA_BIDIRECTIONAL); >> + if (dma_mapping_error(&device->platformdev->dev, ret)) >> + ret = 0; >> } >> >> return ret; >> @@ -501,6 +504,9 @@ nv_device_unmap_page(struct nouveau_device *device, dma_addr_t addr) >> if (nv_device_is_pci(device)) >> pci_unmap_page(device->pdev, addr, PAGE_SIZE, >> PCI_DMA_BIDIRECTIONAL); > > pci_map/unmap alias to dma_unmap/map when called on the underlying struct > device embedded in pci_device (like for platform drivers). Dunno whether > it's worth t...
2014 Oct 27
4
[PATCH v5 0/4] drm: nouveau: memory coherency on ARM
It has been a couple of months since v4 - apologies for this. v4 has not received many comments, but this version addresses them and makes a new attempt at pushing the critical bit for GK20A and Nouveau on ARM in general. As a reminder, this series addresses the memory coherency issue that we are seeing on ARM platforms. Contrary to x86 which invalidates the PCI caches whenever a write is made by
2014 Jul 11
0
[PATCH v4 2/6] drm/nouveau: map pages using DMA API on platform devices
...gt;dev, ret)) >>>> + ret = 0; >>>> } >>>> >>>> return ret; >>>> @@ -501,6 +504,9 @@ nv_device_unmap_page(struct nouveau_device *device, >>>> dma_addr_t addr) >>>> if (nv_device_is_pci(device)) >>>> pci_unmap_page(device->pdev, addr, PAGE_SIZE, >>>> PCI_DMA_BIDIRECTIONAL); >>> >>> >>> pci_map/unmap alias to dma_unmap/map when called on the underlying struct >>> device e...