Commit 08e32112 authored by Linus Walleij's avatar Linus Walleij

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: default avatarEric Anholt <eric@anholt.net>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180206093540.8147-4-linus.walleij@linaro.org
parent eedd6033
...@@ -256,7 +256,8 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe, ...@@ -256,7 +256,8 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe,
cntl |= CNTL_LCDPWR; cntl |= CNTL_LCDPWR;
writel(cntl, priv->regs + priv->ctrl); writel(cntl, priv->regs + priv->ctrl);
drm_crtc_vblank_on(crtc); if (!priv->variant->broken_vblank)
drm_crtc_vblank_on(crtc);
} }
void pl111_display_disable(struct drm_simple_display_pipe *pipe) void pl111_display_disable(struct drm_simple_display_pipe *pipe)
...@@ -266,7 +267,8 @@ void pl111_display_disable(struct drm_simple_display_pipe *pipe) ...@@ -266,7 +267,8 @@ void pl111_display_disable(struct drm_simple_display_pipe *pipe)
struct pl111_drm_dev_private *priv = drm->dev_private; struct pl111_drm_dev_private *priv = drm->dev_private;
u32 cntl; u32 cntl;
drm_crtc_vblank_off(crtc); if (!priv->variant->broken_vblank)
drm_crtc_vblank_off(crtc);
/* Power Down */ /* Power Down */
cntl = readl(priv->regs + priv->ctrl); cntl = readl(priv->regs + priv->ctrl);
......
...@@ -40,6 +40,7 @@ struct drm_minor; ...@@ -40,6 +40,7 @@ struct drm_minor;
* BGR/RGB routing * BGR/RGB routing
* @broken_clockdivider: the clock divider is broken and we need to * @broken_clockdivider: the clock divider is broken and we need to
* use the supplied clock directly * use the supplied clock directly
* @broken_vblank: the vblank IRQ is broken on this variant
* @formats: array of supported pixel formats on this variant * @formats: array of supported pixel formats on this variant
* @nformats: the length of the array of supported pixel formats * @nformats: the length of the array of supported pixel formats
*/ */
...@@ -48,6 +49,7 @@ struct pl111_variant_data { ...@@ -48,6 +49,7 @@ struct pl111_variant_data {
bool is_pl110; bool is_pl110;
bool external_bgr; bool external_bgr;
bool broken_clockdivider; bool broken_clockdivider;
bool broken_vblank;
const u32 *formats; const u32 *formats;
unsigned int nformats; unsigned int nformats;
}; };
......
...@@ -132,10 +132,12 @@ static int pl111_modeset_init(struct drm_device *dev) ...@@ -132,10 +132,12 @@ static int pl111_modeset_init(struct drm_device *dev)
if (ret) if (ret)
return ret; return ret;
ret = drm_vblank_init(dev, 1); if (!priv->variant->broken_vblank) {
if (ret != 0) { ret = drm_vblank_init(dev, 1);
dev_err(dev->dev, "Failed to init vblank\n"); if (ret != 0) {
goto out_bridge; dev_err(dev->dev, "Failed to init vblank\n");
goto out_bridge;
}
} }
drm_mode_config_reset(dev); drm_mode_config_reset(dev);
...@@ -172,10 +174,6 @@ static struct drm_driver pl111_drm_driver = { ...@@ -172,10 +174,6 @@ static struct drm_driver pl111_drm_driver = {
.dumb_create = drm_gem_cma_dumb_create, .dumb_create = drm_gem_cma_dumb_create,
.gem_free_object_unlocked = drm_gem_cma_free_object, .gem_free_object_unlocked = drm_gem_cma_free_object,
.gem_vm_ops = &drm_gem_cma_vm_ops, .gem_vm_ops = &drm_gem_cma_vm_ops,
.enable_vblank = pl111_enable_vblank,
.disable_vblank = pl111_disable_vblank,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle, .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import = drm_gem_prime_import, .gem_prime_import = drm_gem_prime_import,
...@@ -201,6 +199,11 @@ static int pl111_amba_probe(struct amba_device *amba_dev, ...@@ -201,6 +199,11 @@ static int pl111_amba_probe(struct amba_device *amba_dev,
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
if (!variant->broken_vblank) {
pl111_drm_driver.enable_vblank = pl111_enable_vblank;
pl111_drm_driver.disable_vblank = pl111_disable_vblank;
}
drm = drm_dev_alloc(&pl111_drm_driver, dev); drm = drm_dev_alloc(&pl111_drm_driver, dev);
if (IS_ERR(drm)) if (IS_ERR(drm))
return PTR_ERR(drm); return PTR_ERR(drm);
......
...@@ -238,6 +238,7 @@ static const struct pl111_variant_data pl110_integrator = { ...@@ -238,6 +238,7 @@ static const struct pl111_variant_data pl110_integrator = {
.name = "PL110 Integrator", .name = "PL110 Integrator",
.is_pl110 = true, .is_pl110 = true,
.broken_clockdivider = true, .broken_clockdivider = true,
.broken_vblank = true,
.formats = pl110_integrator_pixel_formats, .formats = pl110_integrator_pixel_formats,
.nformats = ARRAY_SIZE(pl110_integrator_pixel_formats), .nformats = ARRAY_SIZE(pl110_integrator_pixel_formats),
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment