All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Eric Anholt <eric@anholt.net>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/6] drm/vc4: Make sure that planes aren't scaled.
Date: Fri, 23 Oct 2015 13:24:56 +0200	[thread overview]
Message-ID: <20151023112456.GO16848@phenom.ffwll.local> (raw)
In-Reply-To: <1445596356-28202-6-git-send-email-eric@anholt.net>

On Fri, Oct 23, 2015 at 11:32:35AM +0100, Eric Anholt wrote:
> We would scan out the memory around them if an upscale was attempted,
> and would just scan out incorrectly for downscaling.
> 
> Signed-off-by: Eric Anholt <eric@anholt.net>
> ---
> 
> It looks like, while modetest only wants to set scaling on overlay
> planes, one could do so on our primary/cursor planes if the fd was in
> universal planes mode.
> 
>  drivers/gpu/drm/vc4/vc4_plane.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
> index 2db5092..887f3ca 100644
> --- a/drivers/gpu/drm/vc4/vc4_plane.c
> +++ b/drivers/gpu/drm/vc4/vc4_plane.c
> @@ -157,6 +157,16 @@ static int vc4_plane_mode_set(struct drm_plane *plane,
>  	int crtc_w = state->crtc_w;
>  	int crtc_h = state->crtc_h;
>  
> +	if (state->crtc_w << 16 != state->src_w ||
> +	    state->crtc_h << 16 != state->src_h) {
> +		/* We don't support scaling yet, which involves
> +		 * allocating the LBM memory for scaling temporary
> +		 * storage, and putting filter kernels in the HVS
> +		 * context.
> +		 */
> +		return -EINVAL;
> +	}

Just aside: There's drm_plane_helper_check_update for the common cases.
Unfortunately it suffers a bit from a bikeshed since it wants struct
drm_rect but atomic states don't give you that.
-Daniel

> +
>  	if (crtc_x < 0) {
>  		offset += drm_format_plane_cpp(fb->pixel_format, 0) * -crtc_x;
>  		crtc_w += crtc_x;
> -- 
> 2.6.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

WARNING: multiple messages have this Message-ID (diff)
From: Daniel Vetter <daniel@ffwll.ch>
To: Eric Anholt <eric@anholt.net>
Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 5/6] drm/vc4: Make sure that planes aren't scaled.
Date: Fri, 23 Oct 2015 13:24:56 +0200	[thread overview]
Message-ID: <20151023112456.GO16848@phenom.ffwll.local> (raw)
In-Reply-To: <1445596356-28202-6-git-send-email-eric@anholt.net>

On Fri, Oct 23, 2015 at 11:32:35AM +0100, Eric Anholt wrote:
> We would scan out the memory around them if an upscale was attempted,
> and would just scan out incorrectly for downscaling.
> 
> Signed-off-by: Eric Anholt <eric@anholt.net>
> ---
> 
> It looks like, while modetest only wants to set scaling on overlay
> planes, one could do so on our primary/cursor planes if the fd was in
> universal planes mode.
> 
>  drivers/gpu/drm/vc4/vc4_plane.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
> index 2db5092..887f3ca 100644
> --- a/drivers/gpu/drm/vc4/vc4_plane.c
> +++ b/drivers/gpu/drm/vc4/vc4_plane.c
> @@ -157,6 +157,16 @@ static int vc4_plane_mode_set(struct drm_plane *plane,
>  	int crtc_w = state->crtc_w;
>  	int crtc_h = state->crtc_h;
>  
> +	if (state->crtc_w << 16 != state->src_w ||
> +	    state->crtc_h << 16 != state->src_h) {
> +		/* We don't support scaling yet, which involves
> +		 * allocating the LBM memory for scaling temporary
> +		 * storage, and putting filter kernels in the HVS
> +		 * context.
> +		 */
> +		return -EINVAL;
> +	}

Just aside: There's drm_plane_helper_check_update for the common cases.
Unfortunately it suffers a bit from a bikeshed since it wants struct
drm_rect but atomic states don't give you that.
-Daniel

> +
>  	if (crtc_x < 0) {
>  		offset += drm_format_plane_cpp(fb->pixel_format, 0) * -crtc_x;
>  		crtc_w += crtc_x;
> -- 
> 2.6.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2015-10-23 11:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-23 10:32 VC4 fixes for -next Eric Anholt
2015-10-23 10:32 ` Eric Anholt
2015-10-23 10:32 ` [PATCH 1/6] drm/vc4: vc4_plane_duplicate_state() can be static Eric Anholt
2015-10-23 10:32   ` Eric Anholt
2015-10-23 10:32 ` [PATCH 2/6] drm/vc4: fix platform_no_drv_owner.cocci warnings Eric Anholt
2015-10-23 10:32   ` Eric Anholt
2015-10-23 10:32 ` [PATCH 3/6] drm/vc4: fix itnull.cocci warnings Eric Anholt
2015-10-23 10:32 ` [PATCH 4/6] drm/vc4: Fix some failure to track __iomem decorations on pointers Eric Anholt
2015-10-23 10:32   ` Eric Anholt
2015-10-23 14:04   ` Ilia Mirkin
2015-10-23 16:34     ` Eric Anholt
2015-10-23 10:32 ` [PATCH 5/6] drm/vc4: Make sure that planes aren't scaled Eric Anholt
2015-10-23 10:32   ` Eric Anholt
2015-10-23 11:24   ` Daniel Vetter [this message]
2015-10-23 11:24     ` Daniel Vetter
2015-10-23 10:32 ` [PATCH 6/6] drm/vc4: Add support for more a few more RGB display plane formats Eric Anholt
2015-10-23 10:32   ` Eric Anholt

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=20151023112456.GO16848@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eric@anholt.net \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.