Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+6 -7
+3 -3
drivers/gpu/drm/armada/armada_crtc.c
··· 1050 1050 return 0; 1051 1051 } 1052 1052 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) 1055 1055 { 1056 1056 struct armada_private *priv = dev->dev_private; 1057 1057 struct armada_crtc *dcrtc; ··· 1075 1075 } 1076 1076 1077 1077 dcrtc->base = base; 1078 - dcrtc->num = num; 1078 + dcrtc->num = dev->mode_config.num_crtc; 1079 1079 dcrtc->clk = ERR_PTR(-EINVAL); 1080 1080 dcrtc->csc_yuv_mode = CSC_AUTO; 1081 1081 dcrtc->csc_rgb_mode = CSC_AUTO;
+1 -2
drivers/gpu/drm/armada/armada_crtc.h
··· 72 72 }; 73 73 #define drm_to_armada_crtc(c) container_of(c, struct armada_crtc, crtc) 74 74 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); 77 76 void armada_drm_crtc_gamma_set(struct drm_crtc *, u16, u16, u16, int); 78 77 void armada_drm_crtc_gamma_get(struct drm_crtc *, u16 *, u16 *, u16 *, int); 79 78 void armada_drm_crtc_disable_irq(struct armada_crtc *, u32);
+2 -2
drivers/gpu/drm/armada/armada_drv.c
··· 164 164 if (irq < 0) 165 165 goto err_kms; 166 166 167 - ret = armada_drm_crtc_create(dev, n, res[n], irq); 167 + ret = armada_drm_crtc_create(dev, res[n], irq); 168 168 if (ret) 169 169 goto err_kms; 170 170 } ··· 175 175 goto err_kms; 176 176 #endif 177 177 178 - ret = drm_vblank_init(dev, n); 178 + ret = drm_vblank_init(dev, dev->mode_config.num_crtc); 179 179 if (ret) 180 180 goto err_kms; 181 181