[PATCH v3 1/3] drm/framebuffer: Check for valid formats

Simon Ser contact at emersion.fr
Fri Jan 13 17:04:15 UTC 2023


On Friday, January 13th, 2023 at 17:59, Maíra Canal <mcanal at igalia.com> wrote:

> +	/* Verify that the modifier is supported. */
> +	if (r->modifier[0] && drm_drv_uses_atomic_modeset(dev) &&
> +	    !drm_any_plane_has_format(dev, r->pixel_format, r->modifier[0])) {
> +		drm_dbg_kms(dev, "Unsupported pixel format %p4cc / modifier 0x%llx\n",
> +			    &r->pixel_format, r->modifier[0]);
> +		return -EINVAL;
> +	}

User-space indicates whether there is a modifier in the IOCTL data by supplying
the DRM_MODE_FB_MODIFIERS flag. I believe we need to check that flag instead of
r->modifier[0]: the zero modifier is a valid modifier (LINEAR).


More information about the dri-devel mailing list