public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher@gmail.com>
To: Gilles Risch <gilles.risch@gmail.com>
Cc: alexander.deucher@amd.com, amd-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org, lkp@intel.com
Subject: Re: [PATCH v3 1/2] drm/radeon: fix internal display on iMac11, 1 (RV770/DCE3.1)
Date: Tue, 19 May 2026 09:35:13 -0400	[thread overview]
Message-ID: <CADnq5_NTwvFEN4s6OdOmoNQAMckZwBOs-aoqsREmuK4GbY6KwQ@mail.gmail.com> (raw)
In-Reply-To: <20260518211409.4868-5-gilles.risch@gmail.com>

On Tue, May 19, 2026 at 3:19 AM Gilles Risch <gilles.risch@gmail.com> wrote:
>
> The Apple iMac11,1 (late 2009) has an integrated ATI Mobility Radeon
> HD 4850 (RV770/M98L) with a 2560x1440 internal panel connected via an
> internal DisplayPort path. This machine suffers from a similar problem
> as the iMac10,1 (late 2009) and the iMac11,2 (mid 2010). Without this
> fix the display stays dark under KMS. Two issues are addressed:
>
> 1. The RV770 implements DCE3.1 and not DCE3.2. ASIC_IS_DCE32() starts at
>    CHIP_RV730 which is newer than RV770, so the RV770 never matched the
>    DCE3.2 PLL and encoder logic. Introduce ASIC_IS_DCE31() starting at
>    CHIP_RV770 to fix this.
>
> 2. Apple routed the internal display through Link B of the DIG encoder
>    instead of Link A, as observed in the kernel display connector log.
>    The same quirk already exists for iMac10,1 and iMac11,2 - iMac11,1
>    was simply missing from the list.
>
> Note: resume from suspend still results in a dark screen as the DP
> re-driver chips on the mainboard lose their state during power-off.
> This will be addressed in a follow-up patch.
>
> Fixes freedesktop issue 164
> Link: https://gitlab.freedesktop.org/xorg/driver/xf86-video-ati/-/issues/164
>
> Signed-off-by: Gilles Risch <gilles.risch@gmail.com>
> ---
> v3: No code changes.
>
>  drivers/gpu/drm/radeon/atombios_crtc.c     | 4 ++--
>  drivers/gpu/drm/radeon/atombios_encoders.c | 9 +++++----
>  drivers/gpu/drm/radeon/radeon.h            | 1 +
>  3 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
> index 2fc0334e0d6c..3c6d332739e3 100644
> --- a/drivers/gpu/drm/radeon/atombios_crtc.c
> +++ b/drivers/gpu/drm/radeon/atombios_crtc.c
> @@ -580,7 +580,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
>                         radeon_crtc->pll_flags |= (/*RADEON_PLL_USE_FRAC_FB_DIV |*/
>                                 RADEON_PLL_PREFER_CLOSEST_LOWER);
>
> -               if (ASIC_IS_DCE32(rdev) && mode->clock > 200000)        /* range limits??? */
> +               if (ASIC_IS_DCE31(rdev) && mode->clock > 200000)        /* range limits??? */
>                         radeon_crtc->pll_flags |= RADEON_PLL_PREFER_HIGH_FB_DIV;
>                 else
>                         radeon_crtc->pll_flags |= RADEON_PLL_PREFER_LOW_REF_DIV;
> @@ -594,7 +594,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
>                 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)
> +               if (ASIC_IS_DCE31(rdev) && mode->clock > 165000)

Can you switch these to dmi matches as well?  This change will also
change the behavior for other boards with respect to the PLL
calculations which are often pretty sensitive and may cause
regressions.

Alex

