Re: [PATCH v6] drm/radeon: fix internal display on iMac11, 1 (RV770/DCE3.1)

Alex Deucher <[email protected]>
Newsgroups org.freedesktop.lists.amd-gfx,org.freedesktop.lists.dri-devel
Message-ID <CADnq5_N9-3fF4UFur3oA7+AkNLTiBg_CHdP4SJd0w4UmWZLR8A@mail.gmail.com>
Applied.  Thanks!

Alex

On Sun, Aug 16, 2026 at 8:43 PM Gilles Risch <[email protected]> wrote:
>
> The Apple iMac11,1 (27-inch, Late 2009) uses a Mobility Radeon HD 4850
> (RV770/DCE3.1) with a 2560x1440 internal panel on an internal
> DisplayPort path. Without this fix the display stays dark under KMS.
>
> This machine suffers from the same issue as iMac10,1 and iMac11,2:
> Apple routes the internal display through Link B of the DIG encoder
> instead of Link A. Add iMac11,1 to the existing DMI quirk and move
> the Apple-specific encoder assignment into its own block, independent
> of the DCE version check.
>
> Additionally, the 2560x1440 panel requires RADEON_PLL_USE_FRAC_FB_DIV
> and ATOM_ENCODER_CMD_DP_VIDEO_ON, limited to iMac11,1 via dmi_match()
> to avoid affecting other boards.
>
> Signed-off-by: Gilles Risch <[email protected]>
>
> Good morning,
>
> this is v6 of the patch, rebased on top of amd-staging-drm-next
> (agd5f/linux).
>
> There are no functional or code changes since v5.
>
> Regarding Lukas Wunner's previous Reviewed-by (which was provided on v2),
> I have kept him in CC so he can confirm if his review still stands given
> the changes between v2 and v5.
>
> Could you have a look at this when you have a spare moment?
>
> Regards,
> Gilles
>
> Changes in v6:
> - Rebased on amd-staging-drm-next (no functional/code changes since v5)
> ---
>  drivers/gpu/drm/radeon/atombios_crtc.c     |  5 ++++-
>  drivers/gpu/drm/radeon/atombios_encoders.c | 23 ++++++++++++----------
>  2 files changed, 17 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
> index 2fc0334e0d6c..075eba2d47f3 100644
> --- a/drivers/gpu/drm/radeon/atombios_crtc.c
> +++ b/drivers/gpu/drm/radeon/atombios_crtc.c
> @@ -24,6 +24,8 @@
>   *          Alex Deucher
>   */
>
> +#include <linux/dmi.h>
> +
>  #include <drm/drm_fixed.h>
>  #include <drm/drm_fourcc.h>
>  #include <drm/drm_framebuffer.h>
> @@ -594,7 +596,8 @@ 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_DCE32(rdev) || dmi_match(DMI_PRODUCT_NAME, "iMac11,1"))
> +                   && mode->clock > 165000)
>                         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..8b3f8303a967 100644
> --- a/drivers/gpu/drm/radeon/atombios_encoders.c
> +++ b/drivers/gpu/drm/radeon/atombios_encoders.c
> @@ -1707,7 +1707,7 @@ radeon_atom_encoder_dpms_dig(struct drm_encoder *encoder, int mode)
>                 if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(encoder)) && connector) {
>                         /* DP_SET_POWER_D0 is set in radeon_dp_link_train */
>                         radeon_dp_link_train(encoder, connector);
> -                       if (ASIC_IS_DCE4(rdev))
> +                       if (ASIC_IS_DCE4(rdev) || dmi_match(DMI_PRODUCT_NAME, "iMac11,1"))
>                                 atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_DP_VIDEO_ON, 0);
>                 }
>                 if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) {
> @@ -2123,17 +2123,20 @@ 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.
> +        * Apple routes the internal eDP panel through Link B of the DIG encoder
> +        * instead of Link A on the iMac10,1, iMac11,1 and iMac11,2.
> +        * Use linkb to avoid a dark display.
>          */
> -       if (ASIC_IS_DCE32(rdev)) {
> -               if (dmi_match(DMI_PRODUCT_NAME, "iMac10,1") ||
> -                   dmi_match(DMI_PRODUCT_NAME, "iMac11,2"))
> -                       enc_idx = (dig->linkb) ? 1 : 0;
> -               else
> -                       enc_idx = radeon_crtc->crtc_id;
> +       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;
> +               goto assigned;
> +       }
>
> +       /* on DCE32 and encoder can driver any block so just crtc id */
> +       if (ASIC_IS_DCE32(rdev)) {
> +               enc_idx = radeon_crtc->crtc_id;
>                 goto assigned;
>         }
>
>
> base-commit: 21c50d41af7c46e138b542dba2dcf6d2a978ae99
> --
> 2.47.3
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.