drm/armada: use number of CRTCs registered

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>
This commit is contained in:
Russell King 2014-04-22 11:02:23 +01:00
parent e5d9ddfbb7
commit d016540722
3 changed files with 6 additions and 7 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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;