All of lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@freedesktop.org
To: dri-devel@lists.freedesktop.org
Subject: [Bug 102646] Screen flickering under amdgpu-experimental [buggy auto power profile]
Date: Tue, 06 Aug 2019 18:54:36 +0000	[thread overview]
Message-ID: <bug-102646-502-dZH6dwK30I@http.bugs.freedesktop.org/> (raw)
In-Reply-To: <bug-102646-502@http.bugs.freedesktop.org/>


[-- Attachment #1.1: Type: text/plain, Size: 6052 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=102646

--- Comment #101 from Maxim Ivanov <m.ivanov2k@gmail.com> ---
(In reply to Ahzo from comment #97)
> Created attachment 144950 [details] [review]
> Patch to fix the problem
> 
> TLDR: A script to reproduce and a patch to fix this problem are attached.
> 
> The problem occurs when switching between high and low GPU memory
> frequencies at specific time intervals. It can be reproduced with the
> attached script, which optionally accepts a time parameter, defaulting to 1
> ms.
> With a 75 Hz display mode, screen corruption occurs rather reliably by using
> a time parameter in the following ranges:
> 0.000-0.002, 0.011-0.015, 0.024-0.028, 0.038-0.042, 0.051-0.055,
> 0.064-0.068, 0.078-0.082, 0.091-0.095, 0.104-0.108
> 
> However, using sleep times between these intervals, e.g. 0.1, does not
> produce any screen corruption.
> For a frequency of 75 Hz the frame time is T = 1000 / 75 ms = 13.3 ms and
> the screen corruption happens for sleep times of:
>  S = n * T +- 2 ms
> Here n is a natural number, i.e. 0, 1, 2, 3, and so on.
> 
> Linux 4.14 is not affected by this problem, as is noted in comment 93.
> However, that version only works by accident: When the display mode is not
> yet known, default parameters, in particular 60 Hz, are used to calculate
> frame_time_x2 as (1000000 / 60) * 2 / 100 = 333, which is then used to set
> VBITimeout. Later, when the refresh rate of 75 Hz is known, frame_time_x2
> gets updated to 266, but VBITimeout is never actually set to that value via
> smu7_notify_smc_display.
> 
> Linux 4.15 included the DC patches, and when using DC (e.g. by using the
> boot argument amdgpu.dc=1), VBITimeout is never set to the default 333, but
> directly to 266, which triggers the screen corruption and flickering
> problems described in this bug.
> 
> With Linux 4.17 the problem got more widespread, because the default was
> accidentally switched to enable DC by erroneously removing the 'return
> amdgpu_dc > 0;' line with:
> commit 367e66870e9cc20b867b11c4484ae83336efcb67
> Author: Alex Deucher <alexander.deucher@amd.com>
> Date:   Thu Jan 25 16:53:25 2018 -0500
> 
>     drm/amdgpu: remove DC special casing for KB/ML
>     
>     It seems to be working now.
>     
>     Bug: https://bugs.freedesktop.org/show_bug.cgi?id=102372
>     Reviewed-by: Mike Lothian <mike@fireburn.co.uk>
>     Reviewed-by: Harry Wentland <harry.wentland@amd.com>
>     Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 309977ef5b51..2ad9de42b65b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -1704,6 +1704,8 @@ bool amdgpu_device_asic_has_dc_support(enum
> amd_asic_type asic_type)
>         case CHIP_BONAIRE:
>         case CHIP_HAWAII:
>         case CHIP_KAVERI:
> +       case CHIP_KABINI:
> +       case CHIP_MULLINS:
>         case CHIP_CARRIZO:
>         case CHIP_STONEY:
>         case CHIP_POLARIS11:
> @@ -1714,9 +1716,6 @@ bool amdgpu_device_asic_has_dc_support(enum
> amd_asic_type asic_type)
>  #if defined(CONFIG_DRM_AMD_DC_PRE_VEGA)
>                 return amdgpu_dc != 0;
>  #endif
> -       case CHIP_KABINI:
> -       case CHIP_MULLINS:
> -               return amdgpu_dc > 0;
>         case CHIP_VEGA10:
>  #if defined(CONFIG_DRM_AMD_DC_DCN1_0)
>         case CHIP_RAVEN:
> 
> 
> Linux 4.18 aligns the Non-DC case more closely with the DC case and thus
> VBITimeout gets actually set to the updated frame_time_x2 via
> smu7_notify_smc_display. Thus the Non-DC case is also affected by this bug
> since:
> commit 555fd70c59bc7f7acd8bc429d92bd59a66a7b83b
> Author: Rex Zhu <Rex.Zhu@amd.com>
> Date:   Tue Mar 27 13:32:02 2018 +0800
> 
>     drm/amd/pp: Not call cgs interface to get display info
>     
>     DC/Non DC all will update display configuration
>     when the display state changed
>     No need to get display info through cgs interface
>     
>     Reviewed-by: Evan Quan <evan.quan@amd.com>
>     Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
>     Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> 
> Linux 4.20 contains a commit trying to fix flickering issues:
> commit ec2e082a79b5d46addf2e7b83a13fb015fca6149
> Author: Alex Deucher <alexander.deucher@amd.com>
> Date:   Thu Aug 9 14:24:08 2018 -0500
> 
>     drm/amdgpu/powerplay: check vrefresh when when changing displays
>     
>     Compare the current vrefresh in addition to the number of displays
>     when determining whether or not the smu needs updates when changing
>     modes. The SMU needs to be updated if the vbi timeout changes due
>     to a different refresh rate.  Fixes flickering around mode changes
>     in some cases on polaris parts.
>     
>     Reviewed-by: Rex Zhu <Rex.Zhu@amd.com>
>     Reviewed-by: Huang Rui <ray.huang@amd.com>
>     Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> 
> But that doesn't fix the screen corruption described in this bug, because
> the problem is not that VBITimeout isn't updated enough, but rather the
> opposite, i.e. that it gets set to the frame_time_x2 value calculated from
> the correct, high refresh rate instead of the default value of 333.
> 
> At least for 75 Hz, this problem can be fixed by preventing frame_time_x2
> and thus VBITimeout from being smaller than 280, as in the attached patch.
> Setting VBITimeout to higher values than the calcualted frame_time_x2 does
> not seem to cause any problems.
> It would be great if someone could test this patch with higher refresh
> rates, as well.

Well, people are reporting this patch to be a success. Can you submit this to
be reviewed for merging into the kernel? By the way, I have this issue with the
amdgpu package, not amdgpu-experimental.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 8526 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

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

  parent reply	other threads:[~2019-08-06 18:54 UTC|newest]

Thread overview: 124+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-10 17:06 [Bug 102646] Screen flickering under amdgpu-experimental (buffer corruptions?) bugzilla-daemon
2017-09-10 17:25 ` bugzilla-daemon
2017-09-11  0:02 ` bugzilla-daemon
2017-09-11  0:20 ` bugzilla-daemon
2017-09-11  0:25 ` bugzilla-daemon
2017-09-12 21:52 ` bugzilla-daemon
2017-09-12 21:53 ` bugzilla-daemon
2017-09-12 21:57 ` bugzilla-daemon
2017-09-13  2:47 ` bugzilla-daemon
2017-09-13  2:52 ` bugzilla-daemon
2017-09-13 13:29 ` bugzilla-daemon
2017-09-14 18:37 ` bugzilla-daemon
2017-09-15 15:38 ` bugzilla-daemon
2017-09-17  0:15 ` bugzilla-daemon
2017-09-17  0:22 ` bugzilla-daemon
2017-10-02 14:14 ` bugzilla-daemon
2017-10-03 20:44 ` bugzilla-daemon
2017-10-03 20:53 ` bugzilla-daemon
2017-10-21  1:54 ` bugzilla-daemon
2017-11-29 23:03 ` bugzilla-daemon
2017-12-14  4:06 ` bugzilla-daemon
2017-12-16 18:35 ` [Bug 102646] Screen flickering under amdgpu-experimental [buggy auto power profile] bugzilla-daemon
2017-12-16 18:37 ` [Bug 102646] [dc] " bugzilla-daemon
2017-12-20 20:22 ` bugzilla-daemon
2017-12-20 20:29 ` bugzilla-daemon
2018-01-30 19:26 ` bugzilla-daemon
2018-03-05  7:10 ` bugzilla-daemon
2018-03-05  7:13 ` bugzilla-daemon
2018-03-13 16:29 ` bugzilla-daemon
2018-03-13 18:05 ` bugzilla-daemon
2018-03-13 19:01 ` bugzilla-daemon
2018-04-22 15:45 ` bugzilla-daemon
2018-05-01 19:30 ` [Bug 102646] " bugzilla-daemon
2018-06-25 18:09 ` bugzilla-daemon
2018-09-06 12:06 ` bugzilla-daemon
2018-10-27  7:40 ` bugzilla-daemon
2018-10-28 18:45 ` bugzilla-daemon
2018-10-29 15:41 ` bugzilla-daemon
2018-10-29 17:57 ` bugzilla-daemon
2018-10-29 18:38 ` bugzilla-daemon
2018-10-31 19:08 ` bugzilla-daemon
2018-10-31 22:57 ` bugzilla-daemon
2018-10-31 23:06 ` bugzilla-daemon
2018-11-01 16:52 ` bugzilla-daemon
2018-11-17 14:00 ` bugzilla-daemon
2018-11-18 17:36 ` bugzilla-daemon
2018-11-18 18:12 ` bugzilla-daemon
2018-11-18 18:38 ` bugzilla-daemon
2018-11-18 18:47 ` bugzilla-daemon
2018-11-18 22:54 ` bugzilla-daemon
2018-11-18 23:16 ` bugzilla-daemon
2018-11-21 11:34 ` bugzilla-daemon
2018-11-21 11:34 ` bugzilla-daemon
2018-11-23 19:35 ` bugzilla-daemon
2018-11-29 11:01 ` bugzilla-daemon
2018-11-29 20:52 ` bugzilla-daemon
2018-11-29 22:40 ` bugzilla-daemon
2018-11-30  1:25 ` bugzilla-daemon
2018-11-30  1:26 ` bugzilla-daemon
2018-11-30  4:10 ` bugzilla-daemon
2018-11-30  9:24 ` bugzilla-daemon
2018-12-02  9:17 ` bugzilla-daemon
2018-12-11 11:53 ` bugzilla-daemon
2018-12-25 22:56 ` bugzilla-daemon
2018-12-31 12:49 ` bugzilla-daemon
2018-12-31 12:49 ` bugzilla-daemon
2018-12-31 15:10 ` bugzilla-daemon
2019-01-03 11:49 ` bugzilla-daemon
2019-01-11  9:35 ` bugzilla-daemon
2019-01-21 16:46 ` bugzilla-daemon
2019-02-06 13:44 ` bugzilla-daemon
2019-03-10  9:36 ` bugzilla-daemon
2019-03-10  9:38 ` bugzilla-daemon
2019-03-15 17:12 ` bugzilla-daemon
2019-03-19 20:12 ` bugzilla-daemon
2019-03-20 14:56 ` bugzilla-daemon
2019-03-20 14:57 ` bugzilla-daemon
2019-03-20 16:59 ` bugzilla-daemon
2019-03-20 17:02 ` bugzilla-daemon
2019-03-27 19:03 ` bugzilla-daemon
2019-03-30  1:41 ` bugzilla-daemon
2019-03-30  4:07 ` bugzilla-daemon
2019-04-04 13:47 ` bugzilla-daemon
2019-04-12  1:15 ` bugzilla-daemon
2019-04-12  1:19 ` bugzilla-daemon
2019-04-12  9:38 ` bugzilla-daemon
2019-04-12 13:47 ` bugzilla-daemon
2019-04-17 14:22 ` bugzilla-daemon
2019-04-18  0:40 ` bugzilla-daemon
2019-04-25  8:14 ` bugzilla-daemon
2019-05-12  4:46 ` bugzilla-daemon
2019-05-12  4:47 ` bugzilla-daemon
2019-05-12  4:50 ` bugzilla-daemon
2019-05-12  9:17 ` bugzilla-daemon
2019-05-12 21:42 ` bugzilla-daemon
2019-05-13 13:57 ` bugzilla-daemon
2019-05-13 14:19 ` bugzilla-daemon
2019-05-13 23:59 ` bugzilla-daemon
2019-06-07 13:56 ` bugzilla-daemon
2019-06-13 23:19 ` bugzilla-daemon
2019-06-17  2:58 ` bugzilla-daemon
2019-06-17 10:27 ` bugzilla-daemon
2019-06-17 13:55 ` bugzilla-daemon
2019-08-05 22:11 ` bugzilla-daemon
2019-08-05 22:11 ` bugzilla-daemon
2019-08-05 23:16 ` bugzilla-daemon
2019-08-06  0:51 ` bugzilla-daemon
2019-08-06 18:54 ` bugzilla-daemon [this message]
2019-08-11  5:39 ` bugzilla-daemon
2019-08-12  4:01 ` bugzilla-daemon
2019-08-13 21:26 ` bugzilla-daemon
2019-08-16 20:57 ` bugzilla-daemon
2019-08-17  7:29 ` bugzilla-daemon
2019-08-19  8:45 ` bugzilla-daemon
2019-08-19 11:05 ` bugzilla-daemon
2019-08-19 11:17 ` bugzilla-daemon
2019-08-19 11:20 ` bugzilla-daemon
2019-08-19 11:25 ` bugzilla-daemon
2019-08-19 11:41 ` bugzilla-daemon
2019-08-19 15:01 ` bugzilla-daemon
2019-08-23 10:57 ` bugzilla-daemon
2019-08-23 12:14 ` bugzilla-daemon
2019-09-19  8:40 ` bugzilla-daemon
2019-11-19  8:24 ` bugzilla-daemon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-102646-502-dZH6dwK30I@http.bugs.freedesktop.org/ \
    --to=bugzilla-daemon@freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.