* [PATCH 1/8] drm/ttm: add default implementations for ttm_tt_(un)populate
@ 2018-02-22 11:15 Christian König
2018-02-22 11:15 ` [PATCH 2/8] drm/virtio: remove ttm_pool_* wrappers Christian König
` (7 more replies)
0 siblings, 8 replies; 12+ messages in thread
From: Christian König @ 2018-02-22 11:15 UTC (permalink / raw)
To: dri-devel
Use ttm_pool_populate/ttm_pool_unpopulate if the driver doesn't provide
a function.
Signed-off-by: Christian König <christian.koenig@amd.com>
---
drivers/gpu/drm/ttm/ttm_tt.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index 9fd7115a013a..65bf4eac184b 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -410,7 +410,10 @@ int ttm_tt_populate(struct ttm_tt *ttm, struct ttm_operation_ctx *ctx)
if (ttm->state != tt_unpopulated)
return 0;
- ret = ttm->bdev->driver->ttm_tt_populate(ttm, ctx);
+ if (ttm->bdev->driver->ttm_tt_populate)
+ ret = ttm->bdev->driver->ttm_tt_populate(ttm, ctx);
+ else
+ ret = ttm_pool_populate(ttm, ctx);
if (!ret)
ttm_tt_add_mapping(ttm);
return ret;
@@ -436,5 +439,8 @@ void ttm_tt_unpopulate(struct ttm_tt *ttm)
return;
ttm_tt_clear_mapping(ttm);
- ttm->bdev->driver->ttm_tt_unpopulate(ttm);
+ if (ttm->bdev->driver->ttm_tt_unpopulate)
+ ttm->bdev->driver->ttm_tt_unpopulate(ttm);
+ else
+ ttm_pool_unpopulate(ttm);
}
--
2.14.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/8] drm/virtio: remove ttm_pool_* wrappers
2018-02-22 11:15 [PATCH 1/8] drm/ttm: add default implementations for ttm_tt_(un)populate Christian König
@ 2018-02-22 11:15 ` Christian König
2018-02-22 11:15 ` [PATCH 3/8] drm/mgag200: " Christian König
` (6 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Christian König @ 2018-02-22 11:15 UTC (permalink / raw)
To: dri-devel
TTM calls the default implementation now.
Signed-off-by: Christian König <christian.koenig@amd.com>
---
drivers/gpu/drm/virtio/virtgpu_ttm.c | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/drivers/gpu/drm/virtio/virtgpu_ttm.c b/drivers/gpu/drm/virtio/virtgpu_ttm.c
index 36655b709eb2..1cde060602aa 100644
--- a/drivers/gpu/drm/virtio/virtgpu_ttm.c
+++ b/drivers/gpu/drm/virtio/virtgpu_ttm.c
@@ -324,20 +324,6 @@ static struct ttm_backend_func virtio_gpu_backend_func = {
.destroy = &virtio_gpu_ttm_backend_destroy,
};
-static int virtio_gpu_ttm_tt_populate(struct ttm_tt *ttm,
- struct ttm_operation_ctx *ctx)
-{
- if (ttm->state != tt_unpopulated)
- return 0;
-
- return ttm_pool_populate(ttm, ctx);
-}
-
-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,
@@ -421,8 +407,6 @@ static void virtio_gpu_bo_swap_notify(struct ttm_buffer_object *tbo)
static struct ttm_bo_driver virtio_gpu_bo_driver = {
.ttm_tt_create = &virtio_gpu_ttm_tt_create,
- .ttm_tt_populate = &virtio_gpu_ttm_tt_populate,
- .ttm_tt_unpopulate = &virtio_gpu_ttm_tt_unpopulate,
.invalidate_caches = &virtio_gpu_invalidate_caches,
.init_mem_type = &virtio_gpu_init_mem_type,
.eviction_valuable = ttm_bo_eviction_valuable,
--
2.14.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 3/8] drm/mgag200: remove ttm_pool_* wrappers
2018-02-22 11:15 [PATCH 1/8] drm/ttm: add default implementations for ttm_tt_(un)populate Christian König
2018-02-22 11:15 ` [PATCH 2/8] drm/virtio: remove ttm_pool_* wrappers Christian König
@ 2018-02-22 11:15 ` Christian König
2018-02-22 11:15 ` [PATCH 4/8] drm/hisilicon: " Christian König
` (5 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Christian König @ 2018-02-22 11:15 UTC (permalink / raw)
To: dri-devel
TTM calls the default implementation now.
Signed-off-by: Christian König <christian.koenig@amd.com>
---
drivers/gpu/drm/mgag200/mgag200_ttm.c | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/drivers/gpu/drm/mgag200/mgag200_ttm.c b/drivers/gpu/drm/mgag200/mgag200_ttm.c
index c97009bb77dd..26e5f14645c5 100644
--- a/drivers/gpu/drm/mgag200/mgag200_ttm.c
+++ b/drivers/gpu/drm/mgag200/mgag200_ttm.c
@@ -216,21 +216,8 @@ static struct ttm_tt *mgag200_ttm_tt_create(struct ttm_bo_device *bdev,
return tt;
}
-static int mgag200_ttm_tt_populate(struct ttm_tt *ttm,
- struct ttm_operation_ctx *ctx)
-{
- return ttm_pool_populate(ttm, ctx);
-}
-
-static void mgag200_ttm_tt_unpopulate(struct ttm_tt *ttm)
-{
- ttm_pool_unpopulate(ttm);
-}
-
struct ttm_bo_driver mgag200_bo_driver = {
.ttm_tt_create = mgag200_ttm_tt_create,
- .ttm_tt_populate = mgag200_ttm_tt_populate,
- .ttm_tt_unpopulate = mgag200_ttm_tt_unpopulate,
.init_mem_type = mgag200_bo_init_mem_type,
.eviction_valuable = ttm_bo_eviction_valuable,
.evict_flags = mgag200_bo_evict_flags,
--
2.14.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 4/8] drm/hisilicon: remove ttm_pool_* wrappers
2018-02-22 11:15 [PATCH 1/8] drm/ttm: add default implementations for ttm_tt_(un)populate Christian König
2018-02-22 11:15 ` [PATCH 2/8] drm/virtio: remove ttm_pool_* wrappers Christian König
2018-02-22 11:15 ` [PATCH 3/8] drm/mgag200: " Christian König
@ 2018-02-22 11:15 ` Christian König
2018-02-22 11:15 ` [PATCH 5/8] drm/ast: " Christian König
` (4 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Christian König @ 2018-02-22 11:15 UTC (permalink / raw)
To: dri-devel
TTM calls the default implementation now.
Signed-off-by: Christian König <christian.koenig@amd.com>
---
drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c
index 8516e005643f..0c93349fbacf 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c
@@ -223,21 +223,8 @@ static struct ttm_tt *hibmc_ttm_tt_create(struct ttm_bo_device *bdev,
return tt;
}
-static int hibmc_ttm_tt_populate(struct ttm_tt *ttm,
- struct ttm_operation_ctx *ctx)
-{
- return ttm_pool_populate(ttm, ctx);
-}
-
-static void hibmc_ttm_tt_unpopulate(struct ttm_tt *ttm)
-{
- ttm_pool_unpopulate(ttm);
-}
-
struct ttm_bo_driver hibmc_bo_driver = {
.ttm_tt_create = hibmc_ttm_tt_create,
- .ttm_tt_populate = hibmc_ttm_tt_populate,
- .ttm_tt_unpopulate = hibmc_ttm_tt_unpopulate,
.init_mem_type = hibmc_bo_init_mem_type,
.evict_flags = hibmc_bo_evict_flags,
.move = NULL,
--
2.14.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 5/8] drm/ast: remove ttm_pool_* wrappers
2018-02-22 11:15 [PATCH 1/8] drm/ttm: add default implementations for ttm_tt_(un)populate Christian König
` (2 preceding siblings ...)
2018-02-22 11:15 ` [PATCH 4/8] drm/hisilicon: " Christian König
@ 2018-02-22 11:15 ` Christian König
2018-02-22 11:15 ` [PATCH 6/8] drm/qxl: " Christian König
` (3 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Christian König @ 2018-02-22 11:15 UTC (permalink / raw)
To: dri-devel
TTM calls the default implementation now.
Signed-off-by: Christian König <christian.koenig@amd.com>
---
drivers/gpu/drm/ast/ast_ttm.c | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/drivers/gpu/drm/ast/ast_ttm.c b/drivers/gpu/drm/ast/ast_ttm.c
index 7b784d91e258..68b9c5522eaa 100644
--- a/drivers/gpu/drm/ast/ast_ttm.c
+++ b/drivers/gpu/drm/ast/ast_ttm.c
@@ -216,21 +216,8 @@ static struct ttm_tt *ast_ttm_tt_create(struct ttm_bo_device *bdev,
return tt;
}
-static int ast_ttm_tt_populate(struct ttm_tt *ttm,
- struct ttm_operation_ctx *ctx)
-{
- return ttm_pool_populate(ttm, ctx);
-}
-
-static void ast_ttm_tt_unpopulate(struct ttm_tt *ttm)
-{
- ttm_pool_unpopulate(ttm);
-}
-
struct ttm_bo_driver ast_bo_driver = {
.ttm_tt_create = ast_ttm_tt_create,
- .ttm_tt_populate = ast_ttm_tt_populate,
- .ttm_tt_unpopulate = ast_ttm_tt_unpopulate,
.init_mem_type = ast_bo_init_mem_type,
.eviction_valuable = ttm_bo_eviction_valuable,
.evict_flags = ast_bo_evict_flags,
--
2.14.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 6/8] drm/qxl: remove ttm_pool_* wrappers
2018-02-22 11:15 [PATCH 1/8] drm/ttm: add default implementations for ttm_tt_(un)populate Christian König
` (3 preceding siblings ...)
2018-02-22 11:15 ` [PATCH 5/8] drm/ast: " Christian König
@ 2018-02-22 11:15 ` Christian König
2018-02-22 11:15 ` [PATCH 7/8] drm/cirrus: " Christian König
` (2 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Christian König @ 2018-02-22 11:15 UTC (permalink / raw)
To: dri-devel
TTM calls the default implementation now.
Signed-off-by: Christian König <christian.koenig@amd.com>
---
drivers/gpu/drm/qxl/qxl_ttm.c | 22 ----------------------
1 file changed, 22 deletions(-)
diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c
index 59cd74c3f3af..07d4f3fde6c1 100644
--- a/drivers/gpu/drm/qxl/qxl_ttm.c
+++ b/drivers/gpu/drm/qxl/qxl_ttm.c
@@ -291,26 +291,6 @@ static struct ttm_backend_func qxl_backend_func = {
.destroy = &qxl_ttm_backend_destroy,
};
-static int qxl_ttm_tt_populate(struct ttm_tt *ttm,
- struct ttm_operation_ctx *ctx)
-{
- int r;
-
- if (ttm->state != tt_unpopulated)
- return 0;
-
- r = ttm_pool_populate(ttm, ctx);
- if (r)
- return r;
-
- return 0;
-}
-
-static void qxl_ttm_tt_unpopulate(struct ttm_tt *ttm)
-{
- ttm_pool_unpopulate(ttm);
-}
-
static struct ttm_tt *qxl_ttm_tt_create(struct ttm_bo_device *bdev,
unsigned long size, uint32_t page_flags,
struct page *dummy_read_page)
@@ -379,8 +359,6 @@ static void qxl_bo_move_notify(struct ttm_buffer_object *bo,
static struct ttm_bo_driver qxl_bo_driver = {
.ttm_tt_create = &qxl_ttm_tt_create,
- .ttm_tt_populate = &qxl_ttm_tt_populate,
- .ttm_tt_unpopulate = &qxl_ttm_tt_unpopulate,
.invalidate_caches = &qxl_invalidate_caches,
.init_mem_type = &qxl_init_mem_type,
.eviction_valuable = ttm_bo_eviction_valuable,
--
2.14.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 7/8] drm/cirrus: remove ttm_pool_* wrappers
2018-02-22 11:15 [PATCH 1/8] drm/ttm: add default implementations for ttm_tt_(un)populate Christian König
` (4 preceding siblings ...)
2018-02-22 11:15 ` [PATCH 6/8] drm/qxl: " Christian König
@ 2018-02-22 11:15 ` Christian König
2018-02-22 11:15 ` [PATCH 8/8] drm/bochs: remove the default ttm_tt_populate callbacks Christian König
2018-02-22 15:55 ` [PATCH 1/8] drm/ttm: add default implementations for ttm_tt_(un)populate Michel Dänzer
7 siblings, 0 replies; 12+ messages in thread
From: Christian König @ 2018-02-22 11:15 UTC (permalink / raw)
To: dri-devel
TTM calls the default implementation now.
Signed-off-by: Christian König <christian.koenig@amd.com>
---
drivers/gpu/drm/cirrus/cirrus_ttm.c | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/drivers/gpu/drm/cirrus/cirrus_ttm.c b/drivers/gpu/drm/cirrus/cirrus_ttm.c
index a8e31ea07382..33798c76a64b 100644
--- a/drivers/gpu/drm/cirrus/cirrus_ttm.c
+++ b/drivers/gpu/drm/cirrus/cirrus_ttm.c
@@ -216,21 +216,8 @@ static struct ttm_tt *cirrus_ttm_tt_create(struct ttm_bo_device *bdev,
return tt;
}
-static int cirrus_ttm_tt_populate(struct ttm_tt *ttm,
- struct ttm_operation_ctx *ctx)
-{
- return ttm_pool_populate(ttm, ctx);
-}
-
-static void cirrus_ttm_tt_unpopulate(struct ttm_tt *ttm)
-{
- ttm_pool_unpopulate(ttm);
-}
-
struct ttm_bo_driver cirrus_bo_driver = {
.ttm_tt_create = cirrus_ttm_tt_create,
- .ttm_tt_populate = cirrus_ttm_tt_populate,
- .ttm_tt_unpopulate = cirrus_ttm_tt_unpopulate,
.init_mem_type = cirrus_bo_init_mem_type,
.eviction_valuable = ttm_bo_eviction_valuable,
.evict_flags = cirrus_bo_evict_flags,
--
2.14.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 8/8] drm/bochs: remove the default ttm_tt_populate callbacks
2018-02-22 11:15 [PATCH 1/8] drm/ttm: add default implementations for ttm_tt_(un)populate Christian König
` (5 preceding siblings ...)
2018-02-22 11:15 ` [PATCH 7/8] drm/cirrus: " Christian König
@ 2018-02-22 11:15 ` Christian König
2018-02-23 3:27 ` He, Roger
2018-02-22 15:55 ` [PATCH 1/8] drm/ttm: add default implementations for ttm_tt_(un)populate Michel Dänzer
7 siblings, 1 reply; 12+ messages in thread
From: Christian König @ 2018-02-22 11:15 UTC (permalink / raw)
To: dri-devel
TTM calls the default implementation now.
Signed-off-by: Christian König <christian.koenig@amd.com>
---
drivers/gpu/drm/bochs/bochs_mm.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/bochs/bochs_mm.c b/drivers/gpu/drm/bochs/bochs_mm.c
index 704e879711e4..5525b6660340 100644
--- a/drivers/gpu/drm/bochs/bochs_mm.c
+++ b/drivers/gpu/drm/bochs/bochs_mm.c
@@ -196,8 +196,6 @@ static struct ttm_tt *bochs_ttm_tt_create(struct ttm_bo_device *bdev,
struct ttm_bo_driver bochs_bo_driver = {
.ttm_tt_create = bochs_ttm_tt_create,
- .ttm_tt_populate = ttm_pool_populate,
- .ttm_tt_unpopulate = ttm_pool_unpopulate,
.init_mem_type = bochs_bo_init_mem_type,
.eviction_valuable = ttm_bo_eviction_valuable,
.evict_flags = bochs_bo_evict_flags,
--
2.14.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 1/8] drm/ttm: add default implementations for ttm_tt_(un)populate
2018-02-22 11:15 [PATCH 1/8] drm/ttm: add default implementations for ttm_tt_(un)populate Christian König
` (6 preceding siblings ...)
2018-02-22 11:15 ` [PATCH 8/8] drm/bochs: remove the default ttm_tt_populate callbacks Christian König
@ 2018-02-22 15:55 ` Michel Dänzer
2018-02-23 7:39 ` Christian König
7 siblings, 1 reply; 12+ messages in thread
From: Michel Dänzer @ 2018-02-22 15:55 UTC (permalink / raw)
To: Christian König; +Cc: dri-devel
On 2018-02-22 12:15 PM, Christian König wrote:
> Use ttm_pool_populate/ttm_pool_unpopulate if the driver doesn't provide
> a function.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/ttm/ttm_tt.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
> index 9fd7115a013a..65bf4eac184b 100644
> --- a/drivers/gpu/drm/ttm/ttm_tt.c
> +++ b/drivers/gpu/drm/ttm/ttm_tt.c
> @@ -410,7 +410,10 @@ int ttm_tt_populate(struct ttm_tt *ttm, struct ttm_operation_ctx *ctx)
> if (ttm->state != tt_unpopulated)
> return 0;
>
> - ret = ttm->bdev->driver->ttm_tt_populate(ttm, ctx);
> + if (ttm->bdev->driver->ttm_tt_populate)
> + ret = ttm->bdev->driver->ttm_tt_populate(ttm, ctx);
> + else
> + ret = ttm_pool_populate(ttm, ctx);
> if (!ret)
> ttm_tt_add_mapping(ttm);
> return ret;
> @@ -436,5 +439,8 @@ void ttm_tt_unpopulate(struct ttm_tt *ttm)
> return;
>
> ttm_tt_clear_mapping(ttm);
> - ttm->bdev->driver->ttm_tt_unpopulate(ttm);
> + if (ttm->bdev->driver->ttm_tt_unpopulate)
> + ttm->bdev->driver->ttm_tt_unpopulate(ttm);
> + else
> + ttm_pool_unpopulate(ttm);
> }
>
Instead of the if/else, have you considered setting
driver->ttm_tt_(un)populate = ttm_pool_(un)populate during
initialization if they're NULL?
Either way, the series is
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: [PATCH 8/8] drm/bochs: remove the default ttm_tt_populate callbacks
2018-02-22 11:15 ` [PATCH 8/8] drm/bochs: remove the default ttm_tt_populate callbacks Christian König
@ 2018-02-23 3:27 ` He, Roger
0 siblings, 0 replies; 12+ messages in thread
From: He, Roger @ 2018-02-23 3:27 UTC (permalink / raw)
To: Christian König, dri-devel
Series is: Reviewed-by: Roger He <Hongbo.He@amd.com>
-----Original Message-----
From: dri-devel [mailto:dri-devel-bounces@lists.freedesktop.org] On Behalf Of Christian K?nig
Sent: Thursday, February 22, 2018 7:16 PM
To: dri-devel@lists.freedesktop.org
Subject: [PATCH 8/8] drm/bochs: remove the default ttm_tt_populate callbacks
TTM calls the default implementation now.
Signed-off-by: Christian König <christian.koenig@amd.com>
---
drivers/gpu/drm/bochs/bochs_mm.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/bochs/bochs_mm.c b/drivers/gpu/drm/bochs/bochs_mm.c
index 704e879711e4..5525b6660340 100644
--- a/drivers/gpu/drm/bochs/bochs_mm.c
+++ b/drivers/gpu/drm/bochs/bochs_mm.c
@@ -196,8 +196,6 @@ static struct ttm_tt *bochs_ttm_tt_create(struct ttm_bo_device *bdev,
struct ttm_bo_driver bochs_bo_driver = {
.ttm_tt_create = bochs_ttm_tt_create,
- .ttm_tt_populate = ttm_pool_populate,
- .ttm_tt_unpopulate = ttm_pool_unpopulate,
.init_mem_type = bochs_bo_init_mem_type,
.eviction_valuable = ttm_bo_eviction_valuable,
.evict_flags = bochs_bo_evict_flags,
--
2.14.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 1/8] drm/ttm: add default implementations for ttm_tt_(un)populate
2018-02-22 15:55 ` [PATCH 1/8] drm/ttm: add default implementations for ttm_tt_(un)populate Michel Dänzer
@ 2018-02-23 7:39 ` Christian König
2018-02-23 10:04 ` Michel Dänzer
0 siblings, 1 reply; 12+ messages in thread
From: Christian König @ 2018-02-23 7:39 UTC (permalink / raw)
To: Michel Dänzer; +Cc: dri-devel
Am 22.02.2018 um 16:55 schrieb Michel Dänzer:
> On 2018-02-22 12:15 PM, Christian König wrote:
>> Use ttm_pool_populate/ttm_pool_unpopulate if the driver doesn't provide
>> a function.
>>
>> Signed-off-by: Christian König <christian.koenig@amd.com>
>> ---
>> drivers/gpu/drm/ttm/ttm_tt.c | 10 ++++++++--
>> 1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
>> index 9fd7115a013a..65bf4eac184b 100644
>> --- a/drivers/gpu/drm/ttm/ttm_tt.c
>> +++ b/drivers/gpu/drm/ttm/ttm_tt.c
>> @@ -410,7 +410,10 @@ int ttm_tt_populate(struct ttm_tt *ttm, struct ttm_operation_ctx *ctx)
>> if (ttm->state != tt_unpopulated)
>> return 0;
>>
>> - ret = ttm->bdev->driver->ttm_tt_populate(ttm, ctx);
>> + if (ttm->bdev->driver->ttm_tt_populate)
>> + ret = ttm->bdev->driver->ttm_tt_populate(ttm, ctx);
>> + else
>> + ret = ttm_pool_populate(ttm, ctx);
>> if (!ret)
>> ttm_tt_add_mapping(ttm);
>> return ret;
>> @@ -436,5 +439,8 @@ void ttm_tt_unpopulate(struct ttm_tt *ttm)
>> return;
>>
>> ttm_tt_clear_mapping(ttm);
>> - ttm->bdev->driver->ttm_tt_unpopulate(ttm);
>> + if (ttm->bdev->driver->ttm_tt_unpopulate)
>> + ttm->bdev->driver->ttm_tt_unpopulate(ttm);
>> + else
>> + ttm_pool_unpopulate(ttm);
>> }
>>
> Instead of the if/else, have you considered setting
> driver->ttm_tt_(un)populate = ttm_pool_(un)populate during
> initialization if they're NULL?
Mhm, also an interesting possibility. But shouldn't the function
pointers be const?
Christian.
>
>
> Either way, the series is
>
> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
>
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/8] drm/ttm: add default implementations for ttm_tt_(un)populate
2018-02-23 7:39 ` Christian König
@ 2018-02-23 10:04 ` Michel Dänzer
0 siblings, 0 replies; 12+ messages in thread
From: Michel Dänzer @ 2018-02-23 10:04 UTC (permalink / raw)
To: christian.koenig; +Cc: dri-devel
On 2018-02-23 08:39 AM, Christian König wrote:
> Am 22.02.2018 um 16:55 schrieb Michel Dänzer:
>> On 2018-02-22 12:15 PM, Christian König wrote:
>>> Use ttm_pool_populate/ttm_pool_unpopulate if the driver doesn't provide
>>> a function.
>>>
>>> Signed-off-by: Christian König <christian.koenig@amd.com>
>>> ---
>>> drivers/gpu/drm/ttm/ttm_tt.c | 10 ++++++++--
>>> 1 file changed, 8 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
>>> index 9fd7115a013a..65bf4eac184b 100644
>>> --- a/drivers/gpu/drm/ttm/ttm_tt.c
>>> +++ b/drivers/gpu/drm/ttm/ttm_tt.c
>>> @@ -410,7 +410,10 @@ int ttm_tt_populate(struct ttm_tt *ttm, struct
>>> ttm_operation_ctx *ctx)
>>> if (ttm->state != tt_unpopulated)
>>> return 0;
>>> - ret = ttm->bdev->driver->ttm_tt_populate(ttm, ctx);
>>> + if (ttm->bdev->driver->ttm_tt_populate)
>>> + ret = ttm->bdev->driver->ttm_tt_populate(ttm, ctx);
>>> + else
>>> + ret = ttm_pool_populate(ttm, ctx);
>>> if (!ret)
>>> ttm_tt_add_mapping(ttm);
>>> return ret;
>>> @@ -436,5 +439,8 @@ void ttm_tt_unpopulate(struct ttm_tt *ttm)
>>> return;
>>> ttm_tt_clear_mapping(ttm);
>>> - ttm->bdev->driver->ttm_tt_unpopulate(ttm);
>>> + if (ttm->bdev->driver->ttm_tt_unpopulate)
>>> + ttm->bdev->driver->ttm_tt_unpopulate(ttm);
>>> + else
>>> + ttm_pool_unpopulate(ttm);
>>> }
>>>
>> Instead of the if/else, have you considered setting
>> driver->ttm_tt_(un)populate = ttm_pool_(un)populate during
>> initialization if they're NULL?
>
> Mhm, also an interesting possibility. But shouldn't the function
> pointers be const?
I guess that might be nice.
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2018-02-23 10:04 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-22 11:15 [PATCH 1/8] drm/ttm: add default implementations for ttm_tt_(un)populate Christian König
2018-02-22 11:15 ` [PATCH 2/8] drm/virtio: remove ttm_pool_* wrappers Christian König
2018-02-22 11:15 ` [PATCH 3/8] drm/mgag200: " Christian König
2018-02-22 11:15 ` [PATCH 4/8] drm/hisilicon: " Christian König
2018-02-22 11:15 ` [PATCH 5/8] drm/ast: " Christian König
2018-02-22 11:15 ` [PATCH 6/8] drm/qxl: " Christian König
2018-02-22 11:15 ` [PATCH 7/8] drm/cirrus: " Christian König
2018-02-22 11:15 ` [PATCH 8/8] drm/bochs: remove the default ttm_tt_populate callbacks Christian König
2018-02-23 3:27 ` He, Roger
2018-02-22 15:55 ` [PATCH 1/8] drm/ttm: add default implementations for ttm_tt_(un)populate Michel Dänzer
2018-02-23 7:39 ` Christian König
2018-02-23 10:04 ` Michel Dänzer
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.