[RFC 1/3] drm/omap: Add ability to check if requested plane modes can be supported

Tomi Valkeinen tomi.valkeinen at ti.com
Thu Aug 2 09:03:20 UTC 2018


Hi,

On 29/06/18 20:02, Benoit Parrot wrote:
> We currently assumed that an overlay has the same width and height as

same _maximum_.

> the overlay manager. This assumption is incorrect. On some variant the
> overlay manager is twice the width that the overlay can handle. We need

The maximum width supported is twice the max width that an overlay can
handle.

> to add the appropriate data per variant as well as export a helper
> function to retrieve the data so check can be made dynamically. We
> currently add such a check in the dispc_ovl_setup() which will return an
> error along with a WARN in case the required width exceed the overlay's
> ability.
> 
> Signed-off-by: Benoit Parrot <bparrot at ti.com>
> ---
>  drivers/gpu/drm/omapdrm/dss/dispc.c   | 29 +++++++++++++++++++++++++++++
>  drivers/gpu/drm/omapdrm/dss/omapdss.h |  2 ++
>  2 files changed, 31 insertions(+)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
> index cfdcc3681494..1b7a6ef7897f 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dispc.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
> @@ -103,6 +103,8 @@ struct dispc_features {
>  	u8 mgr_height_start;
>  	u16 mgr_width_max;
>  	u16 mgr_height_max;
> +	u16 ovl_width_max;
> +	u16 ovl_height_max;
>  	unsigned long max_lcd_pclk;
>  	unsigned long max_tv_pclk;
>  	unsigned int max_downscale;
> @@ -2605,6 +2607,13 @@ static int dispc_ovl_calc_scaling(struct dispc_device *dispc,
>  	return 0;
>  }
>  
> +static void dispc_ovl_get_max_size(struct dispc_device *dispc,
> +				   u16 *width, u16 *height)
> +{
> +	*width = dispc->feat->ovl_width_max;
> +	*height = dispc->feat->ovl_height_max;
> +}
> +
>  static int dispc_ovl_setup_common(struct dispc_device *dispc,
>  				  enum omap_plane_id plane,
>  				  enum omap_overlay_caps caps,
> @@ -2648,6 +2657,11 @@ static int dispc_ovl_setup_common(struct dispc_device *dispc,
>  	out_width = out_width == 0 ? width : out_width;
>  	out_height = out_height == 0 ? height : out_height;
>  
> +	if (WARN(out_width > dispc->feat->ovl_width_max,
> +		 "Requested OVL width (%d) is larger than can be supported (%d).\n",
> +		 out_width, dispc->feat->ovl_width_max))
> +		return -EINVAL;

We should do this check in the omap_plane_atomic_check().

 Tomi

-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki


More information about the dri-devel mailing list