* [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.
@ 2026-05-10 18:54 Gilles Risch
2026-05-16 9:24 ` [PATCH v2] drm/radeon: fix internal display on iMac11, 1 (RV770/DCE3.1) Gilles Risch
0 siblings, 1 reply; 4+ messages in thread
From: Gilles Risch @ 2026-05-10 18:54 UTC (permalink / raw)
To: alexander.deucher; +Cc: dri-devel, amd-gfx, Gilles Risch
Fixes freedesktop issue 164
Link: https://gitlab.freedesktop.org/xorg/driver/xf86-video-ati/-/issues/164
---
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 2fc0334e0..3c6d33273 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)
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 5cfd8fcfa..4e984973c 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 527b9d19d..6b7c0abe4 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
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH v2] drm/radeon: fix internal display on iMac11, 1 (RV770/DCE3.1)
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 9:24 ` Gilles Risch
2026-05-16 18:09 ` Lukas Wunner
2026-05-16 18:52 ` [PATCH] drm/radeon: fix eDP resume from suspend on iMac11, 1 / DCE3.1 systems Gilles Risch
0 siblings, 2 replies; 4+ messages in thread
From: Gilles Risch @ 2026-05-16 9:24 UTC (permalink / raw)
To: alexander.deucher; +Cc: amd-gfx, dri-devel, Gilles Risch
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>
---
v2: No code changes. Fixed commit message:
- Added drm/radeon: prefix to subject line
- Added empty line between subject and body
- Added technical description of the 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)
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
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH v2] drm/radeon: fix internal display on iMac11, 1 (RV770/DCE3.1)
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-16 18:52 ` [PATCH] drm/radeon: fix eDP resume from suspend on iMac11, 1 / DCE3.1 systems Gilles Risch
1 sibling, 0 replies; 4+ messages in thread
From: Lukas Wunner @ 2026-05-16 18:09 UTC (permalink / raw)
To: Gilles Risch; +Cc: alexander.deucher, amd-gfx, dri-devel
On Sat, May 16, 2026 at 11:24:21AM +0200, Gilles Risch 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.
Not an expert in the radeon driver or AMD chip revisions, but if it
helps improve support for older Macs I'll be happy to offer my:
Reviewed-by: Lukas Wunner <lukas@wunner.de>
It's not immediately obvious that CHIP_RV770 precedes CHIP_RV730
in the enum and that hence ASIC_IS_DCE31() subsumes ASIC_IS_DCE32().
Thanks,
Lukas
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] drm/radeon: fix eDP resume from suspend on iMac11, 1 / DCE3.1 systems
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-16 18:52 ` Gilles Risch
1 sibling, 0 replies; 4+ messages in thread
From: Gilles Risch @ 2026-05-16 18:52 UTC (permalink / raw)
To: alexander.deucher; +Cc: amd-gfx, dri-devel, Gilles Risch
After suspend/resume the internal eDP display on iMac11,1 (and
potentially other DCE3.1 systems) stays dark because
atombios_set_edp_panel_power() skips panel power control for
anything older than DCE4.
Fix this by:
- Extending atombios_set_edp_panel_power() to also handle DCE3.1
by changing the !ASIC_IS_DCE4() guard to !ASIC_IS_DCE31().
HPD polling works correctly on DCE3.1 (verified: HPD is asserted
at iteration 0 on iMac11,1).
- Issuing ATOM_ENCODER_CMD_DP_VIDEO_ON/OFF for DCE3.1 in addition
to DCE4+.
Tested on iMac11,1 (Mobility Radeon HD 4850, RV770/DCE3.1).
Signed-off-by: Gilles Risch <gilles.risch@gmail.com>
---
drivers/gpu/drm/radeon/atombios_encoders.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c
index 4e984973c043..b62fd713efcf 100644
--- a/drivers/gpu/drm/radeon/atombios_encoders.c
+++ b/drivers/gpu/drm/radeon/atombios_encoders.c
@@ -1383,7 +1383,7 @@ atombios_set_edp_panel_power(struct drm_connector *connector, int action)
if (connector->connector_type != DRM_MODE_CONNECTOR_eDP)
goto done;
- if (!ASIC_IS_DCE4(rdev))
+ if (!ASIC_IS_DCE31(rdev))
goto done;
if ((action != ATOM_TRANSMITTER_ACTION_POWER_ON) &&
@@ -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) || ASIC_IS_DCE31(rdev))
atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_DP_VIDEO_ON, 0);
}
if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) {
@@ -1724,7 +1724,7 @@ radeon_atom_encoder_dpms_dig(struct drm_encoder *encoder, int mode)
case DRM_MODE_DPMS_SUSPEND:
case DRM_MODE_DPMS_OFF:
- if (ASIC_IS_DCE4(rdev)) {
+ if (ASIC_IS_DCE4(rdev) || ASIC_IS_DCE31(rdev)) {
if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(encoder)) && connector)
atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_DP_VIDEO_OFF, 0);
}
--
2.47.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-05-16 18:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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-16 18:52 ` [PATCH] drm/radeon: fix eDP resume from suspend on iMac11, 1 / DCE3.1 systems Gilles Risch
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.