All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH 04/16] drm/imx: Drop pipe field from struct imx_drm_crtc
Date: Thu, 24 Sep 2015 18:35:26 +0200	[thread overview]
Message-ID: <1443112538-9616-4-git-send-email-thierry.reding@gmail.com> (raw)
In-Reply-To: <1443112538-9616-1-git-send-email-thierry.reding@gmail.com>

From: Thierry Reding <treding@nvidia.com>

Use the drm_crtc_index() helper to determine the pipe number of the CRTC
instead.

Cc: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpu/drm/imx/imx-drm-core.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
index 9ff1b780f453..ad77c9d86409 100644
--- a/drivers/gpu/drm/imx/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/imx-drm-core.c
@@ -45,7 +45,6 @@ struct imx_drm_device {
 
 struct imx_drm_crtc {
 	struct drm_crtc				*crtc;
-	unsigned int				pipe;
 	struct imx_drm_crtc_helper_funcs	imx_drm_helper_funcs;
 };
 
@@ -54,7 +53,7 @@ module_param(legacyfb_depth, int, 0444);
 
 unsigned int imx_drm_crtc_id(struct imx_drm_crtc *crtc)
 {
-	return crtc->pipe;
+	return drm_crtc_index(crtc->crtc);
 }
 EXPORT_SYMBOL_GPL(imx_drm_crtc_id);
 
@@ -129,19 +128,19 @@ EXPORT_SYMBOL_GPL(imx_drm_set_bus_format);
 
 int imx_drm_crtc_vblank_get(struct imx_drm_crtc *imx_drm_crtc)
 {
-	return drm_vblank_get(imx_drm_crtc->crtc->dev, imx_drm_crtc->pipe);
+	return drm_crtc_vblank_get(imx_drm_crtc->crtc);
 }
 EXPORT_SYMBOL_GPL(imx_drm_crtc_vblank_get);
 
 void imx_drm_crtc_vblank_put(struct imx_drm_crtc *imx_drm_crtc)
 {
-	drm_vblank_put(imx_drm_crtc->crtc->dev, imx_drm_crtc->pipe);
+	drm_crtc_vblank_put(imx_drm_crtc->crtc);
 }
 EXPORT_SYMBOL_GPL(imx_drm_crtc_vblank_put);
 
 void imx_drm_handle_vblank(struct imx_drm_crtc *imx_drm_crtc)
 {
-	drm_handle_vblank(imx_drm_crtc->crtc->dev, imx_drm_crtc->pipe);
+	drm_crtc_handle_vblank(imx_drm_crtc->crtc);
 }
 EXPORT_SYMBOL_GPL(imx_drm_handle_vblank);
 
@@ -363,12 +362,11 @@ int imx_drm_add_crtc(struct drm_device *drm, struct drm_crtc *crtc,
 		return -ENOMEM;
 
 	imx_drm_crtc->imx_drm_helper_funcs = *imx_drm_helper_funcs;
-	imx_drm_crtc->pipe = imxdrm->pipes++;
 	imx_drm_crtc->crtc = crtc;
 
 	crtc->port = port;
 
-	imxdrm->crtc[imx_drm_crtc->pipe] = imx_drm_crtc;
+	imxdrm->crtc[imxdrm->pipes++] = imx_drm_crtc;
 
 	*new_crtc = imx_drm_crtc;
 
@@ -385,7 +383,7 @@ int imx_drm_add_crtc(struct drm_device *drm, struct drm_crtc *crtc,
 	return 0;
 
 err_register:
-	imxdrm->crtc[imx_drm_crtc->pipe] = NULL;
+	imxdrm->crtc[--imxdrm->pipes] = NULL;
 	kfree(imx_drm_crtc);
 	return ret;
 }
@@ -397,10 +395,11 @@ EXPORT_SYMBOL_GPL(imx_drm_add_crtc);
 int imx_drm_remove_crtc(struct imx_drm_crtc *imx_drm_crtc)
 {
 	struct imx_drm_device *imxdrm = imx_drm_crtc->crtc->dev->dev_private;
+	unsigned int pipe = drm_crtc_index(imx_drm_crtc->crtc);
 
 	drm_crtc_cleanup(imx_drm_crtc->crtc);
 
-	imxdrm->crtc[imx_drm_crtc->pipe] = NULL;
+	imxdrm->crtc[pipe] = NULL;
 
 	kfree(imx_drm_crtc);
 
-- 
2.5.0

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

  parent reply	other threads:[~2015-09-24 16:35 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-24 16:35 [PATCH 01/16] drm/gma500: Sanity-check pipe index Thierry Reding
2015-09-24 16:35 ` [PATCH 02/16] drm/bochs: Store correct CRTC index in events Thierry Reding
2015-09-24 16:35 ` [PATCH 03/16] drm/imx: Make pipe number unsigned Thierry Reding
2015-09-24 16:35 ` Thierry Reding [this message]
2015-09-25  7:26   ` [PATCH 04/16] drm/imx: Drop pipe field from struct imx_drm_crtc Philipp Zabel
2015-09-24 16:35 ` [PATCH 05/16] drm/imx: Store correct CRTC index in events Thierry Reding
2015-09-24 16:35 ` [PATCH 06/16] drm/rockchip: " Thierry Reding
2015-09-24 16:35 ` [PATCH 07/16] drm/sti: " Thierry Reding
2015-10-01 14:06   ` Vincent ABRIOU
2015-09-24 16:35 ` [PATCH 08/16] drm/irq: Rename drm_crtc -> crtc Thierry Reding
2015-09-24 18:17   ` Daniel Vetter
2015-09-24 16:35 ` [PATCH 09/16] drm/irq: Use unsigned int pipe in public API Thierry Reding
2015-09-24 19:21   ` Russell King - ARM Linux
2015-09-24 20:20     ` Ville Syrjälä
2015-09-25  7:39       ` Laurent Pinchart
2015-09-25 12:26       ` Thierry Reding
2015-10-01 14:46   ` Vincent ABRIOU
2015-10-06 10:52   ` Ville Syrjälä
2015-09-24 16:35 ` [PATCH 10/16] drm/gma500: Use unsigned int pipe consistently Thierry Reding
2015-09-24 16:35 ` [PATCH 11/16] drm/imx: Use unsigned int for CRTC index Thierry Reding
2015-09-24 16:35 ` [PATCH 12/16] drm/msm: Use unsigned int pipe consistently Thierry Reding
2015-09-24 16:35 ` [PATCH 13/16] drm: Move ->get_scanout_position() to struct drm_crtc_funcs Thierry Reding
2015-09-24 18:22   ` Daniel Vetter
2015-09-24 16:35 ` [PATCH 14/16] drm/irq: Add drm_crtc_vblank_count_and_time() Thierry Reding
2015-09-24 18:27   ` Daniel Vetter
2015-09-24 16:35 ` [PATCH 15/16] drm/armada: Use drm_crtc_vblank_*() API Thierry Reding
2015-09-24 16:35 ` [PATCH 16/16] drm/sti: " Thierry Reding
2015-10-01 14:49   ` Vincent ABRIOU

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=1443112538-9616-4-git-send-email-thierry.reding@gmail.com \
    --to=thierry.reding@gmail.com \
    --cc=dri-devel@lists.freedesktop.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.