[PATCH v2 3/8] drm: vkms: Replace hardcoded value of `vkms_composer.map` to DRM_FORMAT_MAX_PLANES

Thomas Zimmermann tzimmermann at suse.de
Wed Nov 3 15:40:24 UTC 2021


Hi

Am 26.10.21 um 13:34 schrieb Igor Torrente:
> The `map` vector at `vkms_composer` uses a hardcoded value to define its
> size.
> 
> If someday the maximum number of planes increases, this hardcoded value
> can be a problem.
> 
> This value is being replaced with the DRM_FORMAT_MAX_PLANES macro.
> 
> Signed-off-by: Igor Torrente <igormtorrente at gmail.com>

Acked-by: Thomas Zimmermann <tzimmermann at suse.de>

We can merge that immediately.

Best regards
Thomas

> ---
>   drivers/gpu/drm/vkms/vkms_drv.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/vkms/vkms_drv.h b/drivers/gpu/drm/vkms/vkms_drv.h
> index d48c23d40ce5..64e62993b06f 100644
> --- a/drivers/gpu/drm/vkms/vkms_drv.h
> +++ b/drivers/gpu/drm/vkms/vkms_drv.h
> @@ -28,7 +28,7 @@ struct vkms_writeback_job {
>   struct vkms_composer {
>   	struct drm_framebuffer fb;
>   	struct drm_rect src, dst;
> -	struct dma_buf_map map[4];
> +	struct dma_buf_map map[DRM_FORMAT_MAX_PLANES];
>   	unsigned int offset;
>   	unsigned int pitch;
>   	unsigned int cpp;
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20211103/aea86f61/attachment-0001.sig>


More information about the dri-devel mailing list