2013/5/28 Inki Dae <inki.dae@xxxxxxxxxxx>
This patch makes sure that overlay data are updated
to real hardware enabled when framebuffer is released.
For this, this patch checks if crtc and encoder are
valid or not, and then makes it waiting for signal
synchroniztion to only valid encoder.
Signed-off-by: Inki Dae <inki.dae@xxxxxxxxxxx>
Signed-off-by: Kyungmin Park <kyungmin.park@xxxxxxxxxxx>
---
drivers/gpu/drm/exynos/exynos_drm_encoder.c | 9 ++++++---
drivers/gpu/drm/exynos/exynos_drm_encoder.h | 2 +-
drivers/gpu/drm/exynos/exynos_drm_fb.c | 13 +++++++++++--
3 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
index c63721f..9a6e3fd 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
@@ -220,18 +220,21 @@ static void exynos_drm_encoder_commit(struct drm_encoder *encoder)
exynos_encoder->dpms = DRM_MODE_DPMS_ON;
}
-void exynos_drm_encoder_complete_scanout(struct drm_framebuffer *fb)
+void exynos_drm_encoder_complete_scanout(struct drm_crtc *crtc)
{
struct exynos_drm_encoder *exynos_encoder;
struct exynos_drm_manager_ops *ops;
- struct drm_device *dev = fb->dev;
+ struct drm_device *dev = crtc->dev;
struct drm_encoder *encoder;
/*
* make sure that overlay data are updated to real hardware
- * for all encoders.
+ * for valid encoders.
*/
list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
+ if (encoder->crtc != crtc)
+ continue;
+
exynos_encoder = to_exynos_encoder(encoder);
ops = exynos_encoder->manager->ops;
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.h b/drivers/gpu/drm/exynos/exynos_drm_encoder.h
index 89e2fb0..e8dee1c 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_encoder.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.h
@@ -32,6 +32,6 @@ void exynos_drm_encoder_plane_mode_set(struct drm_encoder *encoder, void *data);
void exynos_drm_encoder_plane_commit(struct drm_encoder *encoder, void *data);
void exynos_drm_encoder_plane_enable(struct drm_encoder *encoder, void *data);
void exynos_drm_encoder_plane_disable(struct drm_encoder *encoder, void *data);
-void exynos_drm_encoder_complete_scanout(struct drm_framebuffer *fb);
+void exynos_drm_encoder_complete_scanout(struct drm_crtc *crtc);
#endif
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c
index 0e04f4e..1fc7ae6 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fb.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c
@@ -68,12 +68,21 @@ static int check_fb_gem_memory_type(struct drm_device *drm_dev,
static void exynos_drm_fb_destroy(struct drm_framebuffer *fb)
{
struct exynos_drm_fb *exynos_fb = to_exynos_fb(fb);
+ struct drm_device *dev = fb->dev;
+ struct drm_crtc *crtc;
unsigned int i;
DRM_DEBUG_KMS("%s\n", __FILE__);
- /* make sure that overlay data are updated before relesing fb. */
- exynos_drm_encoder_complete_scanout(fb);
+ list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
+ if (crtc->fb == fb) {
Sorry, crtc->fb could be new fb so in this case, this condition will always be failed. This patch will be posted again after fixed.
Thanks,
Inki Dae
Inki Dae
+ /*
+ * make sure that overlay data are updated before
+ * relesing fb.
+ */
+ exynos_drm_encoder_complete_scanout(crtc);
+ }
+ }
drm_framebuffer_cleanup(fb);
--
1.7.5.4
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/dri-devel