* [PATCH] drm/i915: Don't stall too much for cursor vs. pageflip
@ 2016-06-22 13:47 Daniel Vetter
2016-06-22 14:15 ` ✗ Ro.CI.BAT: warning for " Patchwork
2016-06-22 20:29 ` [PATCH] " Chris Wilson
0 siblings, 2 replies; 3+ messages in thread
From: Daniel Vetter @ 2016-06-22 13:47 UTC (permalink / raw)
To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter, rafael.ristovski
- We don't need to wait for the previous commit to have fully
completed, the waiting for hw_done in swap_state is sufficient.
- We need to make sure that the pure page_flip signals hw_done early
enough. This is done through a gross hack by recomputing stuff. I
think it'd be better to fix this by moving things around a bit,
keeping separate state pointers where needed (e.g. hw verifier) and
for the wm optimization, by extracting that into a cancellable work
item.
But legacy cursor vs. legacy page-flip is a very restricted use case,
and we need to make it work meanwhile.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96593
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: rafael.ristovski@gmail.com
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
Totally untested. I think we want at least an igt that runs legacy
page flips against a storm of cursor movements and checks that the
curosr movements never stalls. I think we can be slightly more lenient
with cursor bo updates. Storms with those tend to happen when X starts
up, or changes configurations. Not when moving it around. But I might
be mistaken on that one, iirc at least some older versions of
modesetting had a silly flag set which resulted in the cursor getting
disabled, changed and then re-enabled on each update "to avoid
tearing" or something like that. But I think that was fixed meanwhile.
Need to hand this off to Maarten since I'm going on vacation this
Friday for 2 weeks, and just a bit of time left to wind down various
things.
Thanks, Daniel
---
drivers/gpu/drm/i915/intel_display.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index dc33bf278cc2..ff66b73fa412 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -13706,6 +13706,7 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)
struct drm_plane *plane;
struct drm_plane_state *plane_state;
bool hw_check = intel_state->modeset;
+ bool need_post_state;
unsigned long put_domains[I915_MAX_PIPES] = {};
unsigned crtc_vblank_mask = 0;
int i, ret;
@@ -13724,7 +13725,8 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)
WARN_ON(ret);
}
- drm_atomic_helper_wait_for_dependencies(state);
+ if (!state->legacy_cursor_update)
+ drm_atomic_helper_wait_for_dependencies(state);
if (intel_state->modeset) {
memcpy(dev_priv->min_pixclk, intel_state->min_pixclk,
@@ -13821,6 +13823,17 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)
crtc_vblank_mask |= 1 << i;
}
+ need_post_state = false;
+ for_each_crtc_in_state(state, crtc, old_crtc_state, i) {
+ intel_cstate = to_intel_crtc_state(crtc->state);
+
+ if (intel_cstate->wm.need_postvbl_update)
+ need_post_state = true;
+
+ if (needs_modeset(crtc->state) || intel_cstate->update_pipe)
+ need_post_state = true;
+ }
+
/* FIXME: We should call drm_atomic_helper_commit_hw_done() here
* already, but still need the state for the delayed optimization. To
* fix this:
@@ -13830,6 +13843,9 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)
* - switch over to the vblank wait helper in the core after that since
* we don't need out special handling any more.
*/
+ if (!need_post_state)
+ drm_atomic_helper_commit_hw_done(state);
+
if (!state->legacy_cursor_update)
intel_atomic_wait_for_vblanks(dev, dev_priv, crtc_vblank_mask);
@@ -13856,7 +13872,8 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)
intel_modeset_verify_crtc(crtc, old_crtc_state, crtc->state);
}
- drm_atomic_helper_commit_hw_done(state);
+ if (need_post_state)
+ drm_atomic_helper_commit_hw_done(state);
if (intel_state->modeset)
intel_display_power_put(dev_priv, POWER_DOMAIN_MODESET);
--
2.8.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread
* ✗ Ro.CI.BAT: warning for drm/i915: Don't stall too much for cursor vs. pageflip
2016-06-22 13:47 [PATCH] drm/i915: Don't stall too much for cursor vs. pageflip Daniel Vetter
@ 2016-06-22 14:15 ` Patchwork
2016-06-22 20:29 ` [PATCH] " Chris Wilson
1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2016-06-22 14:15 UTC (permalink / raw)
To: Daniel Vetter; +Cc: intel-gfx
== Series Details ==
Series: drm/i915: Don't stall too much for cursor vs. pageflip
URL : https://patchwork.freedesktop.org/series/9049/
State : warning
== Summary ==
Series 9049v1 drm/i915: Don't stall too much for cursor vs. pageflip
http://patchwork.freedesktop.org/api/1.0/series/9049/revisions/1/mbox
Test gem_exec_flush:
Subgroup basic-batch-kernel-default-cmd:
fail -> PASS (ro-byt-n2820)
Test kms_flip:
Subgroup basic-flip-vs-dpms:
pass -> DMESG-WARN (ro-bdw-i7-5557U)
pass -> DMESG-WARN (ro-ilk1-i5-650)
pass -> DMESG-WARN (ro-hsw-i3-4010u)
pass -> DMESG-WARN (ro-bdw-i7-5600u)
pass -> DMESG-WARN (ro-snb-i7-2620M)
pass -> DMESG-WARN (ro-bdw-i5-5250u)
pass -> DMESG-WARN (ro-hsw-i7-4770r)
pass -> DMESG-WARN (ro-ivb-i7-3770)
pass -> DMESG-WARN (ro-ivb2-i7-3770)
pass -> DMESG-WARN (ro-byt-n2820)
pass -> DMESG-WARN (fi-skl-i7-6700k)
pass -> DMESG-WARN (ro-skl3-i5-6260u)
Subgroup basic-flip-vs-modeset:
pass -> DMESG-WARN (ro-skl3-i5-6260u)
pass -> DMESG-WARN (ro-ilk1-i5-650)
pass -> DMESG-WARN (ro-snb-i7-2620M)
Subgroup basic-plain-flip:
dmesg-warn -> PASS (ro-snb-i7-2620M)
fi-skl-i7-6700k total:226 pass:187 dwarn:1 dfail:0 fail:1 skip:37
ro-bdw-i5-5250u total:226 pass:196 dwarn:3 dfail:0 fail:1 skip:26
ro-bdw-i7-5557U total:226 pass:197 dwarn:1 dfail:0 fail:1 skip:27
ro-bdw-i7-5600u total:226 pass:184 dwarn:1 dfail:0 fail:1 skip:40
ro-bsw-n3050 total:226 pass:168 dwarn:3 dfail:0 fail:4 skip:51
ro-byt-n2820 total:226 pass:173 dwarn:1 dfail:0 fail:3 skip:49
ro-hsw-i3-4010u total:226 pass:189 dwarn:1 dfail:0 fail:1 skip:35
ro-hsw-i7-4770r total:226 pass:189 dwarn:1 dfail:0 fail:1 skip:35
ro-ilk-i7-620lm total:226 pass:149 dwarn:1 dfail:0 fail:2 skip:74
ro-ilk1-i5-650 total:221 pass:148 dwarn:2 dfail:0 fail:2 skip:69
ro-ivb-i7-3770 total:226 pass:180 dwarn:1 dfail:0 fail:1 skip:44
ro-ivb2-i7-3770 total:226 pass:184 dwarn:1 dfail:0 fail:1 skip:40
ro-skl3-i5-6260u total:226 pass:199 dwarn:3 dfail:0 fail:1 skip:23
ro-snb-i7-2620M total:226 pass:172 dwarn:2 dfail:0 fail:2 skip:50
fi-hsw-i7-4770k failed to connect after reboot
fi-kbl-qkkr failed to connect after reboot
fi-skl-i5-6260u failed to connect after reboot
fi-snb-i7-2600 failed to connect after reboot
Results at /archive/results/CI_IGT_test/RO_Patchwork_1269/
0a88ca3 drm-intel-nightly: 2016y-06m-22d-13h-19m-30s UTC integration manifest
15ed1b7 drm/i915: Don't stall too much for cursor vs. pageflip
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/i915: Don't stall too much for cursor vs. pageflip
2016-06-22 13:47 [PATCH] drm/i915: Don't stall too much for cursor vs. pageflip Daniel Vetter
2016-06-22 14:15 ` ✗ Ro.CI.BAT: warning for " Patchwork
@ 2016-06-22 20:29 ` Chris Wilson
1 sibling, 0 replies; 3+ messages in thread
From: Chris Wilson @ 2016-06-22 20:29 UTC (permalink / raw)
To: Daniel Vetter; +Cc: Daniel Vetter, Intel Graphics Development, rafael.ristovski
On Wed, Jun 22, 2016 at 03:47:15PM +0200, Daniel Vetter wrote:
> - We don't need to wait for the previous commit to have fully
> completed, the waiting for hw_done in swap_state is sufficient.
>
> - We need to make sure that the pure page_flip signals hw_done early
> enough. This is done through a gross hack by recomputing stuff. I
> think it'd be better to fix this by moving things around a bit,
> keeping separate state pointers where needed (e.g. hw verifier) and
> for the wm optimization, by extracting that into a cancellable work
> item.
>
> But legacy cursor vs. legacy page-flip is a very restricted use case,
> and we need to make it work meanwhile.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96593
Testcase: igt/kms_cursor_legacy/basic-cursor-vs-flip
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: rafael.ristovski@gmail.com
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
> drivers/gpu/drm/i915/intel_display.c | 21 +++++++++++++++++++--
> 1 file changed, 19 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index dc33bf278cc2..ff66b73fa412 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -13706,6 +13706,7 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)
> struct drm_plane *plane;
> struct drm_plane_state *plane_state;
> bool hw_check = intel_state->modeset;
> + bool need_post_state;
> unsigned long put_domains[I915_MAX_PIPES] = {};
> unsigned crtc_vblank_mask = 0;
> int i, ret;
> @@ -13724,7 +13725,8 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)
> WARN_ON(ret);
> }
>
> - drm_atomic_helper_wait_for_dependencies(state);
> + if (!state->legacy_cursor_update)
> + drm_atomic_helper_wait_for_dependencies(state);
This looks like a hack. Ideally the computed dependencies for the cursor
update would be nil, right?
> if (intel_state->modeset) {
> memcpy(dev_priv->min_pixclk, intel_state->min_pixclk,
> @@ -13821,6 +13823,17 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)
> crtc_vblank_mask |= 1 << i;
> }
>
> + need_post_state = false;
> + for_each_crtc_in_state(state, crtc, old_crtc_state, i) {
> + intel_cstate = to_intel_crtc_state(crtc->state);
> +
> + if (intel_cstate->wm.need_postvbl_update)
> + need_post_state = true;
> +
> + if (needs_modeset(crtc->state) || intel_cstate->update_pipe)
> + need_post_state = true;
> + }
This + the bifurcation of hw_done makes sense, but again shouldn't it
fall out that !need_post_state is just a series of noops?
I tried it on my workstation in the hope that the flicker was somehow a
result of the cursor stalls. Sadly not. :(
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-06-22 20:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-22 13:47 [PATCH] drm/i915: Don't stall too much for cursor vs. pageflip Daniel Vetter
2016-06-22 14:15 ` ✗ Ro.CI.BAT: warning for " Patchwork
2016-06-22 20:29 ` [PATCH] " Chris Wilson
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.