| .. | .. |
|---|
| 23 | 23 | * Authors: Dave Airlie |
|---|
| 24 | 24 | * Alex Deucher |
|---|
| 25 | 25 | */ |
|---|
| 26 | | -#include <drm/drmP.h> |
|---|
| 27 | | -#include <drm/drm_crtc_helper.h> |
|---|
| 28 | | -#include <drm/radeon_drm.h> |
|---|
| 29 | | -#include "radeon.h" |
|---|
| 30 | | -#include "radeon_audio.h" |
|---|
| 31 | | -#include "radeon_asic.h" |
|---|
| 32 | | -#include "atom.h" |
|---|
| 26 | + |
|---|
| 33 | 27 | #include <linux/backlight.h> |
|---|
| 34 | 28 | #include <linux/dmi.h> |
|---|
| 29 | +#include <linux/pci.h> |
|---|
| 30 | + |
|---|
| 31 | +#include <drm/drm_crtc_helper.h> |
|---|
| 32 | +#include <drm/drm_file.h> |
|---|
| 33 | +#include <drm/radeon_drm.h> |
|---|
| 34 | + |
|---|
| 35 | +#include "atom.h" |
|---|
| 36 | +#include "radeon.h" |
|---|
| 37 | +#include "radeon_asic.h" |
|---|
| 38 | +#include "radeon_audio.h" |
|---|
| 35 | 39 | |
|---|
| 36 | 40 | extern int atom_debug; |
|---|
| 37 | 41 | |
|---|
| .. | .. |
|---|
| 1882 | 1886 | if (ASIC_IS_AVIVO(rdev)) |
|---|
| 1883 | 1887 | args.v1.ucCRTC = radeon_crtc->crtc_id; |
|---|
| 1884 | 1888 | else { |
|---|
| 1885 | | - if (radeon_encoder->encoder_id == ENCODER_OBJECT_ID_INTERNAL_DAC1) { |
|---|
| 1889 | + if (radeon_encoder->encoder_id == ENCODER_OBJECT_ID_INTERNAL_DAC1) |
|---|
| 1886 | 1890 | args.v1.ucCRTC = radeon_crtc->crtc_id; |
|---|
| 1887 | | - } else { |
|---|
| 1891 | + else |
|---|
| 1888 | 1892 | args.v1.ucCRTC = radeon_crtc->crtc_id << 2; |
|---|
| 1889 | | - } |
|---|
| 1890 | 1893 | } |
|---|
| 1891 | 1894 | switch (radeon_encoder->encoder_id) { |
|---|
| 1892 | 1895 | case ENCODER_OBJECT_ID_INTERNAL_TMDS1: |
|---|
| .. | .. |
|---|
| 2188 | 2191 | |
|---|
| 2189 | 2192 | /* |
|---|
| 2190 | 2193 | * On DCE32 any encoder can drive any block so usually just use crtc id, |
|---|
| 2191 | | - * but Apple thinks different at least on iMac10,1, so there use linkb, |
|---|
| 2194 | + * but Apple thinks different at least on iMac10,1 and iMac11,2, so there use linkb, |
|---|
| 2192 | 2195 | * otherwise the internal eDP panel will stay dark. |
|---|
| 2193 | 2196 | */ |
|---|
| 2194 | 2197 | if (ASIC_IS_DCE32(rdev)) { |
|---|
| 2195 | | - if (dmi_match(DMI_PRODUCT_NAME, "iMac10,1")) |
|---|
| 2198 | + if (dmi_match(DMI_PRODUCT_NAME, "iMac10,1") || |
|---|
| 2199 | + dmi_match(DMI_PRODUCT_NAME, "iMac11,2")) |
|---|
| 2196 | 2200 | enc_idx = (dig->linkb) ? 1 : 0; |
|---|
| 2197 | 2201 | else |
|---|
| 2198 | 2202 | enc_idx = radeon_crtc->crtc_id; |
|---|
| .. | .. |
|---|
| 2231 | 2235 | DRM_ERROR("Got encoder index incorrect - returning 0\n"); |
|---|
| 2232 | 2236 | return 0; |
|---|
| 2233 | 2237 | } |
|---|
| 2234 | | - if (rdev->mode_info.active_encoders & (1 << enc_idx)) { |
|---|
| 2238 | + if (rdev->mode_info.active_encoders & (1 << enc_idx)) |
|---|
| 2235 | 2239 | DRM_ERROR("chosen encoder in use %d\n", enc_idx); |
|---|
| 2236 | | - } |
|---|
| 2240 | + |
|---|
| 2237 | 2241 | rdev->mode_info.active_encoders |= (1 << enc_idx); |
|---|
| 2238 | 2242 | return enc_idx; |
|---|
| 2239 | 2243 | } |
|---|