Bug 94980 - [HSW xf86-video-intel] 2D acceleration slows to a crawl from 4.4.6 -> 4.5
Summary: [HSW xf86-video-intel] 2D acceleration slows to a crawl from 4.4.6 -> 4.5
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: DRI git
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: Intel GFX Bugs mailing list
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-17 12:42 UTC by Rafael Ristovski
Modified: 2017-07-24 22:42 UTC (History)
1 user (show)

See Also:
i915 platform: HSW
i915 features:


Attachments
Xorg.0.log - full debug (499.94 KB, text/plain)
2016-04-17 12:42 UTC, Rafael Ristovski
no flags Details
Block SIGIO when we are trying to flip (3.60 KB, patch)
2016-04-17 18:02 UTC, Chris Wilson
no flags Details | Splinter Review
Don't block cursor updates for pending flips (1.59 KB, patch)
2016-04-17 18:26 UTC, Chris Wilson
no flags Details | Splinter Review

Description Rafael Ristovski 2016-04-17 12:42:27 UTC
Created attachment 123011 [details]
Xorg.0.log - full debug

When switching from 4.4.6 to 4.5 2D acceleration becomes slow when TearFree is enabled. 
Disabling TearFree fixes this at the expense of having tearing.
3D acceleration is unaffected.

Randomly when moving terminal windows at high speed, small parts of other windows get "stuck" to the terminal window (might be caused by weird slow refresh?)

Details:
Whole Xorg stack from git
xf86-video-intel from git

HW:
i7-4500U with HD 4400 Graphics
Running Gentoo
Comment 2 Chris Wilson 2016-04-17 18:02:14 UTC
Created attachment 123012 [details] [review]
Block SIGIO when we are trying to flip

Compile tested only.
Comment 3 Chris Wilson 2016-04-17 18:26:16 UTC
Created attachment 123015 [details] [review]
Don't block cursor updates for pending flips
Comment 4 Chris Wilson 2016-04-17 19:11:53 UTC
Suggestion by Maarten:

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 36e7e29ea266..385095f725a8 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -13160,6 +13160,9 @@ static int intel_atomic_prepare_commit(struct drm_device *dev,
        }
 
        for_each_crtc_in_state(state, crtc, crtc_state, i) {
+               if (state->legacy_cursor_update)
+                       continue;
+
                ret = intel_crtc_wait_for_pending_flips(crtc);
                if (ret)
                        return ret;
Comment 5 Rafael Ristovski 2016-04-17 19:24:18 UTC
(In reply to Chris Wilson from comment #4)
> Suggestion by Maarten:
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c
> b/drivers/gpu/drm/i915/intel_display.c
> index 36e7e29ea266..385095f725a8 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -13160,6 +13160,9 @@ static int intel_atomic_prepare_commit(struct
> drm_device *dev,
>         }
>  
>         for_each_crtc_in_state(state, crtc, crtc_state, i) {
> +               if (state->legacy_cursor_update)
> +                       continue;
> +
>                 ret = intel_crtc_wait_for_pending_flips(crtc);
>                 if (ret)
>                         return ret;

Can confirm this fixes the issue.
Comment 6 Chris Wilson 2016-04-18 10:28:06 UTC
commit acf4e84d6167317ff21be5c03e1ea76ea5783701
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Apr 17 20:42:46 2016 +0100

    drm/i915: Avoid stalling on pending flips for legacy cursor updates


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.