Linux Samsung SOC development
 help / color / mirror / Atom feed
From: Joonyoung Shim <jy0922.shim@samsung.com>
To: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>,
	linux-samsung-soc@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 3/3] drm/exynos: mixer: add 2x scaling to mixer_graph_buffer
Date: Tue, 07 Apr 2015 16:10:48 +0900	[thread overview]
Message-ID: <552382F8.1000803@samsung.com> (raw)
In-Reply-To: <1428362092-29826-4-git-send-email-tjakobi@math.uni-bielefeld.de>

Hi,

On 04/07/2015 08:14 AM, Tobias Jakobi wrote:
> While the VP (video processor) supports arbitrary scaling
> of its input, the mixer just supports a simple 2x (line
> doubling) scaling. Expose this functionality and exit
> early when an unsupported scaling configuration is
> encountered.
> 
> This was tested with modetest's DRM plane test (from
> the libdrm test suite) on an Odroid-X2 (Exynos4412).
> 
> v2: Put if- and return-statement on different lines.
> 
> Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
> ---
>  drivers/gpu/drm/exynos/exynos_mixer.c | 36 +++++++++++++++++++++++++++++------
>  1 file changed, 30 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
> index 5ab0e32..f51011e 100644
> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
> @@ -499,12 +499,36 @@ static void mixer_layer_update(struct mixer_context *ctx)
>  	mixer_reg_writemask(res, MXR_CFG, ~0, MXR_CFG_LAYER_UPDATE);
>  }
>  
> +static int mixer_setup_scale(const struct exynos_drm_plane *plane,
> +		unsigned int *x_ratio, unsigned int *y_ratio)
> +{
> +	if (plane->crtc_width != plane->src_width) {
> +		if (plane->crtc_width == 2 * plane->src_width)
> +			*x_ratio = 1;
> +		else
> +			goto fail;
> +	}
> +
> +	if (plane->crtc_height != plane->src_height) {
> +		if (plane->crtc_height == 2 * plane->src_height)
> +			*y_ratio = 1;
> +		else
> +			goto fail;
> +	}
> +
> +	return 0;
> +
> +fail:
> +	DRM_DEBUG_KMS("only 2x width/height scaling of plane supported\n");
> +	return -ENOTSUPP;
> +}
> +
>  static void mixer_graph_buffer(struct mixer_context *ctx, int win)
>  {
>  	struct mixer_resources *res = &ctx->mixer_res;
>  	unsigned long flags;
>  	struct exynos_drm_plane *plane;
> -	unsigned int x_ratio, y_ratio;
> +	unsigned int x_ratio = 0, y_ratio = 0;
>  	unsigned int src_x_offset, src_y_offset, dst_x_offset, dst_y_offset;
>  	dma_addr_t dma_addr;
>  	unsigned int fmt;
> @@ -528,9 +552,9 @@ static void mixer_graph_buffer(struct mixer_context *ctx, int win)
>  		fmt = ARGB8888;
>  	}
>  
> -	/* 2x scaling feature */
> -	x_ratio = 0;
> -	y_ratio = 0;
> +	/* check if mixer supports requested scaling setup */
> +	if (mixer_setup_scale(plane, &x_ratio, &y_ratio))
> +		return;
>  
>  	dst_x_offset = plane->crtc_x;
>  	dst_y_offset = plane->crtc_y;
> @@ -566,8 +590,8 @@ static void mixer_graph_buffer(struct mixer_context *ctx, int win)
>  		mixer_reg_write(res, MXR_RESOLUTION, val);
>  	}
>  
> -	val  = MXR_GRP_WH_WIDTH(plane->crtc_width);
> -	val |= MXR_GRP_WH_HEIGHT(plane->crtc_height);
> +	val  = MXR_GRP_WH_WIDTH(plane->src_width);
> +	val |= MXR_GRP_WH_HEIGHT(plane->src_height);

With this changes, i got errors when crtc gets out bound of actual
screen area. I sent patch to fix it and to calculate ratio from
exynos_drm plane codes.

Acked-by: Joonyoung Shim <jy0922.shim@samsung.com>

Thanks.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2015-04-07  7:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-06 23:14 drm/exynos: misc fixes Tobias Jakobi
2015-04-06 23:14 ` [PATCH v2 1/3] drm/exynos: fix typos in hdmi and mixer Tobias Jakobi
2015-04-07  7:03   ` Joonyoung Shim
2015-04-07 13:35   ` Inki Dae
2015-04-06 23:14 ` [PATCH v2 2/3] drm/exynos: remove superfluous error messages Tobias Jakobi
2015-04-07  7:04   ` Joonyoung Shim
2015-04-06 23:14 ` [PATCH v2 3/3] drm/exynos: mixer: add 2x scaling to mixer_graph_buffer Tobias Jakobi
2015-04-07  7:10   ` Joonyoung Shim [this message]

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=552382F8.1000803@samsung.com \
    --to=jy0922.shim@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=tjakobi@math.uni-bielefeld.de \
    /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