diff mbox series

[4/7] drm/vmwgfx: switch to ttm_sg_tt_init

Message ID 20201125125919.1372-4-christian.koenig@amd.com (mailing list archive)
State New, archived
Headers show
Series [1/7] drm/radeon: stop using pages with drm_prime_sg_to_page_addr_arrays v2 | expand

Commit Message

Christian König Nov. 25, 2020, 12:59 p.m. UTC
According to Daniel VMWGFX doesn't support DMA-buf anyway.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Zack Rusin Nov. 30, 2020, 8:56 p.m. UTC | #1
> On Nov 25, 2020, at 07:59, Christian König <ckoenig.leichtzumerken@gmail.com> wrote:
> 
> According to Daniel VMWGFX doesn't support DMA-buf anyway.
> 
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
> index 6a04261ce760..1c75f73538c0 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
> @@ -611,8 +611,8 @@ static struct ttm_tt *vmw_ttm_tt_create(struct ttm_buffer_object *bo,
> 	vmw_be->mob = NULL;
> 
> 	if (vmw_be->dev_priv->map_mode == vmw_dma_alloc_coherent)
> -		ret = ttm_dma_tt_init(&vmw_be->dma_ttm, bo, page_flags,
> -				      ttm_cached);
> +		ret = ttm_sg_tt_init(&vmw_be->dma_ttm, bo, page_flags,
> +				     ttm_cached);
> 	else
> 		ret = ttm_tt_init(&vmw_be->dma_ttm, bo, page_flags,
> 				  ttm_cached);

A little bit more info would be much appreciated, it’s hard to tell from the message log what’s going on. Is the assumption that since vmwgfx doesn’t support dmabuf it will never use ttm_bo_type_sg or TTM_PAGE_FLAG_SG and ttm_sg_tt_init will still endup calling ttm_dma_tt_alloc_page_directory to setup the ttm_tt::pages?

If so:
Reviewed-by: Zack Rusin <zackr@vmware.com>

z
Christian König Dec. 1, 2020, 7:08 p.m. UTC | #2
Am 30.11.20 um 21:56 schrieb Zack Rusin:
>
>> On Nov 25, 2020, at 07:59, Christian König <ckoenig.leichtzumerken@gmail.com> wrote:
>>
>> According to Daniel VMWGFX doesn't support DMA-buf anyway.
>>
>> Signed-off-by: Christian König <christian.koenig@amd.com>
>> ---
>> drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
>> index 6a04261ce760..1c75f73538c0 100644
>> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
>> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
>> @@ -611,8 +611,8 @@ static struct ttm_tt *vmw_ttm_tt_create(struct ttm_buffer_object *bo,
>> 	vmw_be->mob = NULL;
>>
>> 	if (vmw_be->dev_priv->map_mode == vmw_dma_alloc_coherent)
>> -		ret = ttm_dma_tt_init(&vmw_be->dma_ttm, bo, page_flags,
>> -				      ttm_cached);
>> +		ret = ttm_sg_tt_init(&vmw_be->dma_ttm, bo, page_flags,
>> +				     ttm_cached);
>> 	else
>> 		ret = ttm_tt_init(&vmw_be->dma_ttm, bo, page_flags,
>> 				  ttm_cached);
> A little bit more info would be much appreciated, it’s hard to tell from the message log what’s going on. Is the assumption that since vmwgfx doesn’t support dmabuf it will never use ttm_bo_type_sg or TTM_PAGE_FLAG_SG and ttm_sg_tt_init will still endup calling ttm_dma_tt_alloc_page_directory to setup the ttm_tt::pages?

Yes, exactly that's the idea.

> If so:
> Reviewed-by: Zack Rusin <zackr@vmware.com>

Thanks,
Christian.

>
> z
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
index 6a04261ce760..1c75f73538c0 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
@@ -611,8 +611,8 @@  static struct ttm_tt *vmw_ttm_tt_create(struct ttm_buffer_object *bo,
 	vmw_be->mob = NULL;
 
 	if (vmw_be->dev_priv->map_mode == vmw_dma_alloc_coherent)
-		ret = ttm_dma_tt_init(&vmw_be->dma_ttm, bo, page_flags,
-				      ttm_cached);
+		ret = ttm_sg_tt_init(&vmw_be->dma_ttm, bo, page_flags,
+				     ttm_cached);
 	else
 		ret = ttm_tt_init(&vmw_be->dma_ttm, bo, page_flags,
 				  ttm_cached);