On Tue, May 19, 2026 at 3:44 AM Gilles Risch <[email protected]> wrote:
>
> After suspend/resume the internal eDP display on Apple iMac11,1,
> stays dark because atombios_set_edp_panel_power() skips panel
> power control for anything older than DCE4, and
> ATOM_ENCODER_CMD_DP_VIDEO_ON/OFF is required on ths iMac.
>
> Tested on iMac11,1 (Mobility Radeon HD 4850, RV770/DCE3.1).
>
> Signed-off-by: Gilles Risch <[email protected]>
> ---
>  drivers/gpu/drm/radeon/atombios_encoders.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c 
> b/drivers/gpu/drm/radeon/atombios_encoders.c
> index 4e984973c043..0a699a887ee9 100644
> --- a/drivers/gpu/drm/radeon/atombios_encoders.c
> +++ b/drivers/gpu/drm/radeon/atombios_encoders.c
> @@ -1384,7 +1384,8 @@ atombios_set_edp_panel_power(struct drm_connector 
> *connector, int action)
>                 goto done;
>
>         if (!ASIC_IS_DCE4(rdev))
> -               goto done;
> +           if (!dmi_match(DMI_PRODUCT_NAME, "iMac11,1"))
> +                   goto done;

This logic is harder to follow.  I would just add an additional check.  E.g.,

         if (!ASIC_IS_DCE4(rdev))
               goto done;

          if (!dmi_match(DMI_PRODUCT_NAME, "iMac11,1"))
                  goto done;

Other than that, looks good to me.

>
>         if ((action != ATOM_TRANSMITTER_ACTION_POWER_ON) &&
>             (action != ATOM_TRANSMITTER_ACTION_POWER_OFF))
> @@ -1707,7 +1708,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)) {
> @@ -1724,7 +1725,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) || dmi_match(DMI_PRODUCT_NAME, 
> "iMac11,1")) {
>                         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
>

Reply via email to