<div dir="ltr"><div class="gmail_extra"><br><br><div class="gmail_quote">2013/5/28 Inki Dae <span dir="ltr"><<a href="mailto:inki.dae@samsung.com" target="_blank">inki.dae@samsung.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This patch makes sure that overlay data are updated<br>
to real hardware enabled when framebuffer is released.<br>
For this, this patch checks if crtc and encoder are<br>
valid or not, and then makes it waiting for signal<br>
synchroniztion to only valid encoder.<br>
<br>
Signed-off-by: Inki Dae <<a href="mailto:inki.dae@samsung.com">inki.dae@samsung.com</a>><br>
Signed-off-by: Kyungmin Park <<a href="mailto:kyungmin.park@samsung.com">kyungmin.park@samsung.com</a>><br>
---<br>
drivers/gpu/drm/exynos/exynos_drm_encoder.c | 9 ++++++---<br>
drivers/gpu/drm/exynos/exynos_drm_encoder.h | 2 +-<br>
drivers/gpu/drm/exynos/exynos_drm_fb.c | 13 +++++++++++--<br>
3 files changed, 18 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c b/drivers/gpu/drm/exynos/exynos_drm_encoder.c<br>
index c63721f..9a6e3fd 100644<br>
--- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c<br>
+++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c<br>
@@ -220,18 +220,21 @@ static void exynos_drm_encoder_commit(struct drm_encoder *encoder)<br>
exynos_encoder->dpms = DRM_MODE_DPMS_ON;<br>
}<br>
<br>
-void exynos_drm_encoder_complete_scanout(struct drm_framebuffer *fb)<br>
+void exynos_drm_encoder_complete_scanout(struct drm_crtc *crtc)<br>
{<br>
struct exynos_drm_encoder *exynos_encoder;<br>
struct exynos_drm_manager_ops *ops;<br>
- struct drm_device *dev = fb->dev;<br>
+ struct drm_device *dev = crtc->dev;<br>
struct drm_encoder *encoder;<br>
<br>
/*<br>
* make sure that overlay data are updated to real hardware<br>
- * for all encoders.<br>
+ * for valid encoders.<br>
*/<br>
list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {<br>
+ if (encoder->crtc != crtc)<br>
+ continue;<br>
+<br>
exynos_encoder = to_exynos_encoder(encoder);<br>
ops = exynos_encoder->manager->ops;<br>
<br>
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.h b/drivers/gpu/drm/exynos/exynos_drm_encoder.h<br>
index 89e2fb0..e8dee1c 100644<br>
--- a/drivers/gpu/drm/exynos/exynos_drm_encoder.h<br>
+++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.h<br>
@@ -32,6 +32,6 @@ void exynos_drm_encoder_plane_mode_set(struct drm_encoder *encoder, void *data);<br>
void exynos_drm_encoder_plane_commit(struct drm_encoder *encoder, void *data);<br>
void exynos_drm_encoder_plane_enable(struct drm_encoder *encoder, void *data);<br>
void exynos_drm_encoder_plane_disable(struct drm_encoder *encoder, void *data);<br>
-void exynos_drm_encoder_complete_scanout(struct drm_framebuffer *fb);<br>
+void exynos_drm_encoder_complete_scanout(struct drm_crtc *crtc);<br>
<br>
#endif<br>
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c<br>
index 0e04f4e..1fc7ae6 100644<br>
--- a/drivers/gpu/drm/exynos/exynos_drm_fb.c<br>
+++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c<br>
@@ -68,12 +68,21 @@ static int check_fb_gem_memory_type(struct drm_device *drm_dev,<br>
static void exynos_drm_fb_destroy(struct drm_framebuffer *fb)<br>
{<br>
struct exynos_drm_fb *exynos_fb = to_exynos_fb(fb);<br>
+ struct drm_device *dev = fb->dev;<br>
+ struct drm_crtc *crtc;<br>
unsigned int i;<br>
<br>
DRM_DEBUG_KMS("%s\n", __FILE__);<br>
<br>
- /* make sure that overlay data are updated before relesing fb. */<br>
- exynos_drm_encoder_complete_scanout(fb);<br>
+ list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {<br>
+ if (crtc->fb == fb) {<br></blockquote><div><br></div><div>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.<br></div>
<div><br></div><div>Thanks,<br>Inki Dae <br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ /*<br>
+ * make sure that overlay data are updated before<br>
+ * relesing fb.<br>
+ */<br>
+ exynos_drm_encoder_complete_scanout(crtc);<br>
+ }<br>
+ }<br>
<br>
drm_framebuffer_cleanup(fb);<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
1.7.5.4<br>
<br>
_______________________________________________<br>
dri-devel mailing list<br>
<a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/dri-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
</font></span></blockquote></div><br></div></div>