>                         radeon_crtc->pll_flags |= RADEON_PLL_USE_FRAC_FB_DIV;
>         } else {
>                 radeon_crtc->pll_flags |= RADEON_PLL_LEGACY;
> diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c
> index 5cfd8fcfa5e8..4e984973c043 100644
> --- a/drivers/gpu/drm/radeon/atombios_encoders.c
> +++ b/drivers/gpu/drm/radeon/atombios_encoders.c
> @@ -2123,12 +2123,13 @@ int radeon_atom_pick_dig_encoder(struct drm_encoder *encoder, int fe_idx)
>         }
>
>         /*
> -        * On DCE32 any encoder can drive any block so usually just use crtc id,
> -        * but Apple thinks different at least on iMac10,1 and iMac11,2, so there use linkb,
> -        * otherwise the internal eDP panel will stay dark.
> +        * On DCE31 and DCE32 any encoder can drive any block so usually just use crtc id,
> +        * but Apple thinks different at least on iMac10,1, iMac11,1 and iMac11,2,
> +        * so there use linkb, otherwise the internal eDP panel will stay dark.
>          */
> -       if (ASIC_IS_DCE32(rdev)) {
> +       if (ASIC_IS_DCE31(rdev)) {
>                 if (dmi_match(DMI_PRODUCT_NAME, "iMac10,1") ||
> +                   dmi_match(DMI_PRODUCT_NAME, "iMac11,1") ||
>                     dmi_match(DMI_PRODUCT_NAME, "iMac11,2"))
>                         enc_idx = (dig->linkb) ? 1 : 0;
>                 else
> diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
> index 527b9d19d730..6b7c0abe49fb 100644
> --- a/drivers/gpu/drm/radeon/radeon.h
> +++ b/drivers/gpu/drm/radeon/radeon.h
> @@ -2625,6 +2625,7 @@ void r100_pll_errata_after_index(struct radeon_device *rdev);
>                             (rdev->family == CHIP_RS740)  ||    \
>                             (rdev->family >= CHIP_R600))
>  #define ASIC_IS_DCE3(rdev) ((rdev->family >= CHIP_RV620))
> +#define ASIC_IS_DCE31(rdev) ((rdev->family >= CHIP_RV770))
>  #define ASIC_IS_DCE32(rdev) ((rdev->family >= CHIP_RV730))
>  #define ASIC_IS_DCE4(rdev) ((rdev->family >= CHIP_CEDAR))
>  #define ASIC_IS_DCE41(rdev) ((rdev->family >= CHIP_PALM) && \
> --
> 2.47.3
>

  reply	other threads:[~2026-05-19 13:35 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-10 18:54 [PATCH] The Apple iMac11, 1 (late 2009) has an integrated ATI Mobility Radeon HD 4850. This machine suffers from a similar problem as the iMac10, 1 (late 2009) and the iMac11, 2 (mid 2010). This small patch fixes the issue on this machine Gilles Risch
2026-05-16  5:26 ` Claude review: " Claude Code Review Bot
2026-05-16  5:26 ` Claude Code Review Bot
2026-05-16  9:24 ` [PATCH v2] drm/radeon: fix internal display on iMac11, 1 (RV770/DCE3.1) Gilles Risch
2026-05-16 18:09   ` Lukas Wunner
2026-05-17 13:53     ` Gilles Risch
2026-05-17 14:05       ` Lukas Wunner
2026-05-18  6:36     ` Claude review: " Claude Code Review Bot
2026-05-16 18:52   ` [PATCH] drm/radeon: fix eDP resume from suspend on iMac11, 1 / DCE3.1 systems Gilles Risch
2026-05-17  3:28     ` kernel test robot
2026-06-04  3:37       ` Claude review: " Claude Code Review Bot
2026-05-17  5:12     ` kernel test robot
2026-05-18 14:13     ` Alex Deucher
2026-05-18 14:40       ` Gilles Risch
2026-05-18 14:57         ` Alex Deucher
2026-05-18 21:14           ` [PATCH v3 0/2] drm/radeon: fix iMac11,1 dark display Gilles Risch
2026-06-04  3:37             ` Claude review: " Claude Code Review Bot
2026-05-18 21:14           ` [PATCH v3 1/2] drm/radeon: fix internal display on iMac11, 1 (RV770/DCE3.1) Gilles Risch
2026-05-19 13:35             ` Alex Deucher [this message]
2026-05-18 21:14           ` [PATCH v3 2/2] drm/radeon: fix eDP resume from suspend on iMac11, 1 / DCE3.1 systems Gilles Risch
2026-05-19 13:42             ` Alex Deucher
2026-05-27 22:20               ` [PATCH v4] drm/radeon: fix internal display on iMac11, 1 (RV770/DCE3.1) Gilles Risch
2026-05-28 18:53                 ` Alex Deucher
2026-05-29  7:43                   ` Gilles Risch
2026-05-29 13:31                     ` Alex Deucher
2026-06-01 21:19                       ` [PATCH v5] " Gilles Risch
2026-06-04  3:37     ` Claude review: drm/radeon: fix eDP resume from suspend on iMac11, 1 / DCE3.1 systems Claude Code Review Bot
2026-05-18  6:57   ` Claude review: drm/radeon: fix internal display on iMac11, 1 (RV770/DCE3.1) Claude Code Review Bot

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=CADnq5_NTwvFEN4s6OdOmoNQAMckZwBOs-aoqsREmuK4GbY6KwQ@mail.gmail.com \
    --to=alexdeucher@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gilles.risch@gmail.com \
    --cc=lkp@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox