Re: [Xen-devel] [PATCH 1/9] mm: Introduce new vm_insert_range API

2018-11-28 Thread Heiko Stübner
Am Donnerstag, 15. November 2018, 16:45:30 CET schrieb Souptick Joarder:
> Previouly drivers have their own way of mapping range of
> kernel pages/memory into user vma and this was done by
> invoking vm_insert_page() within a loop.
> 
> As this pattern is common across different drivers, it can
> be generalized by creating a new function and use it across
> the drivers.
> 
> vm_insert_range is the new API which will be used to map a
> range of kernel memory/pages to user vma.
> 
> Signed-off-by: Souptick Joarder 
> Reviewed-by: Matthew Wilcox 

Except the missing EXPORT_SYMBOL for module builds this new
API is supposed to run also within the Rockchip drm driver, so
on rk3188, rk3288, rk3328 and rk3399 with graphics
Tested-by: Heiko Stuebner 




___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [PATCH v2 19/25] drm/rockchip: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-01-09 Thread Heiko Stübner
Am Donnerstag, 9. Januar 2025, 15:57:13 CET schrieb Thomas Zimmermann:
> Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and
> buffer size. Align the pitch to a multiple of 64.
> 
> Signed-off-by: Thomas Zimmermann 
> Cc: Sandy Huang 
> Cc: "Heiko Stübner" 
> Cc: Andy Yan 

I've looked up the patch implementing the new functionality - patch2 of
this series [0] and that looks really nice to get proper helpers and not
having many drivers open-coding the same functionality in different ways.

So for the Rockchip adaptation:

Acked-by: Heiko Stuebner 

and looking forward to this getting merged :-)

Thanks a lot for working on that
Heiko

[0] 
https://patchwork.kernel.org/project/linux-rockchip/patch/20250109150310.219442-3-tzimmerm...@suse.de/

> ---
>  drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c 
> b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
> index 6330b883efc3..3bd06202e232 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
> @@ -9,6 +9,7 @@
>  #include 
>  
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -403,13 +404,12 @@ int rockchip_gem_dumb_create(struct drm_file *file_priv,
>struct drm_mode_create_dumb *args)
>  {
>   struct rockchip_gem_object *rk_obj;
> - int min_pitch = DIV_ROUND_UP(args->width * args->bpp, 8);
> + int ret;
>  
> - /*
> -  * align to 64 bytes since Mali requires it.
> -  */
> - args->pitch = ALIGN(min_pitch, 64);
> - args->size = args->pitch * args->height;
> + /* 64-byte alignment required by Mali */
> + ret = drm_mode_size_dumb(dev, args, SZ_64, 0);
> + if (ret)
> + return ret;
>  
>   rk_obj = rockchip_gem_create_with_handle(file_priv, dev, args->size,
>&args->handle);
>