Re: [PATCH 2/8] fbdev/udlfb: Use fb_ops helpers for deferred I/O

2023-09-04 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Am 04.09.23 um 15:05 schrieb Javier Martinez Canillas:
>> Thomas Zimmermann  writes:
>> 
>>> Generate callback functions for struct fb_ops with the fbdev macro
>>> FB_GEN_DEFAULT_DEFERRED_SYSMEM_OPS(). Initialize struct fb_ops to
>>> the generated functions with fbdev initializer macros.
>>>
>>> Signed-off-by: Thomas Zimmermann 
>>> Cc: Bernie Thompson 
>>> ---
>> 
>> Acked-by: Javier Martinez Canillas 
>> 
>> [...]
>> 
>>> +static void dlfb_ops_damage_range(struct fb_info *info, off_t off, size_t 
>>> len)
>>> +{
>>> +   struct dlfb_data *dlfb = info->par;
>>> +   int start = max((int)(off / info->fix.line_length), 0);
>>> +   int lines = min((u32)((len / info->fix.line_length) + 1), 
>>> (u32)info->var.yres);
>>> +
>>> +   dlfb_handle_damage(dlfb, 0, start, info->var.xres, lines);
>>> +}
>>> +
>>> +static void dlfb_ops_damage_area(struct fb_info *info, u32 x, u32 y, u32 
>>> width, u32 height)
>>> +{
>>> +   struct dlfb_data *dlfb = info->par;
>>> +
>>> +   dlfb_offload_damage(dlfb, x, y, width, height);
>>> +}
>>> +
>> 
>> These two are very similar to the helpers you added for the smscufx driver
>> in patch #1. I guess there's room for further consolidation as follow-up ?
>
> Maybe. I had patches that take the rectangle computation from [1] and 
> turn it into a helper for these USB drivers. But it's an unrelated 
> change, so I dropped them from this patchset.
>

Great and yes, I meant as separate patch-set, not as a part of this one.

> Best regards
> Thomas
>

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH 2/8] fbdev/udlfb: Use fb_ops helpers for deferred I/O

2023-09-04 Thread Thomas Zimmermann



Am 04.09.23 um 15:05 schrieb Javier Martinez Canillas:

Thomas Zimmermann  writes:


Generate callback functions for struct fb_ops with the fbdev macro
FB_GEN_DEFAULT_DEFERRED_SYSMEM_OPS(). Initialize struct fb_ops to
the generated functions with fbdev initializer macros.

Signed-off-by: Thomas Zimmermann 
Cc: Bernie Thompson 
---


Acked-by: Javier Martinez Canillas 

[...]


+static void dlfb_ops_damage_range(struct fb_info *info, off_t off, size_t len)
+{
+   struct dlfb_data *dlfb = info->par;
+   int start = max((int)(off / info->fix.line_length), 0);
+   int lines = min((u32)((len / info->fix.line_length) + 1), 
(u32)info->var.yres);
+
+   dlfb_handle_damage(dlfb, 0, start, info->var.xres, lines);
+}
+
+static void dlfb_ops_damage_area(struct fb_info *info, u32 x, u32 y, u32 
width, u32 height)
+{
+   struct dlfb_data *dlfb = info->par;
+
+   dlfb_offload_damage(dlfb, x, y, width, height);
+}
+


These two are very similar to the helpers you added for the smscufx driver
in patch #1. I guess there's room for further consolidation as follow-up ?


Maybe. I had patches that take the rectangle computation from [1] and 
turn it into a helper for these USB drivers. But it's an unrelated 
change, so I dropped them from this patchset.


Best regards
Thomas

[1] 
https://elixir.bootlin.com/linux/v6.5.1/source/drivers/gpu/drm/drm_fb_helper.c#L641






--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)


OpenPGP_signature
Description: OpenPGP digital signature


Re: [PATCH 2/8] fbdev/udlfb: Use fb_ops helpers for deferred I/O

2023-09-04 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Generate callback functions for struct fb_ops with the fbdev macro
> FB_GEN_DEFAULT_DEFERRED_SYSMEM_OPS(). Initialize struct fb_ops to
> the generated functions with fbdev initializer macros.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Bernie Thompson 
> ---

Acked-by: Javier Martinez Canillas 

[...]

> +static void dlfb_ops_damage_range(struct fb_info *info, off_t off, size_t 
> len)
> +{
> + struct dlfb_data *dlfb = info->par;
> + int start = max((int)(off / info->fix.line_length), 0);
> + int lines = min((u32)((len / info->fix.line_length) + 1), 
> (u32)info->var.yres);
> +
> + dlfb_handle_damage(dlfb, 0, start, info->var.xres, lines);
> +}
> +
> +static void dlfb_ops_damage_area(struct fb_info *info, u32 x, u32 y, u32 
> width, u32 height)
> +{
> + struct dlfb_data *dlfb = info->par;
> +
> + dlfb_offload_damage(dlfb, x, y, width, height);
> +}
> +

These two are very similar to the helpers you added for the smscufx driver
in patch #1. I guess there's room for further consolidation as follow-up ?

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat