Skip to contentSkip to conversation

drm/exynos: remove hardware overlays disable from fimd probe

PATCH In review Rahul Sharma 5 participants 12 messages May 28, 2014 – Jun 23, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/exynos: remove hardware overlays disable from fimd probe

System hangs when FIMD registers are accessed to disable hardware overlays. This is because of the clocks which are not enabled before register access.

'Hardware overlay disable' is cleaned from the FIMD probe.

---
Based on exynos-drm-next branch.

 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   17 -----------------
 1 file changed, 17 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +0 -17
index bd30d0c..2ec634f 100644
@@ -703,19 +703,6 @@ static void fimd_win_disable(struct exynos_drm_manager *mgr, int zpos)
 	win_data->enabled = false;
 }
 
-static void fimd_clear_win(struct fimd_context *ctx, int win)
-{
-	writel(0, ctx->regs + WINCON(win));
-	writel(0, ctx->regs + VIDOSD_A(win));
-	writel(0, ctx->regs + VIDOSD_B(win));
-	writel(0, ctx->regs + VIDOSD_C(win));
-
-	if (win == 1 || win == 2)
-		writel(0, ctx->regs + VIDOSD_D(win));
-
-	fimd_shadow_protect_win(ctx, win, false);
-}
-
 static void fimd_window_suspend(struct exynos_drm_manager *mgr)
 {
 	struct fimd_context *ctx = mgr->ctx;
@@ -898,16 +885,12 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)
 {
 	struct fimd_context *ctx = fimd_manager.ctx;
 	struct drm_device *drm_dev = data;
-	int win;
 
 	fimd_mgr_initialize(&fimd_manager, drm_dev);
 	exynos_drm_crtc_create(&fimd_manager);
 	if (ctx->display)
 		exynos_drm_create_enc_conn(drm_dev, ctx->display);
 
-	for (win = 0; win < WINDOWS_NR; win++)
-		fimd_clear_win(ctx, win);
-
 	return 0;
 
 }
Signature · 1 line
1.7.9.5
#1 lore raw

Hi Rahul,

Quoted 7 lines · Rahul Sharma

System hangs when FIMD registers are accessed to disable hardware overlays. This is because of the clocks which are not enabled before register access.

'Hardware overlay disable' is cleaned from the FIMD probe.

This patch causes regression on some exynos4210-universal_c210 devices, everything works expect colors are incorrect - it seems blue component is very dark, almost black.

Regards
Andrzej

Quoted 48 lines

---
Based on exynos-drm-next branch.

 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   17 -----------------
 1 file changed, 17 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +0 -17
index bd30d0c..2ec634f 100644
@@ -703,19 +703,6 @@ static void fimd_win_disable(struct exynos_drm_manager *mgr, int zpos)
 	win_data->enabled = false;
 }
 
-static void fimd_clear_win(struct fimd_context *ctx, int win)
-{
-	writel(0, ctx->regs + WINCON(win));
-	writel(0, ctx->regs + VIDOSD_A(win));
-	writel(0, ctx->regs + VIDOSD_B(win));
-	writel(0, ctx->regs + VIDOSD_C(win));
-
-	if (win == 1 || win == 2)
-		writel(0, ctx->regs + VIDOSD_D(win));
-
-	fimd_shadow_protect_win(ctx, win, false);
-}
-
 static void fimd_window_suspend(struct exynos_drm_manager *mgr)
 {
 	struct fimd_context *ctx = mgr->ctx;
@@ -898,16 +885,12 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)
 {
 	struct fimd_context *ctx = fimd_manager.ctx;
 	struct drm_device *drm_dev = data;
-	int win;
 
 	fimd_mgr_initialize(&fimd_manager, drm_dev);
 	exynos_drm_crtc_create(&fimd_manager);
 	if (ctx->display)
 		exynos_drm_create_enc_conn(drm_dev, ctx->display);
 
-	for (win = 0; win < WINDOWS_NR; win++)
-		fimd_clear_win(ctx, win);
-
 	return 0;
 
 }
#2 lore raw
Quoted 7 lines · Andrzej Hajda

Hi Rahul,

Quoted 4 lines · Rahul Sharma

System hangs when FIMD registers are accessed to disable hardware overlays. This is because of the clocks which are not enabled before register access.

Quoted 8 lines
Quoted 3 lines

'Hardware overlay disable' is cleaned from the FIMD probe.

This patch causes regression on some exynos4210-universal_c210 devices, everything works expect colors are incorrect - it seems blue component is very dark, almost black.

Oh.... Sorry for that. I did not see any problem on 5250/5420/5800. I do not have setup for 4210. Better we should revert this patch.

Would you please help me by verifying the following patch on 4210? This is an alternate solution to the same problem.

http://www.mail-archive.com/[email protected]/msg31426.html

Thanks Andrej, for bringing it to notice.

Regards,
Rahul Sharma

Quoted 52 lines

Regards
Andrzej

Quoted 48 lines

---
Based on exynos-drm-next branch.

 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   17 -----------------
 1 file changed, 17 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +0 -17
index bd30d0c..2ec634f 100644
@@ -703,19 +703,6 @@ static void fimd_win_disable(struct exynos_drm_manager *mgr, int zpos)
      win_data->enabled = false;
 }
 
-static void fimd_clear_win(struct fimd_context *ctx, int win)
-{
-     writel(0, ctx->regs + WINCON(win));
-     writel(0, ctx->regs + VIDOSD_A(win));
-     writel(0, ctx->regs + VIDOSD_B(win));
-     writel(0, ctx->regs + VIDOSD_C(win));
-
-     if (win == 1 || win == 2)
-             writel(0, ctx->regs + VIDOSD_D(win));
-
-     fimd_shadow_protect_win(ctx, win, false);
-}
-
 static void fimd_window_suspend(struct exynos_drm_manager *mgr)
 {
      struct fimd_context *ctx = mgr->ctx;
@@ -898,16 +885,12 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)
 {
      struct fimd_context *ctx = fimd_manager.ctx;
      struct drm_device *drm_dev = data;
-     int win;
 
      fimd_mgr_initialize(&fimd_manager, drm_dev);
      exynos_drm_crtc_create(&fimd_manager);
      if (ctx->display)
              exynos_drm_create_enc_conn(drm_dev, ctx->display);
 
-     for (win = 0; win < WINDOWS_NR; win++)
-             fimd_clear_win(ctx, win);
-
      return 0;
 
 }
#3 lore raw

Hi Rahul, Andrzej,

Quoted 20 lines · Rahul Sharma
Quoted 7 lines · Andrzej Hajda

Hi Rahul,

Quoted 4 lines · Rahul Sharma

System hangs when FIMD registers are accessed to disable hardware overlays. This is because of the clocks which are not enabled before register access.

Quoted 8 lines
Quoted 3 lines

'Hardware overlay disable' is cleaned from the FIMD probe.

This patch causes regression on some exynos4210-universal_c210 devices, everything works expect colors are incorrect - it seems blue component is very dark, almost black.

Oh.... Sorry for that. I did not see any problem on 5250/5420/5800. I do not have setup for 4210. Better we should revert this patch.

Quoted 6 lines

Would you please help me by verifying the following patch on 4210? This is an alternate solution to the same problem.

http://www.mail-archive.com/[email protected]/msg31426.html

Thanks Andrej, for bringing it to notice.

I don't see how this patch could introduce such regression, as all the affected registers seem to be properly reconfigured in fimd_win_commit() anyway.

IMHO instead of reverting the patch, this issue should be investigated and fixed properly.

Best regards,
Tomasz

#4 lore raw
Quoted 34 lines · Tomasz Figa

Hi Rahul, Andrzej,

Quoted 20 lines · Rahul Sharma
Quoted 7 lines · Andrzej Hajda

Hi Rahul,

Quoted 4 lines · Rahul Sharma

System hangs when FIMD registers are accessed to disable hardware overlays. This is because of the clocks which are not enabled before register access.

Quoted 8 lines
Quoted 3 lines

'Hardware overlay disable' is cleaned from the FIMD probe.

This patch causes regression on some exynos4210-universal_c210 devices, everything works expect colors are incorrect - it seems blue component is very dark, almost black.

Oh.... Sorry for that. I did not see any problem on 5250/5420/5800. I do not have setup for 4210. Better we should revert this patch.

Quoted 6 lines

Would you please help me by verifying the following patch on 4210? This is an alternate solution to the same problem.

http://www.mail-archive.com/[email protected]/msg31426.html

Thanks Andrej, for bringing it to notice.

I don't see how this patch could introduce such regression, as all the affected registers seem to be properly reconfigured in fimd_win_commit() anyway.

Quoted 6 lines

IMHO instead of reverting the patch, this issue should be investigated and fixed properly.

Best regards,
Tomasz

I am looking at the problem, it is quite strange as it happens only on one of two targets I have access to. Anyway it seems that something should be added to fimd initialization sequence if we want to remove hw accessing code from probe.

Regards
Andrzej

#5 lore raw
Quoted 38 lines · Andrzej Hajda
Quoted 37 lines · Tomasz Figa

Hi Rahul, Andrzej,

Quoted 20 lines · Rahul Sharma
Quoted 7 lines · Andrzej Hajda

Hi Rahul,

Quoted 4 lines · Rahul Sharma

System hangs when FIMD registers are accessed to disable hardware overlays. This is because of the clocks which are not enabled before register access.

Quoted 8 lines
Quoted 3 lines

'Hardware overlay disable' is cleaned from the FIMD probe.

This patch causes regression on some exynos4210-universal_c210 devices, everything works expect colors are incorrect - it seems blue component is very dark, almost black.

Oh.... Sorry for that. I did not see any problem on 5250/5420/5800. I do not have setup for 4210. Better we should revert this patch.

Quoted 6 lines

Would you please help me by verifying the following patch on 4210? This is an alternate solution to the same problem.

http://www.mail-archive.com/[email protected]/msg31426.html

Thanks Andrej, for bringing it to notice.

I don't see how this patch could introduce such regression, as all the affected registers seem to be properly reconfigured in fimd_win_commit() anyway.

IMHO instead of reverting the patch, this issue should be investigated and fixed properly.

Quoted 8 lines
Quoted 3 lines

Best regards,
Tomasz

I am looking at the problem, it is quite strange as it happens only on one of two targets I have access to. Anyway it seems that something should be added to fimd initialization sequence if we want to remove hw accessing code from probe.

The problem is that fimd does not clear unused windows. Simple patch which helps:

(quoted diff) +0 -0

b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 2ec634f..b58fce2 100644

drivers/gpu/drm/exynos/exynos_drm_fimd.c +2 -0
@@ -741,6 +741,8 @@ static void fimd_apply(struct exynos_drm_manager *mgr)
                win_data = &ctx->win_data[i];
                if (win_data->enabled)
                        fimd_win_commit(mgr, i);
+               else
+                       fimd_win_disable(mgr, i);
        }
 
        fimd_commit(mgr);

But I am not fully familiar with window management code, so I do not know if it does not breaks other stuff.

Regards
Andrzej

Quoted 4 lines

Regards
Andrzej

maintainer
#6 lore raw
Quoted 66 lines · Andrzej Hajda
Quoted 38 lines · Andrzej Hajda
Quoted 37 lines · Tomasz Figa

Hi Rahul, Andrzej,

Quoted 20 lines · Rahul Sharma
Quoted 7 lines · Andrzej Hajda

Hi Rahul,

Quoted 4 lines · Rahul Sharma

System hangs when FIMD registers are accessed to disable hardware overlays. This is because of the clocks which are not enabled before register access.

Quoted 8 lines
Quoted 3 lines

'Hardware overlay disable' is cleaned from the FIMD probe.

This patch causes regression on some exynos4210-universal_c210 devices, everything works expect colors are incorrect - it seems blue component is very dark, almost black.

Oh.... Sorry for that. I did not see any problem on 5250/5420/5800. I do not have setup for 4210. Better we should revert this patch.

Quoted 6 lines

Would you please help me by verifying the following patch on 4210? This is an alternate solution to the same problem.

http://www.mail-archive.com/[email protected]/msg31426.html

Thanks Andrej, for bringing it to notice.

I don't see how this patch could introduce such regression, as all the affected registers seem to be properly reconfigured in fimd_win_commit() anyway.

IMHO instead of reverting the patch, this issue should be investigated and fixed properly.

Quoted 8 lines
Quoted 3 lines

Best regards,
Tomasz

I am looking at the problem, it is quite strange as it happens only on one of two targets I have access to. Anyway it seems that something should be added to fimd initialization sequence if we want to remove hw accessing code from probe.

The problem is that fimd does not clear unused windows. Simple patch which helps:

drivers/gpu/drm/exynos/exynos_drm_fimd.c +2 -0
index 2ec634f..b58fce2 100644
@@ -741,6 +741,8 @@ static void fimd_apply(struct exynos_drm_manager *mgr)
                win_data = &ctx->win_data[i];
                if (win_data->enabled)
                        fimd_win_commit(mgr, i);
+               else
+                       fimd_win_disable(mgr, i);
        }
 
        fimd_commit(mgr);
Quoted 2 lines

But I am not fully familiar with window management code, so I do not know if it does not breaks other stuff.

It looks good to me. Can you post it?

Thanks,
Inki Dae

Quoted 10 lines

Regards
Andrzej

Quoted 4 lines

Regards
Andrzej

#7 lore raw

PATCH 1/1 drm/exynos: disable unused windows on apply

The patch disables non-enabled HW windows on applying configuration, it will allow to clear windows enabled by bootloader.

---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +2 -0
index bb45ab2..33161ad 100644
@@ -741,6 +741,8 @@ static void fimd_apply(struct exynos_drm_manager *mgr)
 		win_data = &ctx->win_data[i];
 		if (win_data->enabled)
 			fimd_win_commit(mgr, i);
+		else
+			fimd_win_disable(mgr, i);
 	}
 
 	fimd_commit(mgr);
Signature · 1 line
1.9.1
#8 lore raw

Re: [PATCH] drm/exynos: disable unused windows on apply

Gently ping.

Regards
Andrzej

Quoted 22 lines · Andrzej Hajda

The patch disables non-enabled HW windows on applying configuration, it will allow to clear windows enabled by bootloader.

---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +2 -0
index bb45ab2..33161ad 100644
@@ -741,6 +741,8 @@ static void fimd_apply(struct exynos_drm_manager *mgr)
 		win_data = &ctx->win_data[i];
 		if (win_data->enabled)
 			fimd_win_commit(mgr, i);
+		else
+			fimd_win_disable(mgr, i);
 	}
 
 	fimd_commit(mgr);
maintainer
#9 lore raw

Re: [PATCH] drm/exynos: disable unused windows on apply

Quoted 1 line · Andrzej Hajda

Gently ping.

Oops, sorry. Applied.

Thanks,
Inki Dae

Quoted 26 lines

Regards
Andrzej

Quoted 21 lines · Andrzej Hajda

The patch disables non-enabled HW windows on applying configuration, it will allow to clear windows enabled by bootloader.

---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +2 -0
index bb45ab2..33161ad 100644
@@ -741,6 +741,8 @@ static void fimd_apply(struct exynos_drm_manager *mgr)
 		win_data = &ctx->win_data[i];
 		if (win_data->enabled)
 			fimd_win_commit(mgr, i);
+		else
+			fimd_win_disable(mgr, i);
 	}
 
Quoted 3 lines

drivers/gpu/drm/exynos/exynos_drm_fimd.c static void fimd_apply(struct exynos_drm_manager *mgr) · line 748

Quoted 1 line
drivers/gpu/drm/exynos/exynos_drm_fimd.c +0 -0
 	fimd_commit(mgr);

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#10 lore raw
In reply to Rahul Sharma

Hi Rahul,

Quoted 17 lines · Rahul Sharma
Quoted 7 lines · Andrzej Hajda

Hi Rahul,

Quoted 4 lines · Rahul Sharma

System hangs when FIMD registers are accessed to disable hardware overlays. This is because of the clocks which are not enabled before register access.

Quoted 8 lines
Quoted 3 lines

'Hardware overlay disable' is cleaned from the FIMD probe.

This patch causes regression on some exynos4210-universal_c210 devices, everything works expect colors are incorrect - it seems blue component is very dark, almost black.

Quoted 7 lines

Oh.... Sorry for that. I did not see any problem on 5250/5420/5800. I do not have setup for 4210. Better we should revert this patch.

Would you please help me by verifying the following patch on 4210? This is an alternate solution to the same problem.

http://www.mail-archive.com/[email protected]/msg31426.html

In my humble opinion, the patch is required to modify like below:

+ ret = pm_runtime_get_sync(ctx->dev);
+ if (ret < 0) {

When the bootloader enabled FIMD to show logo(boot image) or animation, this function pm_runtime_get_sync() in fimd_bind() would return 1.

Thank you.
Best regards YJ

Quoted 63 lines

Thanks Andrej, for bringing it to notice.

Regards,
Rahul Sharma

Quoted 44 lines

Regards
Andrzej

Quoted 41 lines

---
Based on exynos-drm-next branch.

  drivers/gpu/drm/exynos/exynos_drm_fimd.c |   17 -----------------
  1 file changed, 17 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +0 -14
index bd30d0c..2ec634f 100644
@@ -703,19 +703,6 @@ static void fimd_win_disable(struct exynos_drm_manager *mgr, int zpos)
       win_data->enabled = false;
  }
 
