[PATCH 4/5] drm/vmwgfx: Remove redundant framebuffer format check

Zack Rusin zackr at vmware.com
Thu Jan 12 02:52:37 UTC 2023


On Mon, 2023-01-09 at 07:58 -0300, Maíra Canal wrote:
> Now that framebuffer_check() verifies that the format is properly
> supported, there is no need to check it again on vmwgfx's inside
> helpers.
> 
> Therefore, remove the redundant framebuffer format check from the
> vmw_kms_new_framebuffer_surface() and vmw_kms_new_framebuffer_bo()
> functions, letting framebuffer_check() perform the framebuffer
> validation.
> 
> Signed-off-by: Maíra Canal <mcanal at igalia.com>
> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 18 ------------------
>  1 file changed, 18 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> index 257f090071f1..05b8d8f912bf 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> @@ -1317,15 +1317,6 @@ static int vmw_kms_new_framebuffer_surface(struct
> vmw_private *dev_priv,
>          * Sanity checks.
>          */
>  
> -       if (!drm_any_plane_has_format(&dev_priv->drm,
> -                                     mode_cmd->pixel_format,
> -                                     mode_cmd->modifier[0])) {
> -               drm_dbg(&dev_priv->drm,
> -                       "unsupported pixel format %p4cc / modifier 0x%llx\n",
> -                       &mode_cmd->pixel_format, mode_cmd->modifier[0]);
> -               return -EINVAL;
> -       }
> -
>         /* Surface must be marked as a scanout. */
>         if (unlikely(!surface->metadata.scanout))
>                 return -EINVAL;
> @@ -1648,15 +1639,6 @@ static int vmw_kms_new_framebuffer_bo(struct vmw_private
> *dev_priv,
>                 return -EINVAL;
>         }
>  
> -       if (!drm_any_plane_has_format(&dev_priv->drm,
> -                                     mode_cmd->pixel_format,
> -                                     mode_cmd->modifier[0])) {
> -               drm_dbg(&dev_priv->drm,
> -                       "unsupported pixel format %p4cc / modifier 0x%llx\n",
> -                       &mode_cmd->pixel_format, mode_cmd->modifier[0]);
> -               return -EINVAL;
> -       }
> -
>         vfbd = kzalloc(sizeof(*vfbd), GFP_KERNEL);
>         if (!vfbd) {
>                 ret = -ENOMEM;

That's a nice cleanup. Thanks.

Reviewed-by: Zack Rusin <zackr at vmware.com>


More information about the dri-devel mailing list