Linux Samsung SOC development
 help / color / mirror / Atom feed
From: Inki Dae <inki.dae@samsung.com>
To: Marek Szyprowski <m.szyprowski@samsung.com>,
	dri-devel@lists.freedesktop.org,
	linux-samsung-soc@vger.kernel.org
Cc: Joonyoung Shim <jy0922.shim@samsung.com>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Andrzej Hajda <a.hajda@samsung.com>,
	Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Tobias Jakobi <tjakobi@math.uni-bielefeld.de>,
	Gustavo Padovan <gustavo@padovan.org>,
	Javier Martinez Canillas <javier@osg.samsung.com>
Subject: Re: [PATCH v2 10/22] drm/exynos: introduce exynos_drm_plane_config structure
Date: Thu, 10 Dec 2015 20:47:32 +0900	[thread overview]
Message-ID: <56696654.4000102@samsung.com> (raw)
In-Reply-To: <1448891617-18830-11-git-send-email-m.szyprowski@samsung.com>

Hi Marek,

2015년 11월 30일 22:53에 Marek Szyprowski 이(가) 쓴 글:
> This patch adds common structure for keeping plane configuration and
> capabilities data. This patch is inspired by similar code developed by
> Tobias Jakobi.
> 
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>  drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 18 ++++++++---
>  drivers/gpu/drm/exynos/exynos7_drm_decon.c    | 23 +++++++++-----
>  drivers/gpu/drm/exynos/exynos_drm_drv.h       | 19 ++++++++++++
>  drivers/gpu/drm/exynos/exynos_drm_fimd.c      | 25 ++++++++++-----
>  drivers/gpu/drm/exynos/exynos_drm_plane.c     | 34 +++++++++------------
>  drivers/gpu/drm/exynos/exynos_drm_plane.h     |  7 ++---
>  drivers/gpu/drm/exynos/exynos_drm_vidi.c      | 25 ++++++++++-----
>  drivers/gpu/drm/exynos/exynos_mixer.c         | 44 +++++++++++++++------------
>  8 files changed, 121 insertions(+), 74 deletions(-)
> 
<--snip-->
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
> index 3ce141236fad..90701647aef1 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
> @@ -30,7 +30,6 @@
>  
>  /* vidi has totally three virtual windows. */
>  #define WINDOWS_NR		3
> -#define CURSOR_WIN		2
>  
>  #define ctx_from_connector(c)	container_of(c, struct vidi_context, \
>  					connector)
> @@ -90,6 +89,12 @@ static const uint32_t formats[] = {
>  	DRM_FORMAT_NV12,
>  };
>  
> +static const enum drm_plane_type vidi_win_types[WINDOWS_NR] = {
> +	DRM_PLANE_TYPE_PRIMARY,
> +	DRM_PLANE_TYPE_OVERLAY,
> +	DRM_PLANE_TYPE_CURSOR,
> +};
> +
>  static int vidi_enable_vblank(struct exynos_drm_crtc *crtc)
>  {
>  	struct vidi_context *ctx = crtc->ctx;
> @@ -442,17 +447,21 @@ static int vidi_bind(struct device *dev, struct device *master, void *data)
>  	struct drm_device *drm_dev = data;
>  	struct drm_encoder *encoder = &ctx->encoder;
>  	struct exynos_drm_plane *exynos_plane;
> -	enum drm_plane_type type;
> -	unsigned int zpos;
> +	struct exynos_drm_plane_config plane_config = { 0 };
> +	unsigned int i;
>  	int pipe, ret;
>  
>  	vidi_ctx_initialize(ctx, drm_dev);
>  
> -	for (zpos = 0; zpos < WINDOWS_NR; zpos++) {
> -		type = exynos_plane_get_type(zpos, CURSOR_WIN);
> -		ret = exynos_plane_init(drm_dev, &ctx->planes[zpos],
> -					1 << ctx->pipe, type, formats,
> -					ARRAY_SIZE(formats), zpos);
> +	plane_config.pixel_formats = formats;
> +	plane_config.num_pixel_formats = ARRAY_SIZE(formats);
> +
> +	for (i = 0; i < WINDOWS_NR; i++) {
> +		plane_config.zpos = i;
> +		plane_config.type = vidi_win_types(i);

vidi_win_types is not really a function. So this should be 'vidi_win_type[i]'
This is a trivial so I can fix it.

Thanks,
Inki Dae

> +
> +		ret = exynos_plane_init(drm_dev, &ctx->planes[i],
> +					1 << ctx->pipe, &plane_config);
>  		if (ret)
>  			return ret;
>  	}
> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
> index 8d2ce13eb725..a229f86d221a 100644
> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
> @@ -43,7 +43,6 @@
>  
>  #define MIXER_WIN_NR		3
>  #define VP_DEFAULT_WIN		2
> -#define CURSOR_WIN		1
>  
>  /* The pixelformats that are natively supported by the mixer. */
>  #define MXR_FORMAT_RGB565	4
> @@ -112,6 +111,25 @@ struct mixer_drv_data {
>  	bool					has_sclk;
>  };
>  
> +static const struct exynos_drm_plane_config plane_configs[MIXER_WIN_NR] = {
> +	{
> +		.zpos = 0,
> +		.type = DRM_PLANE_TYPE_PRIMARY,
> +		.pixel_formats = mixer_formats,
> +		.num_pixel_formats = ARRAY_SIZE(mixer_formats),
> +	}, {
> +		.zpos = 1,
> +		.type = DRM_PLANE_TYPE_CURSOR,
> +		.pixel_formats = mixer_formats,
> +		.num_pixel_formats = ARRAY_SIZE(mixer_formats),
> +	}, {
> +		.zpos = 2,
> +		.type = DRM_PLANE_TYPE_OVERLAY,
> +		.pixel_formats = vp_formats,
> +		.num_pixel_formats = ARRAY_SIZE(vp_formats),
> +	},
> +};
> +
>  static const u8 filter_y_horiz_tap8[] = {
>  	0,	-1,	-1,	-1,	-1,	-1,	-1,	-1,
>  	-1,	-1,	-1,	-1,	-1,	0,	0,	0,
> @@ -1155,33 +1173,19 @@ static int mixer_bind(struct device *dev, struct device *manager, void *data)
>  	struct mixer_context *ctx = dev_get_drvdata(dev);
>  	struct drm_device *drm_dev = data;
>  	struct exynos_drm_plane *exynos_plane;
> -	unsigned int zpos;
> +	unsigned int i;
>  	int ret;
>  
>  	ret = mixer_initialize(ctx, drm_dev);
>  	if (ret)
>  		return ret;
>  
> -	for (zpos = 0; zpos < MIXER_WIN_NR; zpos++) {
> -		enum drm_plane_type type;
> -		const uint32_t *formats;
> -		unsigned int fcount;
> -
> -		if (zpos == VP_DEFAULT_WIN && !ctx->vp_enabled)
> +	for (i = 0; i < MIXER_WIN_NR; i++) {
> +		if (i == VP_DEFAULT_WIN && !ctx->vp_enabled)
>  			continue;
>  
> -		if (zpos < VP_DEFAULT_WIN) {
> -			formats = mixer_formats;
> -			fcount = ARRAY_SIZE(mixer_formats);
> -		} else {
> -			formats = vp_formats;
> -			fcount = ARRAY_SIZE(vp_formats);
> -		}
> -
> -		type = exynos_plane_get_type(zpos, CURSOR_WIN);
> -		ret = exynos_plane_init(drm_dev, &ctx->planes[zpos],
> -					1 << ctx->pipe, type, formats, fcount,
> -					zpos);
> +		ret = exynos_plane_init(drm_dev, &ctx->planes[i],
> +					1 << ctx->pipe, &plane_configs[i]);
>  		if (ret)
>  			return ret;
>  	}
> 

  reply	other threads:[~2015-12-10 11:47 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-30 13:53 [PATCH v2 00/22] Exynos DRM: new life of IPP (Image Post Processing) subsystem Marek Szyprowski
2015-11-30 13:53 ` [PATCH v2 01/22] drm/exynos: gsc: prepare and unprepare gsc clock Marek Szyprowski
2015-11-30 13:53 ` [PATCH v2 02/22] drm/exynos: gsc: fix wrong pm_runtime state Marek Szyprowski
2015-11-30 13:53 ` [PATCH v2 03/22] drm/exynos: gsc: add device tree support and remove usage of static mappings Marek Szyprowski
2015-12-10  6:48   ` Inki Dae
2015-12-10  6:55     ` Krzysztof Kozlowski
2015-11-30 13:53 ` [PATCH v2 04/22] drm/exynos: rotator: convert to common clock framework Marek Szyprowski
2015-11-30 13:53 ` [PATCH v2 05/22] drm/exynos: exynos7-decon: remove excessive check Marek Szyprowski
2015-11-30 13:53 ` [PATCH v2 06/22] drm/exynos: move dma_addr attribute from exynos plane to exynos fb Marek Szyprowski
2015-12-10 13:05   ` Inki Dae
2015-12-11  9:02     ` Inki Dae
2015-12-11  9:26       ` Marek Szyprowski
2015-12-11  9:57         ` Inki Dae
2015-12-11 11:27           ` Marek Szyprowski
2015-12-11 14:52             ` Inki Dae
2015-12-14  9:15               ` Marek Szyprowski
2015-12-14  9:43                 ` Inki Dae
2015-11-30 13:53 ` [PATCH v2 07/22] drm/exynos: introduce exynos_drm_plane_state structure Marek Szyprowski
2015-11-30 13:53 ` [PATCH v2 08/22] drm/exynos: mixer: use crtc->state->adjusted_mode instead of crtc->mode Marek Szyprowski
2015-11-30 13:53 ` [PATCH v2 09/22] drm/exynos: mixer: enable video overlay plane only when VP is available Marek Szyprowski
2015-11-30 13:53 ` [PATCH v2 10/22] drm/exynos: introduce exynos_drm_plane_config structure Marek Szyprowski
2015-12-10 11:47   ` Inki Dae [this message]
2015-11-30 13:53 ` [PATCH v2 11/22] drm/exynos: add generic check for plane state Marek Szyprowski
2015-11-30 13:53 ` [PATCH v2 12/22] drm/exynos: mixer: use ratio precalculated in exynos_state Marek Szyprowski
2015-11-30 13:53 ` [PATCH v2 13/22] drm/exynos: fix clipping when scaling is enabled Marek Szyprowski
2015-11-30 13:53 ` [PATCH v2 14/22] drm/exynos: fimd: fix dma burst size setting for small plane size Marek Szyprowski
2015-11-30 15:40   ` Daniel Stone
2015-12-10 11:35   ` Inki Dae
2015-12-10 12:59     ` Marek Szyprowski
2015-12-10 15:36       ` Daniel Stone
2015-12-11  9:04       ` Inki Dae
2015-11-30 13:53 ` [PATCH v2 15/22] drm/exynos: gem: remove old unused prototypes Marek Szyprowski
2015-11-30 13:53 ` [PATCH v2 16/22] drm/exynos: add fb pointer to exynos_drm_plane_state Marek Szyprowski
2015-11-30 13:53 ` [PATCH v2 17/22] drm/exynos: gem: set default alignment for dumb GEM buffers Marek Szyprowski
2015-11-30 13:53 ` [PATCH v2 18/22] drm/exynos: fix to calculate offset of each plane for ipp fimc Marek Szyprowski
2015-11-30 13:53 ` [PATCH v2 19/22] drm/exynos: fix to calculate offset of each plane for ipp gsc Marek Szyprowski
2015-11-30 13:53 ` [PATCH v2 20/22] drm/exynos: gem: simplify access to exynos gem object Marek Szyprowski
2015-11-30 13:53 ` [PATCH v2 21/22] drm/exynos: ipp: make framework context global Marek Szyprowski
2015-11-30 13:53 ` [PATCH v2 22/22] drm/exynos: add support for plane rotation, scalling and colospace convesion Marek Szyprowski
2016-03-15 14:46 ` [PATCH v2 00/22] Exynos DRM: new life of IPP (Image Post Processing) subsystem Tobias Jakobi

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=56696654.4000102@samsung.com \
    --to=inki.dae@samsung.com \
    --cc=a.hajda@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gustavo@padovan.org \
    --cc=javier@osg.samsung.com \
    --cc=jy0922.shim@samsung.com \
    --cc=k.kozlowski@samsung.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=sw0312.kim@samsung.com \
    --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