All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/exynos: split exynos_plane_dpms function
@ 2015-01-29 11:15 Joonyoung Shim
  2015-01-29 11:15 ` [PATCH 2/2] drm/exynos: solve plane on/off disharmory issue Joonyoung Shim
  0 siblings, 1 reply; 4+ messages in thread
From: Joonyoung Shim @ 2015-01-29 11:15 UTC (permalink / raw)
  To: dri-devel; +Cc: sw0312.kim

The exynos_plane_dpms can cause misunderstanding as using dpms term
because it is irrelevant with dpms functionality of DRM. Split to
functions fit for the one purpose instead of DPMS flags.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_crtc.c  |  4 ++--
 drivers/gpu/drm/exynos/exynos_drm_plane.c | 38 +++++++++++++++++--------------
 drivers/gpu/drm/exynos/exynos_drm_plane.h |  3 ++-
 3 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
index a85c451..dac8f90 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
@@ -67,7 +67,7 @@ static void exynos_drm_crtc_commit(struct drm_crtc *crtc)
 	if (exynos_crtc->ops->commit)
 		exynos_crtc->ops->commit(exynos_crtc);
 
-	exynos_plane_dpms(crtc->primary, DRM_MODE_DPMS_ON);
+	exynos_plane_on(crtc->primary);
 }
 
 static bool
@@ -255,7 +255,7 @@ static int exynos_drm_crtc_set_property(struct drm_crtc *crtc,
 			exynos_drm_crtc_commit(crtc);
 			break;
 		case CRTC_MODE_BLANK:
-			exynos_plane_dpms(crtc->primary, DRM_MODE_DPMS_OFF);
+			exynos_plane_off(crtc->primary);
 			break;
 		default:
 			break;
diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c
index 358cff6..aa87d79 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_plane.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c
@@ -145,30 +145,34 @@ void exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc,
 		exynos_crtc->ops->win_mode_set(exynos_crtc, exynos_plane);
 }
 
-void exynos_plane_dpms(struct drm_plane *plane, int mode)
+void exynos_plane_on(struct drm_plane *plane)
 {
 	struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane);
 	struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(plane->crtc);
 
-	if (mode == DRM_MODE_DPMS_ON) {
-		if (exynos_plane->enabled)
-			return;
+	if (exynos_plane->enabled)
+		return;
 
-		if (exynos_crtc->ops->win_enable)
-			exynos_crtc->ops->win_enable(exynos_crtc,
-						     exynos_plane->zpos);
+	if (exynos_crtc->ops->win_enable)
+		exynos_crtc->ops->win_enable(exynos_crtc,
+					     exynos_plane->zpos);
 
-		exynos_plane->enabled = true;
-	} else {
-		if (!exynos_plane->enabled)
-			return;
+	exynos_plane->enabled = true;
+}
 
-		if (exynos_crtc->ops->win_disable)
-			exynos_crtc->ops->win_disable(exynos_crtc,
-						      exynos_plane->zpos);
+void exynos_plane_off(struct drm_plane *plane)
+{
+	struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane);
+	struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(plane->crtc);
 
-		exynos_plane->enabled = false;
-	}
+	if (!exynos_plane->enabled)
+		return;
+
+	if (exynos_crtc->ops->win_disable)
+		exynos_crtc->ops->win_disable(exynos_crtc,
+					      exynos_plane->zpos);
+
+	exynos_plane->enabled = false;
 }
 
 int
@@ -199,7 +203,7 @@ exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
 
 static int exynos_disable_plane(struct drm_plane *plane)
 {
-	exynos_plane_dpms(plane, DRM_MODE_DPMS_OFF);
+	exynos_plane_off(plane);
 
 	return 0;
 }
diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.h b/drivers/gpu/drm/exynos/exynos_drm_plane.h
index 59d4075..c778295 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_plane.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_plane.h
@@ -20,7 +20,8 @@ int exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
 			unsigned int crtc_w, unsigned int crtc_h,
 			uint32_t src_x, uint32_t src_y,
 			uint32_t src_w, uint32_t src_h);
-void exynos_plane_dpms(struct drm_plane *plane, int mode);
+void exynos_plane_on(struct drm_plane *plane);
+void exynos_plane_off(struct drm_plane *plane);
 struct drm_plane *exynos_plane_init(struct drm_device *dev,
 				    unsigned long possible_crtcs,
 				    enum drm_plane_type type);
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] drm/exynos: solve plane on/off disharmory issue
  2015-01-29 11:15 [PATCH 1/2] drm/exynos: split exynos_plane_dpms function Joonyoung Shim
@ 2015-01-29 11:15 ` Joonyoung Shim
  2015-02-03 13:28   ` Gustavo Padovan
  0 siblings, 1 reply; 4+ messages in thread
From: Joonyoung Shim @ 2015-01-29 11:15 UTC (permalink / raw)
  To: dri-devel; +Cc: sw0312.kim

The exynos_update_plane functions can be called from set_plane as well
as set_crtc and pageflip. Currently the plane displayed by set_plane
isn't called exynos_plane_on function and if plane is disabled, it calls
exynos_plane_off, so it causes disharmory of plane on/off.

This is caused from commit e7cd81111041 ("drm/exynos: Don't touch DPMS
when updating overlay planes").

Make .update_plane function called only by set_plane and call
exynos_plane_on in it.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_crtc.c  |  4 ++--
 drivers/gpu/drm/exynos/exynos_drm_plane.c | 21 ++++++++++++++++++++-
 drivers/gpu/drm/exynos/exynos_drm_plane.h |  2 +-
 3 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
index dac8f90..2765f7e 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
@@ -129,7 +129,7 @@ static int exynos_drm_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
 	crtc_w = fb->width - x;
 	crtc_h = fb->height - y;
 
-	return exynos_update_plane(crtc->primary, crtc, fb, 0, 0,
+	return exynos_plane_update(crtc->primary, crtc, fb, 0, 0,
 				   crtc_w, crtc_h, x, y, crtc_w, crtc_h);
 }
 
@@ -203,7 +203,7 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
 		crtc->primary->fb = fb;
 		crtc_w = fb->width - crtc->x;
 		crtc_h = fb->height - crtc->y;
-		ret = exynos_update_plane(crtc->primary, crtc, fb, 0, 0,
+		ret = exynos_plane_update(crtc->primary, crtc, fb, 0, 0,
 					  crtc_w, crtc_h, crtc->x, crtc->y,
 					  crtc_w, crtc_h);
 		if (ret) {
diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c
index aa87d79..88674d9 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_plane.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c
@@ -176,7 +176,7 @@ void exynos_plane_off(struct drm_plane *plane)
 }
 
 int
-exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
+exynos_plane_update(struct drm_plane *plane, struct drm_crtc *crtc,
 		     struct drm_framebuffer *fb, int crtc_x, int crtc_y,
 		     unsigned int crtc_w, unsigned int crtc_h,
 		     uint32_t src_x, uint32_t src_y,
@@ -201,6 +201,25 @@ exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
 	return 0;
 }
 
+static int
+exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
+		     struct drm_framebuffer *fb, int crtc_x, int crtc_y,
+		     unsigned int crtc_w, unsigned int crtc_h,
+		     uint32_t src_x, uint32_t src_y,
+		     uint32_t src_w, uint32_t src_h)
+{
+	int ret;
+
+	ret = exynos_plane_update(plane, crtc, fb, crtc_x, crtc_y,
+				  crtc_w, crtc_h, src_x, src_y, src_w, src_h);
+	if (ret < 0)
+		return ret;
+
+	exynos_plane_on(plane);
+
+	return 0;
+}
+
 static int exynos_disable_plane(struct drm_plane *plane)
 {
 	exynos_plane_off(plane);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.h b/drivers/gpu/drm/exynos/exynos_drm_plane.h
index c778295..239eff5 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_plane.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_plane.h
@@ -15,7 +15,7 @@ void exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc,
 			   unsigned int crtc_w, unsigned int crtc_h,
 			   uint32_t src_x, uint32_t src_y,
 			   uint32_t src_w, uint32_t src_h);
-int exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
+int exynos_plane_update(struct drm_plane *plane, struct drm_crtc *crtc,
 			struct drm_framebuffer *fb, int crtc_x, int crtc_y,
 			unsigned int crtc_w, unsigned int crtc_h,
 			uint32_t src_x, uint32_t src_y,
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] drm/exynos: solve plane on/off disharmory issue
  2015-01-29 11:15 ` [PATCH 2/2] drm/exynos: solve plane on/off disharmory issue Joonyoung Shim
@ 2015-02-03 13:28   ` Gustavo Padovan
  2015-02-04  1:58     ` Joonyoung Shim
  0 siblings, 1 reply; 4+ messages in thread
From: Gustavo Padovan @ 2015-02-03 13:28 UTC (permalink / raw)
  To: Joonyoung Shim; +Cc: sw0312.kim, dri-devel

Hi Joonyoung,

2015-01-29 Joonyoung Shim <jy0922.shim@samsung.com>:

> The exynos_update_plane functions can be called from set_plane as well
> as set_crtc and pageflip. Currently the plane displayed by set_plane
> isn't called exynos_plane_on function and if plane is disabled, it calls
> exynos_plane_off, so it causes disharmory of plane on/off.
> 
> This is caused from commit e7cd81111041 ("drm/exynos: Don't touch DPMS
> when updating overlay planes").
> 
> Make .update_plane function called only by set_plane and call
> exynos_plane_on in it.
> 
> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
> ---
>  drivers/gpu/drm/exynos/exynos_drm_crtc.c  |  4 ++--
>  drivers/gpu/drm/exynos/exynos_drm_plane.c | 21 ++++++++++++++++++++-
>  drivers/gpu/drm/exynos/exynos_drm_plane.h |  2 +-
>  3 files changed, 23 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
> index dac8f90..2765f7e 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
> @@ -129,7 +129,7 @@ static int exynos_drm_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
>  	crtc_w = fb->width - x;
>  	crtc_h = fb->height - y;
>  
> -	return exynos_update_plane(crtc->primary, crtc, fb, 0, 0,
> +	return exynos_plane_update(crtc->primary, crtc, fb, 0, 0,
>  				   crtc_w, crtc_h, x, y, crtc_w, crtc_h);

This patch goes in the opposite direction of the clean up to support atomic
modesetting on exynos (see my patches for atomic modesetting here[0]) In my
latest series there was an effort to unify all places we update a plane under
exynos_update_plane() and this is a essential step for atomic modesetting.

My proposal to solve this issue would just be calling exynos_plane_dpms()
on exynos_drm_crtc_mode_set_base() and leave the rest as is. This would fix
the disharmory of plane on/off. I'll send a patch for this in a bit.

[0] https://git.kernel.org/cgit/linux/kernel/git/padovan/drm-exynos.git/log/?h=atomic-next-2

	Gustavo
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] drm/exynos: solve plane on/off disharmory issue
  2015-02-03 13:28   ` Gustavo Padovan
@ 2015-02-04  1:58     ` Joonyoung Shim
  0 siblings, 0 replies; 4+ messages in thread
From: Joonyoung Shim @ 2015-02-04  1:58 UTC (permalink / raw)
  To: Gustavo Padovan, dri-devel, sw0312.kim,
	"'대인기/Mobile S/W Platform
	Lab.(통신연)/E3(사원)/삼성전자'"

Hi,

On 02/03/2015 10:28 PM, Gustavo Padovan wrote:
> Hi Joonyoung,
> 
> 2015-01-29 Joonyoung Shim <jy0922.shim@samsung.com>:
> 
>> The exynos_update_plane functions can be called from set_plane as well
>> as set_crtc and pageflip. Currently the plane displayed by set_plane
>> isn't called exynos_plane_on function and if plane is disabled, it calls
>> exynos_plane_off, so it causes disharmory of plane on/off.
>>
>> This is caused from commit e7cd81111041 ("drm/exynos: Don't touch DPMS
>> when updating overlay planes").
>>
>> Make .update_plane function called only by set_plane and call
>> exynos_plane_on in it.
>>
>> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
>> ---
>>  drivers/gpu/drm/exynos/exynos_drm_crtc.c  |  4 ++--
>>  drivers/gpu/drm/exynos/exynos_drm_plane.c | 21 ++++++++++++++++++++-
>>  drivers/gpu/drm/exynos/exynos_drm_plane.h |  2 +-
>>  3 files changed, 23 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
>> index dac8f90..2765f7e 100644
>> --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c
>> +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
>> @@ -129,7 +129,7 @@ static int exynos_drm_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
>>  	crtc_w = fb->width - x;
>>  	crtc_h = fb->height - y;
>>  
>> -	return exynos_update_plane(crtc->primary, crtc, fb, 0, 0,
>> +	return exynos_plane_update(crtc->primary, crtc, fb, 0, 0,
>>  				   crtc_w, crtc_h, x, y, crtc_w, crtc_h);
> 
> This patch goes in the opposite direction of the clean up to support atomic
> modesetting on exynos (see my patches for atomic modesetting here[0]) In my
> latest series there was an effort to unify all places we update a plane under
> exynos_update_plane() and this is a essential step for atomic modesetting.
> 

No, this change is just to rename function, actually
"exynos_plane_update" is more suitable because use exynos_plane_ prefix
like other functions of plane. This will conflict your patcheset but it
doesn't give any wrong operation effect, just need rename.

Thanks.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-02-04  1:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-29 11:15 [PATCH 1/2] drm/exynos: split exynos_plane_dpms function Joonyoung Shim
2015-01-29 11:15 ` [PATCH 2/2] drm/exynos: solve plane on/off disharmory issue Joonyoung Shim
2015-02-03 13:28   ` Gustavo Padovan
2015-02-04  1:58     ` Joonyoung Shim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.