All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/atomic-helpers: Properly avoid full modeset dance
@ 2015-03-26 21:48 Daniel Vetter
  2015-03-27  3:59 ` shuang.he
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Vetter @ 2015-03-26 21:48 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Intel Graphics Development, Daniel Vetter

Legacy setCrtc has a nice fastpath for just updating the frontbuffer
when the output routing doesn't change. Which I of course tried to
keep working, except that I fumbled the job: The helpers correctly
compute ->mode_changed, CRTC updates get correctly skipped but
connector functions are called unconditionally.

Fix this.

Reported-and-Tested-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_atomic_helper.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index d9ed9a54fd1e..6e377d954538 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -587,7 +587,8 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state)
 
 		old_crtc_state = old_state->crtc_states[drm_crtc_index(old_conn_state->crtc)];
 
-		if (!old_crtc_state->active)
+		if (!old_crtc_state->active ||
+		    !needs_modeset(connector->state->crtc->state))
 			continue;
 
 		encoder = old_conn_state->best_encoder;
@@ -847,7 +848,8 @@ void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev,
 		if (!connector || !connector->state->best_encoder)
 			continue;
 
-		if (!connector->state->crtc->state->active)
+		if (!connector->state->crtc->state->active ||
+		    !needs_modeset(connector->state->crtc->state))
 			continue;
 
 		encoder = connector->state->best_encoder;
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/atomic-helpers: Properly avoid full modeset dance
  2015-03-26 21:48 [PATCH] drm/atomic-helpers: Properly avoid full modeset dance Daniel Vetter
@ 2015-03-27  3:59 ` shuang.he
  0 siblings, 0 replies; 4+ messages in thread
From: shuang.he @ 2015-03-27  3:59 UTC (permalink / raw)
  To: shuang.he, ethan.gao, intel-gfx, daniel.vetter

Tested-By: PRC QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com)
Task id: 6066
-------------------------------------Summary-------------------------------------
Platform          Delta          drm-intel-nightly          Series Applied
PNV                 -1              276/276              275/276
ILK                                  303/303              303/303
SNB                                  304/304              304/304
IVB                                  339/339              339/339
BYT                                  287/287              287/287
HSW                                  362/362              362/362
BDW                                  310/310              310/310
-------------------------------------Detailed-------------------------------------
Platform  Test                                drm-intel-nightly          Series Applied
*PNV  igt@gem_userptr_blits@minor-unsync-interruptible      PASS(3)      DMESG_WARN(1)PASS(1)
(dmesg patch applied)WARNING:at_drivers/gpu/drm/i915/i915_gem_evict.c:#i915_gem_evict_vm[i915]()@WARNING:.* at .* i915_gem_evict_vm+0x
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/atomic-helpers: Properly avoid full modeset dance
  2015-03-27 13:47 Daniel Vetter
@ 2015-03-27 15:38 ` Gustavo Padovan
  0 siblings, 0 replies; 4+ messages in thread
From: Gustavo Padovan @ 2015-03-27 15:38 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Daniel Vetter, Intel Graphics Development, Thierry Reding,
	Gustavo Padovan, DRI Development

2015-03-27 Daniel Vetter <daniel.vetter@ffwll.ch>:

> Legacy setCrtc has a nice fastpath for just updating the frontbuffer
> when the output routing doesn't change. Which I of course tried to
> keep working, except that I fumbled the job: The helpers correctly
> compute ->mode_changed, CRTC updates get correctly skipped but
> connector functions are called unconditionally.
> 
> Fix this.
> 
> v2: For the disable sided connector->state->crtc might be NULL.
> Instead look at the old_connector_state->crtc, but still use the new
> crtc state for that old crtc. Reported by Thierry.
> 
> Reported-and-Tested-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> (v1)
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Gustavo Padovan <gustavo.padovan@collabora.co.uk> (v1)
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

v2 still works for me. You can also add my r-b to v2.

	Gustavo
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH] drm/atomic-helpers: Properly avoid full modeset dance
@ 2015-03-27 13:47 Daniel Vetter
  2015-03-27 15:38 ` Gustavo Padovan
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Vetter @ 2015-03-27 13:47 UTC (permalink / raw)
  To: Intel Graphics Development
  Cc: Daniel Vetter, Thierry Reding, Gustavo Padovan, DRI Development,
	Daniel Vetter

Legacy setCrtc has a nice fastpath for just updating the frontbuffer
when the output routing doesn't change. Which I of course tried to
keep working, except that I fumbled the job: The helpers correctly
compute ->mode_changed, CRTC updates get correctly skipped but
connector functions are called unconditionally.

Fix this.

v2: For the disable sided connector->state->crtc might be NULL.
Instead look at the old_connector_state->crtc, but still use the new
crtc state for that old crtc. Reported by Thierry.

Reported-and-Tested-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> (v1)
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Gustavo Padovan <gustavo.padovan@collabora.co.uk> (v1)
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_atomic_helper.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index d9ed9a54fd1e..e67d4d69faf7 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -587,7 +587,8 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state)
 
 		old_crtc_state = old_state->crtc_states[drm_crtc_index(old_conn_state->crtc)];
 
-		if (!old_crtc_state->active)
+		if (!old_crtc_state->active ||
+		    !needs_modeset(old_conn_state->crtc->state))
 			continue;
 
 		encoder = old_conn_state->best_encoder;
@@ -847,7 +848,8 @@ void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev,
 		if (!connector || !connector->state->best_encoder)
 			continue;
 
-		if (!connector->state->crtc->state->active)
+		if (!connector->state->crtc->state->active ||
+		    !needs_modeset(connector->state->crtc->state))
 			continue;
 
 		encoder = connector->state->best_encoder;
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2015-03-27 15:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-26 21:48 [PATCH] drm/atomic-helpers: Properly avoid full modeset dance Daniel Vetter
2015-03-27  3:59 ` shuang.he
2015-03-27 13:47 Daniel Vetter
2015-03-27 15:38 ` Gustavo Padovan

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.