linux-samsung-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrzej Hajda <a.hajda@samsung.com>
To: Inki Dae <inki.dae@samsung.com>
Cc: Javier Martinez Canillas <javier@osg.samsung.com>,
	linux-samsung-soc@vger.kernel.org,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	dri-devel@lists.freedesktop.org,
	Marek Szyprowski <m.szyprowski@samsung.com>
Subject: [PATCH v2 08/12] drm/exynos: kill exynos_drm_crtc::pipe
Date: Wed, 08 Mar 2017 15:58:42 +0100	[thread overview]
Message-ID: <1488985126-25288-9-git-send-email-a.hajda@samsung.com> (raw)
In-Reply-To: <1488985126-25288-1-git-send-email-a.hajda@samsung.com>

Since crtc index is stored in drm_crtc pipe field became redundant.
The patch beside removing the field simplifies also
exynos_drm_crtc_get_pipe_from_type.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
 drivers/gpu/drm/exynos/exynos5433_drm_decon.c |  3 +--
 drivers/gpu/drm/exynos/exynos7_drm_decon.c    |  3 +--
 drivers/gpu/drm/exynos/exynos_drm_crtc.c      | 12 +++---------
 drivers/gpu/drm/exynos/exynos_drm_crtc.h      |  1 -
 drivers/gpu/drm/exynos/exynos_drm_drv.h       |  8 --------
 drivers/gpu/drm/exynos/exynos_drm_fimd.c      |  3 +--
 drivers/gpu/drm/exynos/exynos_drm_vidi.c      |  3 +--
 drivers/gpu/drm/exynos/exynos_mixer.c         |  3 +--
 8 files changed, 8 insertions(+), 28 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
