Bug 30444

Summary: Keyboard input lag with xf86-video-ati-6.13.2
Product: xorg Reporter: Octoploid <cryptooctoploid>
Component: Driver/RadeonAssignee: xf86-video-ati maintainers <xorg-driver-ati>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: major    
Priority: medium CC: felixblanke
Version: 7.5 (2009.10)   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Xorg.0.log_good
none
Xorg.0.log_bad none

Description Octoploid 2010-09-28 22:17:05 UTC
I experience a noticeable input lag with my keyboard
running xf86-video-ati-6.13.2 (on my RS780).
When I press a key I have to wait several 100s milliseconds
before a character is actually displayed.

xf86-video-ati-6.13.1 works without problems.

(I use my display in portrait mode: 
DVI-0 connected 1050x1680+0+0 left)
Comment 1 Michel Dänzer 2010-09-29 01:32:33 UTC
Please attach the full Xorg.0.log files from both versions.

Also, it would be great if you could narrow down which change introduced the problem using git bisect.
Comment 2 Octoploid 2010-09-29 02:01:21 UTC
Created attachment 39039 [details]
Xorg.0.log_good
Comment 3 Octoploid 2010-09-29 02:01:54 UTC
Created attachment 39040 [details]
Xorg.0.log_bad
Comment 4 Octoploid 2010-09-29 02:34:48 UTC
OK I've bisected the problem to:

9f13049ddf06f6f2138851a548cfb82f12a52f42 is the first bad commit
commit 9f13049ddf06f6f2138851a548cfb82f12a52f42
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed Aug 25 08:56:37 2010 +1000

    radeon: add correct flushing for direct rendered
    
    this is a port of 69d65f9184006eac790efcff78a0e425160e95aa from the Intel
    driver.
    
        Submit batch buffers from flush callback chain
    
        There are a few cases where the server will flush client output buffers
        but our block handler only catches the most common (before going into select
        If the server flushes client buffers before we submit our batch buffer,
        the client may receive a damage event for rendering that hasn't happened yet
    
        Instead, we can hook into the flush callback chain, which the server will
        invoke just before flushing output.  This lets us submit batch buffers
        before sending out events, preserving ordering.
    
        Fixes 28438: [bisected] incorrect character in gnome-terminal under compiz
        https://bugs.freedesktop.org/show_bug.cgi?id=28438
    
        Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
    
    Signed-off-by: Dave Airlie <airlied@redhat.com>


Reverting the commit fixes the problem.
Comment 5 Octoploid 2010-10-19 23:49:49 UTC
The bug is still present in todays git build.

The easiest way to see it is to open mc (midnight commander),
then press down the up (or down) key a moment, release it, and you'll
notice that the mc indicator will still move ~ a second after you
released the key.
Comment 6 Octoploid 2011-01-15 07:36:05 UTC
The bug is still present in current git.

To reproduce rotate your screen:
 xrandr --output DVI-0 --rotate left

Press down any key (e.g. "a") for a few seconds in a terminal
and then release the key. A few extra "a"s will appear in the
terminal after the key is released. 
No extra "a"s are rendered when 9f13049ddf06f6f213 is reverted.
Comment 7 Felix Blanke 2011-01-15 10:05:35 UTC
I noticed that lag, too. It is there for some month.

I allways thought it is related to my WM (xmonad) or my terminal (rxvt), but never thought it is related to the video driver. Good to know.

I'm using xf86-video-ati, mesa and libdrm from git. My graphic card is a Radeon HD 5750.
Comment 8 Octoploid 2011-01-15 10:34:24 UTC
(In reply to comment #7)
> I noticed that lag, too. It is there for some month.
> 
> I allways thought it is related to my WM (xmonad) or my terminal (rxvt), but
> never thought it is related to the video driver. Good to know.
> 
> I'm using xf86-video-ati, mesa and libdrm from git. My graphic card is a Radeon
> HD 5750.

Good to know, that I'm not the only one seeing this.
Could you please revert 9f13049ddf06f6f2138851a548cfb82f12a52f42 
in the current xf86-video-ati git source, then rebuild and post
your impressions?
Comment 9 Felix Blanke 2011-01-16 03:43:06 UTC
I did reverted 9f13049ddf06f6f2138851a548cfb82f12a52f42 and it does fix the problem for me, too.

Btw: The problem isn't that bad at me. If I hold e.g. 'd' and then release it, it takes about 1 sec and then another 'd' appears on the screen. But sometimes it's annoying if I wan't to do tab-commpletion in a terminal. So a fix would be nice, but it doesn't have a high prio. for me.

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.