dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk+kernel@arm.linux.org.uk>
To: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org
Cc: David Airlie <airlied@linux.ie>
Subject: [PATCH RFC 05/15] drm/armada: use number of CRTCs registered
Date: Sat, 05 Jul 2014 11:38:17 +0100	[thread overview]
Message-ID: <E1X3NMH-0000A0-Jd@rmk-PC.arm.linux.org.uk> (raw)
In-Reply-To: <20140705103724.GN21766@n2100.arm.linux.org.uk>

Use the number of CRTCs registered to size the vblank arrays rather than
our own count.  Number CRTCs using this as well.  This permits us to
register CRTCs as components in the near future rather than as part of a
single device.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 drivers/gpu/drm/armada/armada_crtc.c | 6 +++---
 drivers/gpu/drm/armada/armada_crtc.h | 3 +--
 drivers/gpu/drm/armada/armada_drv.c  | 4 ++--
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c
index 9341a94cc906..4336dfd3585d 100644
--- a/drivers/gpu/drm/armada/armada_crtc.c
+++ b/drivers/gpu/drm/armada/armada_crtc.c
@@ -1050,8 +1050,8 @@ static int armada_drm_crtc_create_properties(struct drm_device *dev)
 	return 0;
 }
 
-int armada_drm_crtc_create(struct drm_device *dev, unsigned num,
-	struct resource *res, int irq)
+int armada_drm_crtc_create(struct drm_device *dev, struct resource *res,
+	int irq)
 {
 	struct armada_private *priv = dev->dev_private;
 	struct armada_crtc *dcrtc;
@@ -1075,7 +1075,7 @@ int armada_drm_crtc_create(struct drm_device *dev, unsigned num,
 	}
 
 	dcrtc->base = base;
-	dcrtc->num = num;
+	dcrtc->num = dev->mode_config.num_crtc;
 	dcrtc->clk = ERR_PTR(-EINVAL);
 	dcrtc->csc_yuv_mode = CSC_AUTO;
 	dcrtc->csc_rgb_mode = CSC_AUTO;
diff --git a/drivers/gpu/drm/armada/armada_crtc.h b/drivers/gpu/drm/armada/armada_crtc.h
index 0e952b271212..531a9b0bdcfb 100644
--- a/drivers/gpu/drm/armada/armada_crtc.h
+++ b/drivers/gpu/drm/armada/armada_crtc.h
@@ -72,8 +72,7 @@ struct armada_crtc {
 };
 #define drm_to_armada_crtc(c) container_of(c, struct armada_crtc, crtc)
 
-int armada_drm_crtc_create(struct drm_device *, unsigned, struct resource *,
-	int);
+int armada_drm_crtc_create(struct drm_device *, struct resource *, int);
 void armada_drm_crtc_gamma_set(struct drm_crtc *, u16, u16, u16, int);
 void armada_drm_crtc_gamma_get(struct drm_crtc *, u16 *, u16 *, u16 *, int);
 void armada_drm_crtc_disable_irq(struct armada_crtc *, u32);
diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c
index 58884d807e6c..add8b101fa9e 100644
--- a/drivers/gpu/drm/armada/armada_drv.c
+++ b/drivers/gpu/drm/armada/armada_drv.c
@@ -164,7 +164,7 @@ static int armada_drm_load(struct drm_device *dev, unsigned long flags)
 		if (irq < 0)
 			goto err_kms;
 
-		ret = armada_drm_crtc_create(dev, n, res[n], irq);
+		ret = armada_drm_crtc_create(dev, res[n], irq);
 		if (ret)
 			goto err_kms;
 	}
@@ -175,7 +175,7 @@ static int armada_drm_load(struct drm_device *dev, unsigned long flags)
 		goto err_kms;
 #endif
 
-	ret = drm_vblank_init(dev, n);
+	ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
 	if (ret)
 		goto err_kms;
 
-- 
1.8.3.1

  parent reply	other threads:[~2014-07-05 10:38 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-05 10:37 [PATCH RFC 00/15] Armada DRM updates Russell King - ARM Linux
2014-07-05 10:37 ` [PATCH RFC 01/15] component: fix missed cleanup in case of devres failure Russell King
2014-07-05 10:38 ` [PATCH RFC 02/15] component: ignore multiple additions of the same component Russell King
2014-07-05 10:38 ` [PATCH RFC 03/15] component: add support for component match array Russell King
2014-07-05 10:38 ` [PATCH RFC 04/15] drm/armada: move IRQ handling into CRTC Russell King
2014-07-05 10:38 ` Russell King [this message]
2014-07-05 10:38 ` [PATCH RFC 06/15] drm/armada: move variant initialisation to CRTC init Russell King
2014-07-05 11:58   ` Sebastian Hesselbarth
2014-07-05 12:21     ` Russell King - ARM Linux
2014-07-06  9:46       ` Sebastian Hesselbarth
2014-07-09  9:38         ` Russell King - ARM Linux
2014-07-11 14:37     ` Russell King - ARM Linux
2014-07-11 15:18       ` Sebastian Hesselbarth
2014-07-11 15:24         ` Russell King - ARM Linux
2014-07-05 10:38 ` [PATCH RFC 07/15] drm/armada: make variant a CRTC thing Russell King
2014-07-05 10:38 ` [PATCH RFC 08/15] drm: add of_graph endpoint helper to find possible CRTCs Russell King
2014-07-05 10:38 ` [PATCH RFC 09/15] component: fix bug with legacy API Russell King
2014-07-05 10:38 ` [PATCH RFC 10/15] drm/armada: convert to componentized support Russell King
2014-07-05 10:38 ` [PATCH RFC 11/15] drm/armada: update Armada 510 (Dove) to use "ext_ref_clk1" as the clock Russell King
2014-07-05 10:39 ` [PATCH RFC 14/15] drm/armada: register crtc with port Russell King
     [not found] ` <20140705103724.GN21766-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2014-07-05 10:38   ` [PATCH RFC 12/15] dt-bindings: add Marvell Dove LCD controller documentation Russell King
2014-07-05 10:38   ` [PATCH RFC 13/15] drm/armada: permit CRTCs to be registered as separate devices Russell King
2014-07-05 10:39   ` [PATCH RFC 15/15] ARM: dts: dove: add DT LCD controllers Russell King

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=E1X3NMH-0000A0-Jd@rmk-PC.arm.linux.org.uk \
    --to=rmk+kernel@arm.linux.org.uk \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox