drm/exynos: improve vidi refresh rate + async commit
Subsystems (3)
cover drm/exynos: improve vidi refresh rate + async commit
From: Gustavo Padovan <[email protected]>
Hi,
The first patch in this series add support to async page flips, but it doesn't improve the refresh rate when using vidi+fimd.
The second patch fixes an issue on vidi that solves the refresh rate issue when only vidi is used. For the case where vidi + fimd is used it improves the refresh rate from 20Hz to 28Hz. There is room to improve this more, but I think these patches can already be pushed upstream.
It is important to remember that the low refresh rate issue only happens when vidi is used along with another crtc. It doesn't happen in a setup that has only FIMD and/or Mixer, thus most of use cases out there are not affected.
Gustavo
---
Gustavo Padovan (3):
drm/exynos: add atomic asynchronous commit drm/exynos: vidi: always handle vblank on planes updates drm/exynos: pass the correct pipe number
drivers/gpu/drm/exynos/exynos_drm_crtc.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_drv.c | 6 ++++ drivers/gpu/drm/exynos/exynos_drm_drv.h | 6 ++++ drivers/gpu/drm/exynos/exynos_drm_fb.c | 51 +++++++++++++++++++++++++------- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 3 +- 5 files changed, 55 insertions(+), 13 deletions(-)
Signature · 6 lines
2.1.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 1/3 drm/exynos: add atomic asynchronous commit
From: Gustavo Padovan <[email protected]>
The atomic modesetting interfaces supports async commits that should be implemented by the drivers. If drm core requests an async commit exynos_atomic_commit() will schedule a work task to run the update later. It also waits to an update to finishes to schedule a new one.
--- drivers/gpu/drm/exynos/exynos_drm_drv.c | 6 ++++ drivers/gpu/drm/exynos/exynos_drm_drv.h | 6 ++++ drivers/gpu/drm/exynos/exynos_drm_fb.c | 51 ++++++++++++++++++++++++++------- 3 files changed, 52 insertions(+), 11 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_drv.c +6 -0
@@ -47,6 +47,9 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)if (!private)return -ENOMEM ; +INIT_WORK (&private->work, exynos_drm_atomic_work); + private->dev = dev; +dev_set_drvdata (dev->dev, dev); dev->dev_private = (void *)private;
@@ -127,6 +130,8 @@ err_free_private:static int exynos_drm_unload (struct drm_device *dev) { +struct exynos_drm_private *private = dev->dev_private; +exynos_drm_device_subdrv_remove (dev);exynos_drm_fbdev_fini (dev);
@@ -137,6 +142,7 @@ static int exynos_drm_unload(struct drm_device *dev)drm_mode_config_cleanup (dev);drm_release_iommu_mapping (dev); +flush_work (&private->work);kfree (dev->dev_private); dev->dev_private =NULL ;
drivers/gpu/drm/exynos/exynos_drm_drv.h +6 -0
@@ -243,6 +243,10 @@ struct exynos_drm_private {unsigned long da_space_size;unsigned int pipe; + +struct drm_device *dev; +struct work_struct work; +struct drm_atomic_state *state; };/*
@@ -295,6 +299,8 @@ static inline int exynos_dpi_remove(struct exynos_drm_display *display) }#endif +void exynos_drm_atomic_work (struct work_struct *work); +/* This function creates a encoder and a connector, and initializes them. */ int exynos_drm_create_enc_conn (struct drm_device *dev,struct exynos_drm_display *display);
drivers/gpu/drm/exynos/exynos_drm_fb.c +40 -11
66 lines not on this page · raw message
Signature · 6 lines
2.1.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/3 drm/exynos: vidi: always handle vblank on planes updates
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
We need to call drm_handle_vblank() after each successful plane update to update vblank counter and send the necessary events.
--- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/exynos/exynos_drm_vidi.c +2 -1
@@ -193,10 +193,11 @@ static void vidi_fake_vblank_handler(struct work_struct *work)/* refresh rate is about 50Hz. */ usleep_range (16000 ,20000 ); +drm_handle_vblank (ctx->drm_dev, ctx->pipe); +mutex_lock (&ctx->lock);if (ctx->direct_vblank) { -drm_handle_vblank (ctx->drm_dev, ctx->pipe); ctx->direct_vblank = false;mutex_unlock (&ctx->lock);return ;
Signature · 1 line
2.1.0
PATCH 3/3 drm/exynos: pass the correct pipe number
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
Instead of giving -1 to as arg to drm_send_vblank_event() pass the correct pipe number to it.
--- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/exynos/exynos_drm_crtc.c +1 -1
@@ -203,7 +203,7 @@ void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int pipe)spin_lock_irqsave (&dev->event_lock, flags);if (exynos_crtc->event) { -drm_send_vblank_event (dev,-1 , exynos_crtc->event); +drm_send_vblank_event (dev, pipe, exynos_crtc->event);drm_vblank_put (dev, pipe);wake_up (&exynos_crtc->pending_flip_queue);
Signature · 1 line
2.1.0