aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2018-02-06 04:35:39 -0500
committerLinus Walleij <linus.walleij@linaro.org>2018-02-07 03:08:46 -0500
commit08e3211251e36a506ff6b0c31620e362b5800f47 (patch)
tree49d795cba06fb5e11375b3ebaa02cdd55958b84f
parenteedd6033b4c88d559afd7c8ac8a76fefcd9834a6 (diff)
drm/pl111: Support variants with broken VBLANK
The early Integrator CLCD synthesized in the Integrator CP and IM-PD1 FPGAs are broken: their vertical and next base interrupts are not functional. Support these variants by simply disabling the use of the vblank interrupt on these variants. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20180206093540.8147-4-linus.walleij@linaro.org
-rw-r--r--drivers/gpu/drm/pl111/pl111_display.c6
-rw-r--r--drivers/gpu/drm/pl111/pl111_drm.h2
-rw-r--r--drivers/gpu/drm/pl111/pl111_drv.c19
-rw-r--r--drivers/gpu/drm/pl111/pl111_versatile.c1
4 files changed, 18 insertions, 10 deletions
diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c
index 4d4e38b4c9d5..d75923896609 100644
--- a/drivers/gpu/drm/pl111/pl111_display.c
+++ b/drivers/gpu/drm/pl111/pl111_display.c
@@ -256,7 +256,8 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe,
256 cntl |= CNTL_LCDPWR; 256 cntl |= CNTL_LCDPWR;
257 writel(cntl, priv->regs + priv->ctrl); 257 writel(cntl, priv->regs + priv->ctrl);
258 258
259 drm_crtc_vblank_on(crtc); 259 if (!priv->variant->broken_vblank)
260 drm_crtc_vblank_on(crtc);
260} 261}
261 262
262void pl111_display_disable(struct drm_simple_display_pipe *pipe) 263void pl111_display_disable(struct drm_simple_display_pipe *pipe)
@@ -266,7 +267,8 @@ void pl111_display_disable(struct drm_simple_display_pipe *pipe)
266 struct pl111_drm_dev_private *priv = drm->dev_private; 267 struct pl111_drm_dev_private *priv = drm->dev_private;
267 u32 cntl; 268 u32 cntl;
268 269
269 drm_crtc_vblank_off(crtc); 270 if (!priv->variant->broken_vblank)
271 drm_crtc_vblank_off(crtc);
270 272
271 /* Power Down */ 273 /* Power Down */
272 cntl = readl(priv->regs + priv->ctrl); 274 cntl = readl(priv->regs + priv->ctrl);
diff --git a/drivers/gpu/drm/pl111/pl111_drm.h b/drivers/gpu/drm/pl111/pl111_drm.h
index a9b18195d11d..6d0e450e51b1 100644
--- a/drivers/gpu/drm/pl111/pl111_drm.h
+++ b/drivers/gpu/drm/pl111/pl111_drm.h
@@ -40,6 +40,7 @@ struct drm_minor;
40 * BGR/RGB routing 40 * BGR/RGB routing
41 * @broken_clockdivider: the clock divider is broken and we need to 41 * @broken_clockdivider: the clock divider is broken and we need to
42 * use the supplied clock directly 42 * use the supplied clock directly
43 * @broken_vblank: the vblank IRQ is broken on this variant
43 * @formats: array of supported pixel formats on this variant 44 * @formats: array of supported pixel formats on this variant
44 * @nformats: the length of the array of supported pixel formats 45 * @nformats: the length of the array of supported pixel formats
45 */ 46 */
@@ -48,6 +49,7 @@ struct pl111_variant_data {
48 bool is_pl110; 49 bool is_pl110;
49 bool external_bgr; 50 bool external_bgr;
50 bool broken_clockdivider; 51 bool broken_clockdivider;
52 bool broken_vblank;
51 const u32 *formats; 53 const u32 *formats;
52 unsigned int nformats; 54 unsigned int nformats;
53}; 55};
diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c
index ad8dfead2d00..94fbc7cc5e19 100644
--- a/drivers/gpu/drm/pl111/pl111_drv.c
+++ b/drivers/gpu/drm/pl111/pl111_drv.c
@@ -132,10 +132,12 @@ static int pl111_modeset_init(struct drm_device *dev)
132 if (ret) 132 if (ret)
133 return ret; 133 return ret;
134 134
135 ret = drm_vblank_init(dev, 1); 135 if (!priv->variant->broken_vblank) {
136 if (ret != 0) { 136 ret = drm_vblank_init(dev, 1);
137 dev_err(dev->dev, "Failed to init vblank\n"); 137 if (ret != 0) {
138 goto out_bridge; 138 dev_err(dev->dev, "Failed to init vblank\n");
139 goto out_bridge;
140 }
139 } 141 }
140 142
141 drm_mode_config_reset(dev); 143 drm_mode_config_reset(dev);
@@ -172,10 +174,6 @@ static struct drm_driver pl111_drm_driver = {
172 .dumb_create = drm_gem_cma_dumb_create, 174 .dumb_create = drm_gem_cma_dumb_create,
173 .gem_free_object_unlocked = drm_gem_cma_free_object, 175 .gem_free_object_unlocked = drm_gem_cma_free_object,
174 .gem_vm_ops = &drm_gem_cma_vm_ops, 176 .gem_vm_ops = &drm_gem_cma_vm_ops,
175
176 .enable_vblank = pl111_enable_vblank,
177 .disable_vblank = pl111_disable_vblank,
178
179 .prime_handle_to_fd = drm_gem_prime_handle_to_fd, 177 .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
180 .prime_fd_to_handle = drm_gem_prime_fd_to_handle, 178 .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
181 .gem_prime_import = drm_gem_prime_import, 179 .gem_prime_import = drm_gem_prime_import,
@@ -201,6 +199,11 @@ static int pl111_amba_probe(struct amba_device *amba_dev,
201 if (!priv) 199 if (!priv)
202 return -ENOMEM; 200 return -ENOMEM;
203 201
202 if (!variant->broken_vblank) {
203 pl111_drm_driver.enable_vblank = pl111_enable_vblank;
204 pl111_drm_driver.disable_vblank = pl111_disable_vblank;
205 }
206
204 drm = drm_dev_alloc(&pl111_drm_driver, dev); 207 drm = drm_dev_alloc(&pl111_drm_driver, dev);
205 if (IS_ERR(drm)) 208 if (IS_ERR(drm))
206 return PTR_ERR(drm); 209 return PTR_ERR(drm);
diff --git a/drivers/gpu/drm/pl111/pl111_versatile.c b/drivers/gpu/drm/pl111/pl111_versatile.c
index 4b0a54825424..05a4b89e0934 100644
--- a/drivers/gpu/drm/pl111/pl111_versatile.c
+++ b/drivers/gpu/drm/pl111/pl111_versatile.c
@@ -238,6 +238,7 @@ static const struct pl111_variant_data pl110_integrator = {
238 .name = "PL110 Integrator", 238 .name = "PL110 Integrator",
239 .is_pl110 = true, 239 .is_pl110 = true,
240 .broken_clockdivider = true, 240 .broken_clockdivider = true,
241 .broken_vblank = true,
241 .formats = pl110_integrator_pixel_formats, 242 .formats = pl110_integrator_pixel_formats,
242 .nformats = ARRAY_SIZE(pl110_integrator_pixel_formats), 243 .nformats = ARRAY_SIZE(pl110_integrator_pixel_formats),
243}; 244};