Displaying 19 results from an estimated 19 matches for "dummy_read_page".
2014 Dec 10
2
[PATCH] drm: sgdma: free allocated memory if TT init fails
...sgdma.c
index 01707e7deaf5..e4fc494d688d 100644
--- a/drm/nouveau_sgdma.c
+++ b/drm/nouveau_sgdma.c
@@ -107,7 +107,10 @@ nouveau_sgdma_create_ttm(struct ttm_bo_device *bdev,
 	else
 		nvbe->ttm.ttm.func = &nv50_sgdma_backend;
 
-	if (ttm_dma_tt_init(&nvbe->ttm, bdev, size, page_flags, dummy_read_page))
+	if (ttm_dma_tt_init(&nvbe->ttm, bdev, size, page_flags, dummy_read_page)) {
+		kfree(nvbe);
 		return NULL;
+	}
+
 	return &nvbe->ttm.ttm;
 }
-- 
2.1.3
2014 Dec 10
0
[PATCH] drm: sgdma: free allocated memory if TT init fails
.../drm/nouveau_sgdma.c
> +++ b/drm/nouveau_sgdma.c
> @@ -107,7 +107,10 @@ nouveau_sgdma_create_ttm(struct ttm_bo_device *bdev,
>         else
>                 nvbe->ttm.ttm.func = &nv50_sgdma_backend;
>
> -       if (ttm_dma_tt_init(&nvbe->ttm, bdev, size, page_flags, dummy_read_page))
> +       if (ttm_dma_tt_init(&nvbe->ttm, bdev, size, page_flags, dummy_read_page)) {
> +               kfree(nvbe);
>                 return NULL;
> +       }
> +
>         return &nvbe->ttm.ttm;
>  }
> --
> 2.1.3
>
> _______________________________...
2014 Dec 10
0
[PATCH] drm: sgdma: add comment around suspiscious error handler
...ouveau_sgdma.c
index ec76c0b4e452..23c377a6c761 100644
--- a/drm/nouveau_sgdma.c
+++ b/drm/nouveau_sgdma.c
@@ -106,6 +106,11 @@ nouveau_sgdma_create_ttm(struct ttm_bo_device *bdev,
 		nvbe->ttm.ttm.func = &nv50_sgdma_backend;
 
 	if (ttm_dma_tt_init(&nvbe->ttm, bdev, size, page_flags, dummy_read_page))
+		/*
+		 * A failing ttm_dma_tt_init() will call ttm_tt_destroy()
+		 * and thus our nouveau_sgdma_destroy() hook, so we don't need
+		 * to free nvbe here.
+		 */
 		return NULL;
 	return &nvbe->ttm.ttm;
 }
-- 
2.1.3
2015 Dec 11
1
[PATCH] ttm/drm: constify ttm_backend_func structures
..._bo_driver.h
index 813042c..c43efa4 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -113,7 +113,7 @@ enum ttm_caching_state {
 
 struct ttm_tt {
 	struct ttm_bo_device *bdev;
-	struct ttm_backend_func *func;
+	const struct ttm_backend_func *func;
 	struct page *dummy_read_page;
 	struct page **pages;
 	uint32_t page_flags;
2015 Dec 11
1
[PATCH] ttm/drm: constify ttm_backend_func structures
..._bo_driver.h
index 813042c..c43efa4 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -113,7 +113,7 @@ enum ttm_caching_state {
 
 struct ttm_tt {
 	struct ttm_bo_device *bdev;
-	struct ttm_backend_func *func;
+	const struct ttm_backend_func *func;
 	struct page *dummy_read_page;
 	struct page **pages;
 	uint32_t page_flags;
2018 Oct 16
0
[PATCH 2/2] drm/ttm: Provide ttm_bo_global_{init/release}() for struct ttm_bo_global
...ref, ref);
-	struct ttm_bo_global *glob = ref->object;
 	int ret;
 	unsigned i;
 
 	mutex_init(&glob->device_list_mutex);
 	spin_lock_init(&glob->lru_lock);
-	glob->mem_glob = bo_ref->mem_glob;
+	glob->mem_glob = mem_glob;
 	glob->mem_glob->bo_glob = glob;
 	glob->dummy_read_page = alloc_page(__GFP_ZERO | GFP_DMA32);
 
@@ -1564,7 +1560,7 @@ int ttm_bo_global_ref_init(struct drm_global_reference *ref)
 	kfree(glob);
 	return ret;
 }
-EXPORT_SYMBOL(ttm_bo_global_ref_init);
+EXPORT_SYMBOL(ttm_bo_global_init);
 
 
 int ttm_bo_device_release(struct ttm_bo_device *bdev)
diff --gi...
2018 Aug 13
5
[PATCH 0/2] Provide init/release functions for struct ttm_bo_global
TTM uses global memory and BO for backing graphics buffers. These are
represented by struct ttm_mem_global and struct ttm_bo_global.
Currently, struct ttm_bo_global can only be initialized and released through
struct ttm_bo_global_ref. This is a workaround for passing an instance of
ttm_mem_global to the BO global initialization code.
The use of struct ttm_bo_global_ref makes driver code
2018 Aug 13
5
[PATCH 0/2] Provide init/release functions for struct ttm_bo_global
TTM uses global memory and BO for backing graphics buffers. These are
represented by struct ttm_mem_global and struct ttm_bo_global.
Currently, struct ttm_bo_global can only be initialized and released through
struct ttm_bo_global_ref. This is a workaround for passing an instance of
ttm_mem_global to the BO global initialization code.
The use of struct ttm_bo_global_ref makes driver code
2018 Aug 13
5
[PATCH 0/2] Provide init/release functions for struct ttm_bo_global
TTM uses global memory and BO for backing graphics buffers. These are
represented by struct ttm_mem_global and struct ttm_bo_global.
Currently, struct ttm_bo_global can only be initialized and released through
struct ttm_bo_global_ref. This is a workaround for passing an instance of
ttm_mem_global to the BO global initialization code.
The use of struct ttm_bo_global_ref makes driver code
2018 Oct 16
3
[PATCH 0/2][RESEND] Provide init/release functions for struct ttm_bo_global
TTM uses global memory and BO for backing graphics buffers. These are
represented by struct ttm_mem_global and struct ttm_bo_global.
Currently, struct ttm_bo_global can only be initialized and released through
struct ttm_bo_global_ref. This is a workaround for passing an instance of
ttm_mem_global to the BO global initialization code.
The use of struct ttm_bo_global_ref makes driver code
2020 May 11
10
[RFC] Remove AGP support from Radeon/Nouveau/TTM
Hi guys,
Well let's face it AGP is a total headache to maintain and dead for at least 10+ years.
We have a lot of x86 specific stuff in the architecture independent graphics memory management to get the caching right, abusing the DMA API on multiple occasions, need to distinct between AGP and driver specific page tables etc etc...
So the idea here is to just go ahead and remove the support
2015 Mar 24
10
[PATCH] Add virtio gpu driver.
...urn ttm_pool_populate(ttm);
+}
+
+static void virtio_gpu_ttm_tt_unpopulate(struct ttm_tt *ttm)
+{
+	ttm_pool_unpopulate(ttm);
+}
+
+static struct ttm_tt *virtio_gpu_ttm_tt_create(struct ttm_bo_device *bdev,
+					       unsigned long size,
+					       uint32_t page_flags,
+					       struct page *dummy_read_page)
+{
+	struct virtio_gpu_device *vgdev;
+	struct virtio_gpu_ttm_tt *gtt;
+
+	vgdev = virtio_gpu_get_vgdev(bdev);
+	gtt = kzalloc(sizeof(struct virtio_gpu_ttm_tt), GFP_KERNEL);
+	if (gtt == NULL)
+		return NULL;
+	gtt->ttm.ttm.func = &virtio_gpu_backend_func;
+	gtt->vgdev = vgdev;
+	if (ttm...
2015 Mar 24
10
[PATCH] Add virtio gpu driver.
...urn ttm_pool_populate(ttm);
+}
+
+static void virtio_gpu_ttm_tt_unpopulate(struct ttm_tt *ttm)
+{
+	ttm_pool_unpopulate(ttm);
+}
+
+static struct ttm_tt *virtio_gpu_ttm_tt_create(struct ttm_bo_device *bdev,
+					       unsigned long size,
+					       uint32_t page_flags,
+					       struct page *dummy_read_page)
+{
+	struct virtio_gpu_device *vgdev;
+	struct virtio_gpu_ttm_tt *gtt;
+
+	vgdev = virtio_gpu_get_vgdev(bdev);
+	gtt = kzalloc(sizeof(struct virtio_gpu_ttm_tt), GFP_KERNEL);
+	if (gtt == NULL)
+		return NULL;
+	gtt->ttm.ttm.func = &virtio_gpu_backend_func;
+	gtt->vgdev = vgdev;
+	if (ttm...
2015 Mar 24
0
[PATCH] Add virtio gpu driver.
...void virtio_gpu_ttm_tt_unpopulate(struct ttm_tt *ttm)
> +{
> +	ttm_pool_unpopulate(ttm);
> +}
> +
> +static struct ttm_tt *virtio_gpu_ttm_tt_create(struct ttm_bo_device *bdev,
> +					       unsigned long size,
> +					       uint32_t page_flags,
> +					       struct page *dummy_read_page)
> +{
> +	struct virtio_gpu_device *vgdev;
> +	struct virtio_gpu_ttm_tt *gtt;
> +
> +	vgdev = virtio_gpu_get_vgdev(bdev);
> +	gtt = kzalloc(sizeof(struct virtio_gpu_ttm_tt), GFP_KERNEL);
> +	if (gtt == NULL)
> +		return NULL;
> +	gtt->ttm.ttm.func = &virtio_gpu_bac...
2015 Mar 24
0
[PATCH] Add virtio gpu driver.
...void virtio_gpu_ttm_tt_unpopulate(struct ttm_tt *ttm)
> +{
> +	ttm_pool_unpopulate(ttm);
> +}
> +
> +static struct ttm_tt *virtio_gpu_ttm_tt_create(struct ttm_bo_device *bdev,
> +					       unsigned long size,
> +					       uint32_t page_flags,
> +					       struct page *dummy_read_page)
> +{
> +	struct virtio_gpu_device *vgdev;
> +	struct virtio_gpu_ttm_tt *gtt;
> +
> +	vgdev = virtio_gpu_get_vgdev(bdev);
> +	gtt = kzalloc(sizeof(struct virtio_gpu_ttm_tt), GFP_KERNEL);
> +	if (gtt == NULL)
> +		return NULL;
> +	gtt->ttm.ttm.func = &virtio_gpu_bac...
2015 May 22
1
[PATCH v3 4/4] Add virtio gpu driver.
...urn ttm_pool_populate(ttm);
+}
+
+static void virtio_gpu_ttm_tt_unpopulate(struct ttm_tt *ttm)
+{
+	ttm_pool_unpopulate(ttm);
+}
+
+static struct ttm_tt *virtio_gpu_ttm_tt_create(struct ttm_bo_device *bdev,
+					       unsigned long size,
+					       uint32_t page_flags,
+					       struct page *dummy_read_page)
+{
+	struct virtio_gpu_device *vgdev;
+	struct virtio_gpu_ttm_tt *gtt;
+
+	vgdev = virtio_gpu_get_vgdev(bdev);
+	gtt = kzalloc(sizeof(struct virtio_gpu_ttm_tt), GFP_KERNEL);
+	if (gtt == NULL)
+		return NULL;
+	gtt->ttm.ttm.func = &virtio_gpu_backend_func;
+	gtt->vgdev = vgdev;
+	if (ttm...
2015 May 22
1
[PATCH v3 4/4] Add virtio gpu driver.
...urn ttm_pool_populate(ttm);
+}
+
+static void virtio_gpu_ttm_tt_unpopulate(struct ttm_tt *ttm)
+{
+	ttm_pool_unpopulate(ttm);
+}
+
+static struct ttm_tt *virtio_gpu_ttm_tt_create(struct ttm_bo_device *bdev,
+					       unsigned long size,
+					       uint32_t page_flags,
+					       struct page *dummy_read_page)
+{
+	struct virtio_gpu_device *vgdev;
+	struct virtio_gpu_ttm_tt *gtt;
+
+	vgdev = virtio_gpu_get_vgdev(bdev);
+	gtt = kzalloc(sizeof(struct virtio_gpu_ttm_tt), GFP_KERNEL);
+	if (gtt == NULL)
+		return NULL;
+	gtt->ttm.ttm.func = &virtio_gpu_backend_func;
+	gtt->vgdev = vgdev;
+	if (ttm...
2015 Apr 01
3
[PATCH v2 3/4] Add virtio gpu driver.
...urn ttm_pool_populate(ttm);
+}
+
+static void virtio_gpu_ttm_tt_unpopulate(struct ttm_tt *ttm)
+{
+	ttm_pool_unpopulate(ttm);
+}
+
+static struct ttm_tt *virtio_gpu_ttm_tt_create(struct ttm_bo_device *bdev,
+					       unsigned long size,
+					       uint32_t page_flags,
+					       struct page *dummy_read_page)
+{
+	struct virtio_gpu_device *vgdev;
+	struct virtio_gpu_ttm_tt *gtt;
+
+	vgdev = virtio_gpu_get_vgdev(bdev);
+	gtt = kzalloc(sizeof(struct virtio_gpu_ttm_tt), GFP_KERNEL);
+	if (gtt == NULL)
+		return NULL;
+	gtt->ttm.ttm.func = &virtio_gpu_backend_func;
+	gtt->vgdev = vgdev;
+	if (ttm...
2015 Apr 01
3
[PATCH v2 3/4] Add virtio gpu driver.
...urn ttm_pool_populate(ttm);
+}
+
+static void virtio_gpu_ttm_tt_unpopulate(struct ttm_tt *ttm)
+{
+	ttm_pool_unpopulate(ttm);
+}
+
+static struct ttm_tt *virtio_gpu_ttm_tt_create(struct ttm_bo_device *bdev,
+					       unsigned long size,
+					       uint32_t page_flags,
+					       struct page *dummy_read_page)
+{
+	struct virtio_gpu_device *vgdev;
+	struct virtio_gpu_ttm_tt *gtt;
+
+	vgdev = virtio_gpu_get_vgdev(bdev);
+	gtt = kzalloc(sizeof(struct virtio_gpu_ttm_tt), GFP_KERNEL);
+	if (gtt == NULL)
+		return NULL;
+	gtt->ttm.ttm.func = &virtio_gpu_backend_func;
+	gtt->vgdev = vgdev;
+	if (ttm...