index ee8d5cb..2eb6997 100644
--- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
+++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
@@ -614,8 +614,7 @@ static int decon_bind(struct device *dev, struct device *master, void *data)
 	out_type = (ctx->out_type & IFTYPE_HDMI) ? EXYNOS_DISPLAY_TYPE_HDMI
 						  : EXYNOS_DISPLAY_TYPE_LCD;
 	ctx->crtc = exynos_drm_crtc_create(drm_dev, &exynos_plane->base,
-					ctx->pipe, out_type,
-					&decon_crtc_ops, ctx);
+			out_type, &decon_crtc_ops, ctx);
 	if (IS_ERR(ctx->crtc)) {
 		ret = PTR_ERR(ctx->crtc);
 		goto err;
diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
index 4881180..0ccb334 100644
--- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c
+++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
@@ -656,8 +656,7 @@ static int decon_bind(struct device *dev, struct device *master, void *data)
 
 	exynos_plane = &ctx->planes[DEFAULT_WIN];
 	ctx->crtc = exynos_drm_crtc_create(drm_dev, &exynos_plane->base,
-					   ctx->pipe, EXYNOS_DISPLAY_TYPE_LCD,
-					   &decon_crtc_ops, ctx);
+			EXYNOS_DISPLAY_TYPE_LCD, &decon_crtc_ops, ctx);
 	if (IS_ERR(ctx->crtc)) {
 		decon_ctx_remove(ctx);
 		return PTR_ERR(ctx->crtc);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
index c02378b..2d0aa11 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
@@ -166,7 +166,6 @@ static const struct drm_crtc_funcs exynos_crtc_funcs = {
 
 struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
 					struct drm_plane *plane,
-					int pipe,
 					enum exynos_drm_output_type type,
 					const struct exynos_drm_crtc_ops *ops,
 					void *ctx)
@@ -179,7 +178,6 @@ struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
 	if (!exynos_crtc)
 		return ERR_PTR(-ENOMEM);
 
-	exynos_crtc->pipe = pipe;
 	exynos_crtc->type = type;
 	exynos_crtc->ops = ops;
 	exynos_crtc->ctx = ctx;
@@ -206,13 +204,9 @@ int exynos_drm_crtc_get_pipe_from_type(struct drm_device *drm_dev,
 {
 	struct drm_crtc *crtc;
 
-	list_for_each_entry(crtc, &drm_dev->mode_config.crtc_list, head) {
-		struct exynos_drm_crtc *exynos_crtc;
-
-		exynos_crtc = to_exynos_crtc(crtc);
-		if (exynos_crtc->type == out_type)
-			return exynos_crtc->pipe;
-	}
+	drm_for_each_crtc(crtc, drm_dev)
+		if (to_exynos_crtc(crtc)->type == out_type)
+			return drm_crtc_index(crtc);
 
 	return -EPERM;
 }
diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.h b/drivers/gpu/drm/exynos/exynos_drm_crtc.h
index 9634fe5..ef58b64 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_crtc.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.h
@@ -19,7 +19,6 @@
 
 struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
 					struct drm_plane *plane,
-					int pipe,
 					enum exynos_drm_output_type type,
 					const struct exynos_drm_crtc_ops *ops,
 					void *context);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index 906ab7a..7e54be1 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -154,13 +154,6 @@ struct exynos_drm_clk {
  *
  * @base: crtc object.
  * @type: one of EXYNOS_DISPLAY_TYPE_LCD and HDMI.
- * @pipe: a crtc index created at load() with a new crtc object creation
- *	and the crtc object would be set to private->crtc array
- *	to get a crtc object corresponding to this pipe from private->crtc
- *	array when irq interrupt occurred. the reason of using this pipe is that
- *	drm framework doesn't support multiple irq yet.
- *	we can refer to the crtc to current hardware interrupt occurred through
- *	this pipe value.
  * @enabled: if the crtc is enabled or not
  * @event: vblank event that is currently queued for flip
  * @wait_update: wait all pending planes updates to finish
@@ -171,7 +164,6 @@ struct exynos_drm_clk {
 struct exynos_drm_crtc {
 	struct drm_crtc			base;
 	enum exynos_drm_output_type	type;
-	unsigned int			pipe;
 	const struct exynos_drm_crtc_ops	*ops;
 	void				*ctx;
 	struct exynos_drm_clk		*pipe_clk;
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index eb4cd82..caaccd8 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -1017,8 +1017,7 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)
 
 	exynos_plane = &ctx->planes[DEFAULT_WIN];
 	ctx->crtc = exynos_drm_crtc_create(drm_dev, &exynos_plane->base,
-					   ctx->pipe, EXYNOS_DISPLAY_TYPE_LCD,
-					   &fimd_crtc_ops, ctx);
+			EXYNOS_DISPLAY_TYPE_LCD, &fimd_crtc_ops, ctx);
 	if (IS_ERR(ctx->crtc))
 		return PTR_ERR(ctx->crtc);
 
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
index 5d9a62a..67f365f 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
@@ -417,8 +417,7 @@ static int vidi_bind(struct device *dev, struct device *master, void *data)
 
 	exynos_plane = &ctx->planes[DEFAULT_WIN];
 	ctx->crtc = exynos_drm_crtc_create(drm_dev, &exynos_plane->base,
-					   ctx->pipe, EXYNOS_DISPLAY_TYPE_VIDI,
-					   &vidi_crtc_ops, ctx);
+			EXYNOS_DISPLAY_TYPE_VIDI, &vidi_crtc_ops, ctx);
 	if (IS_ERR(ctx->crtc)) {
 		DRM_ERROR("failed to create crtc.\n");
 		return PTR_ERR(ctx->crtc);
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index 25edb63..3fb8cf3 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -1165,8 +1165,7 @@ static int mixer_bind(struct device *dev, struct device *manager, void *data)
 
 	exynos_plane = &ctx->planes[DEFAULT_WIN];
 	ctx->crtc = exynos_drm_crtc_create(drm_dev, &exynos_plane->base,
-					   ctx->pipe, EXYNOS_DISPLAY_TYPE_HDMI,
-					   &mixer_crtc_ops, ctx);
+			EXYNOS_DISPLAY_TYPE_HDMI, &mixer_crtc_ops, ctx);
 	if (IS_ERR(ctx->crtc)) {
 		mixer_ctx_remove(ctx);
 		ret = PTR_ERR(ctx->crtc);
-- 
2.7.4

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

  parent reply	other threads:[~2017-03-08 14:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170308145900eucas1p25d1fd7a33ad2bb9fa8c911a3b923546b@eucas1p2.samsung.com>
2017-03-08 14:58 ` [PATCH v2 00/12] drm/exynos: rework vblank handling Andrzej Hajda
     [not found]   ` <CGME20170308145901eucas1p21056f416d8a34fc5af4a4b89ed48ad5a@eucas1p2.samsung.com>
2017-03-08 14:58     ` [PATCH v2 01/12] drm/exynos: move crtc event handling to drivers callbacks Andrzej Hajda
     [not found]   ` <CGME20170308145901eucas1p2e7695c1d9fa43378d0a298b029d11269@eucas1p2.samsung.com>
2017-03-08 14:58     ` [PATCH v2 02/12] drm/exynos: simplify completion event handling Andrzej Hajda
     [not found]   ` <CGME20170308145902eucas1p24636df9b8eafd2b07f12a2c700c6bcea@eucas1p2.samsung.com>
2017-03-08 14:58     ` [PATCH v2 03/12] drm/exynos/decon5433: fix vblank " Andrzej Hajda
2017-03-09  3:54       ` Michel Dänzer
2017-03-09  6:54         ` Andrzej Hajda
2017-03-13  6:33           ` Inki Dae
     [not found]             ` <CGME20170313073211eucas1p17a7cdf647b711343ef382adb792ed84e@eucas1p1.samsung.com>
2017-03-13  7:31               ` [PATCH v3 " Andrzej Hajda
     [not found]   ` <CGME20170308145902eucas1p131a3e6700da4e72c6d4ca1a4f74e5893@eucas1p1.samsung.com>
2017-03-08 14:58     ` [PATCH v2 04/12] drm/exynos/decon5433: implement frame counter Andrzej Hajda
     [not found]   ` <CGME20170308145902eucas1p2ef76c359292764dfe2a04312a1ee8dfb@eucas1p2.samsung.com>
2017-03-08 14:58     ` [PATCH v2 05/12] drm/exynos/decon5433: signal frame done interrupt at front porch Andrzej Hajda
     [not found]   ` <CGME20170308145903eucas1p27b43f06a1c172d33d7143df9f10ce1b0@eucas1p2.samsung.com>
2017-03-08 14:58     ` [PATCH v2 06/12] drm/exynos/fimd: " Andrzej Hajda
     [not found]   ` <CGME20170308145903eucas1p2a64c7cd562dfddf43dbbe5dd9281edc6@eucas1p2.samsung.com>
2017-03-08 14:58     ` [PATCH v2 07/12] drm/exynos/decon5433: fix software trigger mask Andrzej Hajda
     [not found]   ` <CGME20170308145904eucas1p2cf66bf512f2fed9961dff807e3b2af0f@eucas1p2.samsung.com>
2017-03-08 14:58     ` Andrzej Hajda [this message]
     [not found]   ` <CGME20170308145905eucas1p10b5d39a4c72461a9fa3a33da8d3e3b00@eucas1p1.samsung.com>
2017-03-08 14:58     ` [PATCH v2 09/12] drm/exynos: kill exynos_drm_private::pipe Andrzej Hajda
     [not found]   ` <CGME20170308145905eucas1p2b562042b430d53f74fc5bdd3097ef21d@eucas1p2.samsung.com>
2017-03-08 14:58     ` [PATCH v2 10/12] drm/exynos: set plane possible_crtcs in exynos_plane_init Andrzej Hajda
     [not found]   ` <CGME20170308145906eucas1p24caed8fd5f3eda8c4e1ece3c2a8a6091@eucas1p2.samsung.com>
2017-03-08 14:58     ` [PATCH v2 11/12] drm/exynos: kill pipe field from drivers contexts Andrzej Hajda
     [not found]   ` <CGME20170308145906eucas1p206bb5875e635d3516ae00a2ac168175e@eucas1p2.samsung.com>
2017-03-08 14:58     ` [PATCH v2 12/12] drm/exynos: kill mode_set_nofb callback Andrzej Hajda
2017-03-14  1:28   ` [PATCH v2 00/12] drm/exynos: rework vblank handling Inki Dae

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=1488985126-25288-9-git-send-email-a.hajda@samsung.com \
    --to=a.hajda@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=inki.dae@samsung.com \
    --cc=javier@osg.samsung.com \
    --cc=krzk@kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.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;
as well as URLs for NNTP newsgroup(s).