Bug 153451

Summary: [bisected] display corruption issue on Mobility Radeon HD 3650 (RV635/M86) since kernel 4.7
Product: Drivers Reporter: Denis Ollier (larchunix+kernel)
Component: Video(DRI - non Intel)Assignee: drivers_video-dri
Status: RESOLVED PATCH_ALREADY_AVAILABLE    
Severity: high CC: alexdeucher
Priority: P1    
Hardware: x86-64   
OS: Linux   
Kernel Version: 4.7 and above Subsystem:
Regression: No Bisected commit-id:
Attachments: Photo of the corruption issue (poor quality but the image is ugly anyway)

Description Denis Ollier 2016-08-19 22:22:00 UTC
Created attachment 229491 [details]
Photo of the corruption issue (poor quality but the image is ugly anyway)

After upgrading the kernel package to version 4.7 on ArchLinux, display output gets corrupted as soon as the radeon module is loaded on my laptop.

As a result, the display output is *ugly*: flickering, bluring, wrong color depth... (see attachment)

Involved hardware:
- ID_MODEL_FROM_DATABASE=RV635/M86 [Mobility Radeon HD 3650]
- ID_PCI_CLASS_FROM_DATABASE=Display controller
- ID_PCI_INTERFACE_FROM_DATABASE=VGA controller
- ID_PCI_SUBCLASS_FROM_DATABASE=VGA compatible controller
- ID_VENDOR_FROM_DATABASE=Advanced Micro Devices, Inc. [AMD/ATI]
- DRIVER=radeon
- MODALIAS=pci:v00001002d00009591sv00001631sd0000C223bc03sc00i00
- PCI_CLASS=30000
- PCI_ID=1002:9591
- PCI_SLOT_NAME=0000:01:00.0
- PCI_SUBSYS_ID=1631:C223
- SUBSYSTEM=pci

Running git-bisect points out the following commit as the culprit:

commit 9ef8537e68941d858924a3eacee5a1945767cbab
Author: Christian König <christian.koenig@amd.com>
Date:   Mon Jun 13 16:09:53 2016 +0200

    drm/radeon: don't use fractional dividers on RS[78]80 if SS is enabled
    
    Seems to cause problems for some older hardware. Kudos to Thom Kouwenhoven
    for working a lot with the PLLs and figuring this out.
    
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Christian König <christian.koenig@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/radeon/atombios_crtc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
index 2e216e2..259cd6e 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -589,7 +589,8 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
        if (ASIC_IS_DCE41(rdev) || ASIC_IS_DCE61(rdev) || ASIC_IS_DCE8(rdev))
            radeon_crtc->pll_flags |= RADEON_PLL_USE_FRAC_FB_DIV;
        /* use frac fb div on RS780/RS880 */
-       if ((rdev->family == CHIP_RS780) || (rdev->family == CHIP_RS880))
+       if (((rdev->family == CHIP_RS780) || (rdev->family == CHIP_RS880))
+           && !radeon_crtc->ss_enabled)
            radeon_crtc->pll_flags |= RADEON_PLL_USE_FRAC_FB_DIV;
        if (ASIC_IS_DCE32(rdev) && mode->clock > 165000)
            radeon_crtc->pll_flags |= RADEON_PLL_USE_FRAC_FB_DIV;
@@ -626,7 +627,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
            if (radeon_crtc->ss.refdiv) {
                radeon_crtc->pll_flags |= RADEON_PLL_USE_REF_DIV;
                radeon_crtc->pll_reference_div = radeon_crtc->ss.refdiv;
-               if (ASIC_IS_AVIVO(rdev))
+               if (rdev->family >= CHIP_RV770)
                    radeon_crtc->pll_flags |= RADEON_PLL_USE_FRAC_FB_DIV;
            }
        }

The change has two hunks:
- reverting only the first one doesn't change anything,
- reverting only the second one fix the corruption issue.
Comment 1 Alex Deucher 2016-08-19 22:24:19 UTC
Duplicate of:
https://bugs.freedesktop.org/show_bug.cgi?id=97099
See that bug for the fix which is already on it's way upstream.
Comment 2 Denis Ollier 2016-08-19 22:37:18 UTC
My bad, thanks for the link.