Commit f74085a9 authored by Prathyush K's avatar Prathyush K Committed by Inki Dae

drm/exynos: make wait_for_vblank a manager op

Changelog v2:
remove unnecessay wait_for_vblank call.
- with this patch, wait_for_vblank callback is moved from
  overlay ops to manager ops so it should be removed and
  it doesn't need to wait vblank signal at plane disable.

Changelog v1:
The wait_for_vblank callback is moved from overlay ops to manager ops
of exynos drm driver. Also, the check for DPMS OFF of encoder is
removed before calling wait_for_vblank.
Signed-off-by: default avatarPrathyush K <prathyush.k@samsung.com>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
parent a7b362fb
...@@ -74,8 +74,6 @@ enum exynos_drm_output_type { ...@@ -74,8 +74,6 @@ enum exynos_drm_output_type {
* @commit: apply hardware specific overlay data to registers. * @commit: apply hardware specific overlay data to registers.
* @enable: enable hardware specific overlay. * @enable: enable hardware specific overlay.
* @disable: disable hardware specific overlay. * @disable: disable hardware specific overlay.
* @wait_for_vblank: wait for vblank interrupt to make sure that
* hardware overlay is disabled.
*/ */
struct exynos_drm_overlay_ops { struct exynos_drm_overlay_ops {
void (*mode_set)(struct device *subdrv_dev, void (*mode_set)(struct device *subdrv_dev,
...@@ -83,7 +81,6 @@ struct exynos_drm_overlay_ops { ...@@ -83,7 +81,6 @@ struct exynos_drm_overlay_ops {
void (*commit)(struct device *subdrv_dev, int zpos); void (*commit)(struct device *subdrv_dev, int zpos);
void (*enable)(struct device *subdrv_dev, int zpos); void (*enable)(struct device *subdrv_dev, int zpos);
void (*disable)(struct device *subdrv_dev, int zpos); void (*disable)(struct device *subdrv_dev, int zpos);
void (*wait_for_vblank)(struct device *subdrv_dev);
}; };
/* /*
...@@ -186,6 +183,8 @@ struct exynos_drm_display_ops { ...@@ -186,6 +183,8 @@ struct exynos_drm_display_ops {
* @commit: set current hw specific display mode to hw. * @commit: set current hw specific display mode to hw.
* @enable_vblank: specific driver callback for enabling vblank interrupt. * @enable_vblank: specific driver callback for enabling vblank interrupt.
* @disable_vblank: specific driver callback for disabling vblank interrupt. * @disable_vblank: specific driver callback for disabling vblank interrupt.
* @wait_for_vblank: wait for vblank interrupt to make sure that
* hardware overlay is updated.
*/ */
struct exynos_drm_manager_ops { struct exynos_drm_manager_ops {
void (*dpms)(struct device *subdrv_dev, int mode); void (*dpms)(struct device *subdrv_dev, int mode);
...@@ -200,6 +199,7 @@ struct exynos_drm_manager_ops { ...@@ -200,6 +199,7 @@ struct exynos_drm_manager_ops {
void (*commit)(struct device *subdrv_dev); void (*commit)(struct device *subdrv_dev);
int (*enable_vblank)(struct device *subdrv_dev); int (*enable_vblank)(struct device *subdrv_dev);
void (*disable_vblank)(struct device *subdrv_dev); void (*disable_vblank)(struct device *subdrv_dev);
void (*wait_for_vblank)(struct device *subdrv_dev);
}; };
/* /*
......
...@@ -237,8 +237,7 @@ static void exynos_drm_encoder_commit(struct drm_encoder *encoder) ...@@ -237,8 +237,7 @@ static void exynos_drm_encoder_commit(struct drm_encoder *encoder)
void exynos_drm_encoder_complete_scanout(struct drm_framebuffer *fb) void exynos_drm_encoder_complete_scanout(struct drm_framebuffer *fb)
{ {
struct exynos_drm_encoder *exynos_encoder; struct exynos_drm_encoder *exynos_encoder;
struct exynos_drm_overlay_ops *overlay_ops; struct exynos_drm_manager_ops *ops;
struct exynos_drm_manager *manager;
struct drm_device *dev = fb->dev; struct drm_device *dev = fb->dev;
struct drm_encoder *encoder; struct drm_encoder *encoder;
...@@ -248,21 +247,15 @@ void exynos_drm_encoder_complete_scanout(struct drm_framebuffer *fb) ...@@ -248,21 +247,15 @@ void exynos_drm_encoder_complete_scanout(struct drm_framebuffer *fb)
*/ */
list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
exynos_encoder = to_exynos_encoder(encoder); exynos_encoder = to_exynos_encoder(encoder);
ops = exynos_encoder->manager->ops;
/* if exynos was disabled, just ignor it. */
if (exynos_encoder->dpms > DRM_MODE_DPMS_ON)
continue;
manager = exynos_encoder->manager;
overlay_ops = manager->overlay_ops;
/* /*
* wait for vblank interrupt * wait for vblank interrupt
* - this makes sure that overlay data are updated to * - this makes sure that overlay data are updated to
* real hardware. * real hardware.
*/ */
if (overlay_ops->wait_for_vblank) if (ops->wait_for_vblank)
overlay_ops->wait_for_vblank(manager->dev); ops->wait_for_vblank(exynos_encoder->manager->dev);
} }
} }
...@@ -538,14 +531,4 @@ void exynos_drm_encoder_plane_disable(struct drm_encoder *encoder, void *data) ...@@ -538,14 +531,4 @@ void exynos_drm_encoder_plane_disable(struct drm_encoder *encoder, void *data)
if (overlay_ops && overlay_ops->disable) if (overlay_ops && overlay_ops->disable)
overlay_ops->disable(manager->dev, zpos); overlay_ops->disable(manager->dev, zpos);
/*
* wait for vblank interrupt
* - this makes sure that hardware overlay is disabled to avoid
* for the dma accesses to memory after gem buffer was released
* because the setting for disabling the overlay will be updated
* at vsync.
*/
if (overlay_ops && overlay_ops->wait_for_vblank)
overlay_ops->wait_for_vblank(manager->dev);
} }
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