Skip to content

Commit d016540

Browse files
author
Russell King
committed
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>
1 parent e5d9ddf commit d016540

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

‎drivers/gpu/drm/armada/armada_crtc.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,8 +1050,8 @@ static int armada_drm_crtc_create_properties(struct drm_device *dev)
10501050
return 0;
10511051
}
10521052

1053-
int armada_drm_crtc_create(struct drm_device *dev, unsigned num,
1054-
struct resource *res, int irq)
1053+
int armada_drm_crtc_create(struct drm_device *dev, struct resource *res,
1054+
int irq)
10551055
{
10561056
struct armada_private *priv = dev->dev_private;
10571057
struct armada_crtc *dcrtc;
@@ -1075,7 +1075,7 @@ int armada_drm_crtc_create(struct drm_device *dev, unsigned num,
10751075
}
10761076

10771077
dcrtc->base = base;
1078-
dcrtc->num = num;
1078+
dcrtc->num = dev->mode_config.num_crtc;
10791079
dcrtc->clk = ERR_PTR(-EINVAL);
10801080
dcrtc->csc_yuv_mode = CSC_AUTO;
10811081
dcrtc->csc_rgb_mode = CSC_AUTO;

‎drivers/gpu/drm/armada/armada_crtc.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ struct armada_crtc {
7272
};
7373
#define drm_to_armada_crtc(c) container_of(c, struct armada_crtc, crtc)
7474

75-
int armada_drm_crtc_create(struct drm_device *, unsigned, struct resource *,
76-
int);
75+
int armada_drm_crtc_create(struct drm_device *, struct resource *, int);
7776
void armada_drm_crtc_gamma_set(struct drm_crtc *, u16, u16, u16, int);
7877
void armada_drm_crtc_gamma_get(struct drm_crtc *, u16 *, u16 *, u16 *, int);
7978
void armada_drm_crtc_disable_irq(struct armada_crtc *, u32);

‎drivers/gpu/drm/armada/armada_drv.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ static int armada_drm_load(struct drm_device *dev, unsigned long flags)
164164
if (irq < 0)
165165
goto err_kms;
166166

167-
ret = armada_drm_crtc_create(dev, n, res[n], irq);
167+
ret = armada_drm_crtc_create(dev, res[n], irq);
168168
if (ret)
169169
goto err_kms;
170170
}
@@ -175,7 +175,7 @@ static int armada_drm_load(struct drm_device *dev, unsigned long flags)
175175
goto err_kms;
176176
#endif
177177

178-
ret = drm_vblank_init(dev, n);
178+
ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
179179
if (ret)
180180
goto err_kms;
181181

0 commit comments

Comments
 (0)