Skip to content

Commit 83326a7

Browse files
committed
drm/ingenic: Use standard drm_atomic_helper_commit_tail
By making the CRTC's .vblank_enable() function return an error when it is known that the hardware won't deliver a VBLANK, we can drop the ingenic_drm_atomic_helper_commit_tail() function and use the standard drm_atomic_helper_commit_tail() function instead. Signed-off-by: Paul Cercueil <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 4d3b3c9 commit 83326a7

File tree

1 file changed

+4
-24
lines changed

1 file changed

+4
-24
lines changed

drivers/gpu/drm/ingenic/ingenic-drm-drv.c

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -701,29 +701,6 @@ static int ingenic_drm_encoder_atomic_check(struct drm_encoder *encoder,
701701
}
702702
}
703703

704-
static void ingenic_drm_atomic_helper_commit_tail(struct drm_atomic_state *old_state)
705-
{
706-
/*
707-
* Just your regular drm_atomic_helper_commit_tail(), but only calls
708-
* drm_atomic_helper_wait_for_vblanks() if priv->no_vblank.
709-
*/
710-
struct drm_device *dev = old_state->dev;
711-
struct ingenic_drm *priv = drm_device_get_priv(dev);
712-
713-
drm_atomic_helper_commit_modeset_disables(dev, old_state);
714-
715-
drm_atomic_helper_commit_planes(dev, old_state, 0);
716-
717-
drm_atomic_helper_commit_modeset_enables(dev, old_state);
718-
719-
drm_atomic_helper_commit_hw_done(old_state);
720-
721-
if (!priv->no_vblank)
722-
drm_atomic_helper_wait_for_vblanks(dev, old_state);
723-
724-
drm_atomic_helper_cleanup_planes(dev, old_state);
725-
}
726-
727704
static irqreturn_t ingenic_drm_irq_handler(int irq, void *arg)
728705
{
729706
struct ingenic_drm *priv = drm_device_get_priv(arg);
@@ -744,6 +721,9 @@ static int ingenic_drm_enable_vblank(struct drm_crtc *crtc)
744721
{
745722
struct ingenic_drm *priv = drm_crtc_get_priv(crtc);
746723

724+
if (priv->no_vblank)
725+
return -EINVAL;
726+
747727
regmap_update_bits(priv->map, JZ_REG_LCD_CTRL,
748728
JZ_LCD_CTRL_EOF_IRQ, JZ_LCD_CTRL_EOF_IRQ);
749729

@@ -851,7 +831,7 @@ static const struct drm_mode_config_funcs ingenic_drm_mode_config_funcs = {
851831
};
852832

853833
static struct drm_mode_config_helper_funcs ingenic_drm_mode_config_helpers = {
854-
.atomic_commit_tail = ingenic_drm_atomic_helper_commit_tail,
834+
.atomic_commit_tail = drm_atomic_helper_commit_tail,
855835
};
856836

857837
static void ingenic_drm_unbind_all(void *d)

0 commit comments

Comments
 (0)