dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Benoit Parrot <bparrot@ti.com>,
	dri-devel@lists.freedesktop.org,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Rob Clark <robdclark@gmail.com>, Daniel Vetter <daniel@ffwll.ch>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>, Jyri Sarha <jsarha@ti.com>
Subject: Re: [RFC 1/3] drm/omap: Add ability to check if requested plane modes can be supported
Date: Thu, 2 Aug 2018 12:03:20 +0300	[thread overview]
Message-ID: <16739b2e-4534-992d-9ce1-bb2ffbe15094@ti.com> (raw)
In-Reply-To: <20180629170249.21921-2-bparrot@ti.com>

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@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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-08-02  9:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-29 17:02 [RFC 0/3] drm/omap: Add virtual wide planes support Benoit Parrot
2018-06-29 17:02 ` [RFC 1/3] drm/omap: Add ability to check if requested plane modes can be supported Benoit Parrot
2018-08-02  9:03   ` Tomi Valkeinen [this message]
2018-06-29 17:02 ` [RFC 2/3] drm/omap: Add ovl checking funcs to dispc_ops Benoit Parrot
2018-06-29 17:02 ` [RFC 3/3] drm/omap: Add wide display support using multiple overlays Benoit Parrot
2018-08-02 10:09   ` Tomi Valkeinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16739b2e-4534-992d-9ce1-bb2ffbe15094@ti.com \
    --to=tomi.valkeinen@ti.com \
    --cc=bparrot@ti.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jsarha@ti.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=peter.ujfalusi@ti.com \
    --cc=robdclark@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox