[PATCH v4 1/7] drm/format-helper: Cache buffers with struct drm_format_conv_state

Javier Martinez Canillas javierm at redhat.com
Thu Oct 5 15:26:49 UTC 2023


Thomas Zimmermann <tzimmermann at suse.de> writes:

> Hi
>

[...]

>> 
>> I'm confused, the copy helper is the same than init. What's the point of
>> this function ? Why not just call drm_format_conv_state_init() from the
>> __drm_gem_duplicate_shadow_plane_state() function in the next patch ?
>
> I guess that deserves a comment in the code. The reserved buffer is not 
> to be copied to another state. So we just clear the fields. But in the 
> future, we will likely be extra fields, such as the aforementioned 
> palette data, that will be copied. It's just that these fields don't 
> exist yet. Hence the copy function is different from the init.
>

Maybe the change is premature then and we could do once the palette data
(or any other field is added) ? But I am also OK with just a comment that
explains the reason for this function.

> Best regards
> Thomas
>

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



More information about the dri-devel mailing list