diff mbox series

[v2,04/11] drm/tegra: Set fbdev FBINFO_VIRTFB flag

Message ID 20230706124905.15134-5-tzimmermann@suse.de (mailing list archive)
State New, archived
Headers show
Series drm: Improve fbdev emulation for DMA-able framebuffers | expand

Commit Message

Thomas Zimmermann July 6, 2023, 12:46 p.m. UTC
Mark the framebuffer with FBINFO_VIRTFB. The framebuffer range is
in DMA-able memory and should be accessed with the CPU's regular
memory ops.

v2:
	* drop FBINFO_DEFAULT

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Mikko Perttunen <mperttunen@nvidia.com>
---
 drivers/gpu/drm/tegra/fbdev.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Thierry Reding July 6, 2023, 2:31 p.m. UTC | #1
On Thu, Jul 06, 2023 at 02:46:42PM +0200, Thomas Zimmermann wrote:
> Mark the framebuffer with FBINFO_VIRTFB. The framebuffer range is
> in DMA-able memory and should be accessed with the CPU's regular
> memory ops.
> 
> v2:
> 	* drop FBINFO_DEFAULT
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
> Acked-by: Maxime Ripard <mripard@kernel.org>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Mikko Perttunen <mperttunen@nvidia.com>
> ---
>  drivers/gpu/drm/tegra/fbdev.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/tegra/fbdev.c b/drivers/gpu/drm/tegra/fbdev.c
> index 82577b7c88da..d8460c5dc91e 100644
> --- a/drivers/gpu/drm/tegra/fbdev.c
> +++ b/drivers/gpu/drm/tegra/fbdev.c
> @@ -132,6 +132,7 @@ static int tegra_fbdev_probe(struct drm_fb_helper *helper,
>  		}
>  	}
>  
> +	info->flags |= FBINFO_VIRTFB;
>  	info->screen_base = (void __iomem *)bo->vaddr + offset;

As part of this, do we also need to set info->screen_buffer instead of
info->screen_base? The drm_fbdev_dma_helper functions do that.

Thierry

>  	info->screen_size = size;
>  	info->fix.smem_start = (unsigned long)(bo->iova + offset);
> -- 
> 2.41.0
>
Thomas Zimmermann July 6, 2023, 2:47 p.m. UTC | #2
Hi

Am 06.07.23 um 16:31 schrieb Thierry Reding:
> On Thu, Jul 06, 2023 at 02:46:42PM +0200, Thomas Zimmermann wrote:
>> Mark the framebuffer with FBINFO_VIRTFB. The framebuffer range is
>> in DMA-able memory and should be accessed with the CPU's regular
>> memory ops.
>>
>> v2:
>> 	* drop FBINFO_DEFAULT
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
>> Acked-by: Maxime Ripard <mripard@kernel.org>
>> Cc: Thierry Reding <thierry.reding@gmail.com>
>> Cc: Mikko Perttunen <mperttunen@nvidia.com>
>> ---
>>   drivers/gpu/drm/tegra/fbdev.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/gpu/drm/tegra/fbdev.c b/drivers/gpu/drm/tegra/fbdev.c
>> index 82577b7c88da..d8460c5dc91e 100644
>> --- a/drivers/gpu/drm/tegra/fbdev.c
>> +++ b/drivers/gpu/drm/tegra/fbdev.c
>> @@ -132,6 +132,7 @@ static int tegra_fbdev_probe(struct drm_fb_helper *helper,
>>   		}
>>   	}
>>   
>> +	info->flags |= FBINFO_VIRTFB;
>>   	info->screen_base = (void __iomem *)bo->vaddr + offset;
> 
> As part of this, do we also need to set info->screen_buffer instead of
> info->screen_base? The drm_fbdev_dma_helper functions do that.

Indeed, good point. I'll update this in the next iteration.

Best regards
Thomas

> 
> Thierry
> 
>>   	info->screen_size = size;
>>   	info->fix.smem_start = (unsigned long)(bo->iova + offset);
>> -- 
>> 2.41.0
>>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/tegra/fbdev.c b/drivers/gpu/drm/tegra/fbdev.c
index 82577b7c88da..d8460c5dc91e 100644
--- a/drivers/gpu/drm/tegra/fbdev.c
+++ b/drivers/gpu/drm/tegra/fbdev.c
@@ -132,6 +132,7 @@  static int tegra_fbdev_probe(struct drm_fb_helper *helper,
 		}
 	}
 
+	info->flags |= FBINFO_VIRTFB;
 	info->screen_base = (void __iomem *)bo->vaddr + offset;
 	info->screen_size = size;
 	info->fix.smem_start = (unsigned long)(bo->iova + offset);