-static void fimd_clear_win(struct fimd_context *ctx, int win)
-{
-     writel(0, ctx->regs + WINCON(win));
-     writel(0, ctx->regs + VIDOSD_A(win));
-     writel(0, ctx->regs + VIDOSD_B(win));
-     writel(0, ctx->regs + VIDOSD_C(win));
-
-     if (win == 1 || win == 2)
-             writel(0, ctx->regs + VIDOSD_D(win));
-
-     fimd_shadow_protect_win(ctx, win, false);
-}
-
  static void fimd_window_suspend(struct exynos_drm_manager *mgr)
  {
       struct fimd_context *ctx = mgr->ctx;
@@ -898,16 +885,12 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)
  {
       struct fimd_context *ctx = fimd_manager.ctx;
       struct drm_device *drm_dev = data;
-     int win;
 
       fimd_mgr_initialize(&fimd_manager, drm_dev);
       exynos_drm_crtc_create(&fimd_manager);
       if (ctx->display)
               exynos_drm_create_enc_conn(drm_dev, ctx->display);
 
Quoted 8 lines

drivers/gpu/drm/exynos/exynos_drm_fimd.c static int fimd_bind(struct device *dev, struct device *master, void *data) · line 896

Quoted 7 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c +0 -3
-     for (win = 0; win < WINDOWS_NR; win++)
-             fimd_clear_win(ctx, win);
-
       return 0;
 
  }

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer
#11 lore raw
In reply to Rahul Sharma
Quoted 8 lines · Rahul Sharma
Quoted 7 lines · Andrzej Hajda

Hi Rahul,

Quoted 4 lines · Rahul Sharma

System hangs when FIMD registers are accessed to disable hardware overlays. This is because of the clocks which are not enabled before register access.

Quoted 7 lines
Quoted 7 lines
Quoted 3 lines

'Hardware overlay disable' is cleaned from the FIMD probe.

This patch causes regression on some exynos4210-universal_c210 devices, everything works expect colors are incorrect - it seems blue component is very dark, almost black.

That issue would be because your boot-loader enabled a hardware overlay but kernel driver enables another hardware overlay, which would also be why it happens only on one target of your targets, and why it works correctly by cleaning hardware overlays at fimd probe.

Quoted 5 lines
Quoted 1 line

Oh.... Sorry for that. I did not see any problem on 5250/5420/5800. I do not have setup for 4210. Better we should revert this patch.

No, it should work correctly as is because fimd overlays will be reconfigured at booting time by register_framebuffer() if console framebuffer is enabled. Otherwise, a master process, X or Weston, will reconfigure fimd overlays after kernel booting.

Thanks,
Inki Dae

Quoted 63 lines

Would you please help me by verifying the following patch on 4210? This is an alternate solution to the same problem.

http://www.mail-archive.com/[email protected]/msg31426.html

Thanks Andrej, for bringing it to notice.

Regards,
Rahul Sharma

Quoted 52 lines

Regards
Andrzej

Quoted 48 lines

---
Based on exynos-drm-next branch.

 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   17 -----------------
 1 file changed, 17 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +0 -17
index bd30d0c..2ec634f 100644
@@ -703,19 +703,6 @@ static void fimd_win_disable(struct exynos_drm_manager *mgr, int zpos)
      win_data->enabled = false;
 }
 
-static void fimd_clear_win(struct fimd_context *ctx, int win)
-{
-     writel(0, ctx->regs + WINCON(win));
-     writel(0, ctx->regs + VIDOSD_A(win));
-     writel(0, ctx->regs + VIDOSD_B(win));
-     writel(0, ctx->regs + VIDOSD_C(win));
-
-     if (win == 1 || win == 2)
-             writel(0, ctx->regs + VIDOSD_D(win));
-
-     fimd_shadow_protect_win(ctx, win, false);
-}
-
 static void fimd_window_suspend(struct exynos_drm_manager *mgr)
 {
      struct fimd_context *ctx = mgr->ctx;
@@ -898,16 +885,12 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)
 {
      struct fimd_context *ctx = fimd_manager.ctx;
      struct drm_device *drm_dev = data;
-     int win;
 
      fimd_mgr_initialize(&fimd_manager, drm_dev);
      exynos_drm_crtc_create(&fimd_manager);
      if (ctx->display)
              exynos_drm_create_enc_conn(drm_dev, ctx->display);
 
-     for (win = 0; win < WINDOWS_NR; win++)
-             fimd_clear_win(ctx, win);
-
      return 0;
 
 }

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel