From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 98897] Macbook pro 11,5 screen flicker when AC adapter plugged in Date: Thu, 15 Dec 2016 05:46:52 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0369440156==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id CD34F6E240 for ; Thu, 15 Dec 2016 05:46:51 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0369440156== Content-Type: multipart/alternative; boundary="14817808111.9536662E.29631"; charset="UTF-8" --14817808111.9536662E.29631 Date: Thu, 15 Dec 2016 05:46:51 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D98897 --- Comment #18 from berg --- (In reply to C=C3=A9dric Le Goater from comment #17) > so this is a CHIP_VERDE revision 0x83 (In reply to C=C3=A9dric Le Goater from comment #14) > (In reply to Michel D=C3=A4nzer from comment #10) > > If you can't or don't want to bisect, there are only 4 radeon driver co= mmits > > between 4.8.6 and 4.8.7, so it shouldn't take long to try manually reve= rting > > each of those. > > https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/co= mmit/ > > ?h=3Dlinux-4.8.y&id=3De136de5d733161fdfd203f23b448434170d189ea seems li= ke a good > > candidate, since it's clock related and explicitly references your GPU = in > > the code. >=20 > Hi, >=20 > I have reverted this commit on a 4.8.14 and the flickering stopped. >=20 > C. Having a looking at the diff; the new diff actually configures=20 } else if (rdev->family =3D=3D CHIP_VERDE) { + if ((rdev->pdev->revision =3D=3D 0x81) || + (rdev->pdev->revision =3D=3D 0x83) || ... + (rdev->pdev->device =3D=3D 0x6821) || ... + (rdev->pdev->device =3D=3D 0x682B)) { + max_sclk =3D 75000; + max_mclk =3D 80000; + } So on my MacBook Pro 11,5 - the device ID and revision are:=20 01:00.0 0300: 1002:6821 (rev 83) 01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Venus XT [Radeon HD 8870M / R9 M270X/M370X] (rev 83) So; since this commit, the max_sclk and max_mclk has been set for this GPU = to 75000 and 80000. In previous version of this driver module, this specific G= PU was being skipped. I think these values have been incorrectly set for this = CPU. According to these specifications for the M370X Mac chip, http://gpuboss.com/graphics-card/Radeon-R9-M370X-Mac, the two values max_sc= lk and max_mclk are probably: Clock speed 775 MHz Turbo clock speed 800 MHz So we are setting this stuff to run possibly 25 MHz out of sync with the ac= tual GPU clock. I'm guessing this would be subtle enough to cause the flickering we're seeing, perhaps it should be something like this: } else if (rdev->family =3D=3D CHIP_VERDE) { if (rdev->pdev->device =3D=3D 0x6821 && rdev->pdev->revision =3D=3D 0x83) { max_sclk =3D 77500; max_mclk =3D 80000; } else if other conditions In general though, the new block of device and revisions are VERY loose and= not very well thought out. The OR conditionals are too far reaching. This GPU is matched in two different sections and even the device ID or the revision al= one is enough to modify the aforementioned values. I might make compile 4.9.0 tonight to try this theory out and set max_sclk = to 77500. Perhaps the best actual solution is to not even include this device = and revision in the dpm quirks; as it was previously omitted and was never an actual problem. I haven't figured out how to determine the actual GPU frequency right now, = but if we can confirm it's running at a stock speed of 775 MHz, that would give= me greater confidence in testing this idea out. --=20 You are receiving this mail because: You are the assignee for the bug.= --14817808111.9536662E.29631 Date: Thu, 15 Dec 2016 05:46:51 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated

Commen= t # 18 on bug 98897<= /a> from berg
(In reply to C=C3=A9dric Le Goater from comment #17)
> so this is a CHIP_VERDE revision 0x83

(In reply to C=C3=A9dric Le Goater from comment #14)
> (In reply to Michel D=C3=A4nzer from comment #10)
> > If you can't or don't want to bisect, there are only 4 radeon dri=
ver commits
> > between 4.8.6 and 4.8.7, so it shouldn't take long to try manuall=
y reverting
> > each of those.
> > https://git.kernel.org/cgit/linux/kernel/git/stable=
/linux-stable.git/commit/
> > ?h=3Dlinux-4.8.y&id=3De136de5d733161fdfd203f23b448434170d189e=
a seems like a good
> > candidate, since it's clock related and explicitly references you=
r GPU in
> > the code.
>=20
> Hi,
>=20
> I have reverted this commit on a 4.8.14 and the flickering stopped.
>=20
> C.

Having a looking at the diff; the new diff actually configures=20


        } else if (rdev->family =3D=3D CHIP_VERDE) {
+               if ((rdev->pdev->revision =3D=3D 0x81) ||
+                   (rdev->pdev->revision =3D=3D 0x83) ||
...
+                   (rdev->pdev->device =3D=3D 0x6821) ||
...
+                   (rdev->pdev->device =3D=3D 0x682B)) {
+                       max_sclk =3D 75000;
+                       max_mclk =3D 80000;
+               }

So on my MacBook Pro 11,5 - the device ID and revision are:=20

  01:00.0 0300: 1002:6821 (rev 83)
  01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI]
Venus XT [Radeon HD 8870M / R9 M270X/M370X] (rev 83)

So; since this commit, the max_sclk and max_mclk has been set for this GPU =
to
75000 and 80000. In previous version of this driver module, this specific G=
PU
was being skipped. I think these values have been incorrectly set for this =
CPU.

According to these specifications for the M370X Mac chip,
http://gpu=
boss.com/graphics-card/Radeon-R9-M370X-Mac, the two values max_sclk
and max_mclk are probably:

  Clock speed           775 MHz
  Turbo clock speed     800 MHz

So we are setting this stuff to run possibly 25 MHz out of sync with the ac=
tual
GPU clock. I'm guessing this would be subtle enough to cause the flickering
we're seeing, perhaps it should be something like this:

        } else if (rdev->family =3D=3D CHIP_VERDE) {
                if (rdev->pdev->device =3D=3D 0x6821 &&
                     rdev->pdev->revision =3D=3D 0x83) {
                        max_sclk =3D 77500;
                        max_mclk =3D 80000;
                } else if other conditions

In general though, the new block of device and revisions are VERY loose and=
 not
very well thought out. The OR conditionals are too far reaching. This GPU is
matched in two different sections and even the device ID or the revision al=
one
is enough to modify the aforementioned values.

I might make compile 4.9.0 tonight to try this theory out and set max_sclk =
to
77500. Perhaps the best actual solution is to not even include this device =
and
revision in the dpm quirks; as it was previously omitted and was never an
actual problem.

I haven't figured out how to determine the actual GPU frequency right now, =
but
if we can confirm it's running at a stock speed of 775 MHz, that would give=
 me
greater confidence in testing this idea out.


You are receiving this mail because:
  • You are the assignee for the bug.
= --14817808111.9536662E.29631-- --===============0369440156== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============0369440156==--