Displaying 9 results from an estimated 9 matches for "nvkm_memory_unref".
2024 Aug 15
2
[PATCH] nouveau/firmware: using dma non-coherent interfaces for fw loading. (v2)
....c b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
index adc60b25f8e6..0af01a0ec601 100644
--- a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
+++ b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
@@ -205,7 +205,8 @@ nvkm_firmware_dtor(struct nvkm_firmware *fw)
 		break;
 	case NVKM_FIRMWARE_IMG_DMA:
 		nvkm_memory_unref(&memory);
-		dma_free_coherent(fw->device->dev, sg_dma_len(&fw->mem.sgl), fw->img, fw->phys);
+		dma_free_noncoherent(fw->device->dev, sg_dma_len(&fw->mem.sgl),
+				     fw->img, fw->phys, DMA_TO_DEVICE);
 		break;
 	case NVKM_FIRMWARE_IMG_SGT:
 		nvkm_mem...
2018 Feb 13
2
[drm-nouveau-mmu] question about potential NULL pointer dereference
...try((root)->head.dir, struct nvkm_vma, head)
  959
  960void
  961nvkm_vmm_unmap_region(struct nvkm_vmm *vmm, struct nvkm_vma *vma)
  962{
  963        struct nvkm_vma *next;
  964
  965        nvkm_memory_tags_put(vma->memory,  
vmm->mmu->subdev.device, &vma->tags);
  966        nvkm_memory_unref(&vma->memory);
  967
  968        if (vma->part) {
  969                struct nvkm_vma *prev = node(vma, prev);
  970                if (!prev->memory) {
  971                        prev->size += vma->size;
  972                        rb_erase(&vma->tree, &vmm->r...
2019 Aug 23
1
[PATCH] drm/nouveau: Fix memory leak in nvkm_ram_get()
...eau/nvkm/subdev/fb/ram.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.c
@@ -124,6 +124,9 @@ nvkm_ram_get(struct nvkm_device *device, u8 heap, u8 type, u8 rpage, u64 size,
 	nvkm_memory_ctor(&nvkm_vram, &vram->memory);
 	vram->ram = ram;
 	vram->page = page;
+
+	if (*pmemory)
+		nvkm_memory_unref(pmemory);
 	*pmemory = &vram->memory;
 
 	mutex_lock(&ram->fb->subdev.mutex);
-- 
2.14.4
2024 Apr 26
3
[PATCH 1/2] drm/nouveau/firmware: Fix SG_DEBUG error with nvkm_firmware_ctor()
...b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
index adc60b25f8e6c..141b0a513bf52 100644
--- a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
+++ b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
@@ -205,7 +205,9 @@ nvkm_firmware_dtor(struct nvkm_firmware *fw)
 		break;
 	case NVKM_FIRMWARE_IMG_DMA:
 		nvkm_memory_unref(&memory);
-		dma_free_coherent(fw->device->dev, sg_dma_len(&fw->mem.sgl), fw->img, fw->phys);
+		dma_unmap_single(fw->device->dev, fw->phys, sg_dma_len(&fw->mem.sgl),
+				 DMA_TO_DEVICE);
+		kfree(fw->img);
 		break;
 	case NVKM_FIRMWARE_IMG_SGT:
 		nvkm_m...
2024 Aug 16
1
[PATCH] nouveau/firmware: using dma non-coherent interfaces for fw loading. (v2)
...ore/firmware.c
> index adc60b25f8e6..0af01a0ec601 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
> @@ -205,7 +205,8 @@ nvkm_firmware_dtor(struct nvkm_firmware *fw)
>  		break;
>  	case NVKM_FIRMWARE_IMG_DMA:
>  		nvkm_memory_unref(&memory);
> -		dma_free_coherent(fw->device->dev, sg_dma_len(&fw->mem.sgl), fw->img, fw->phys);
> +		dma_free_noncoherent(fw->device->dev, sg_dma_len(&fw->mem.sgl),
> +				     fw->img, fw->phys, DMA_TO_DEVICE);
>  		break;
>  	case NVKM_FIRM...
2018 Feb 13
0
[drm-nouveau-mmu] question about potential NULL pointer dereference
...m_vma, head)
>  959
>  960void
>  961nvkm_vmm_unmap_region(struct nvkm_vmm *vmm, struct nvkm_vma *vma)
>  962{
>  963        struct nvkm_vma *next;
>  964
>  965        nvkm_memory_tags_put(vma->memory, vmm->mmu->subdev.device,
> &vma->tags);
>  966        nvkm_memory_unref(&vma->memory);
>  967
>  968        if (vma->part) {
>  969                struct nvkm_vma *prev = node(vma, prev);
>  970                if (!prev->memory) {
>  971                        prev->size += vma->size;
>  972                        rb_erase(&vma-...
2019 Nov 08
1
[PATCH] RFC: drm/nouveau: Make BAR1 support optional
...1014,7 +1025,9 @@ gk104_fifo_dtor(struct nvkm_fifo *base)
 	struct nvkm_device *device = fifo->base.engine.subdev.device;
 	int i;
 
-	nvkm_vmm_put(nvkm_bar_bar1_vmm(device), &fifo->user.bar);
+	if (fifo->user.bar)
+		nvkm_vmm_put(nvkm_bar_bar1_vmm(device), &fifo->user.bar);
+
 	nvkm_memory_unref(&fifo->user.mem);
 
 	for (i = 0; i < fifo->runlist_nr; i++) {
-- 
2.23.0
2023 Dec 22
11
nouveau GSP fixes
This is a collection of nouveau debug prints, memory leak, a very
annoying race condition causing system hangs with prime scenarios,
and a fix from Lyude to get the panel on my laptop working.
I'd like to get these into 6.7,
Dave.
2018 Mar 10
17
[RFC PATCH 00/13] SVM (share virtual memory) with HMM in nouveau
From: Jérôme Glisse <jglisse at redhat.com>
(mm is cced just to allow exposure of device driver work without ccing
a long list of peoples. I do not think there is anything usefull to
discuss from mm point of view but i might be wrong, so just for the
curious :)).
git://people.freedesktop.org/~glisse/linux branch: nouveau-hmm-v00