hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/gpu/drm/radeon/atombios_encoders.c
....@@ -23,15 +23,19 @@
2323 * Authors: Dave Airlie
2424 * Alex Deucher
2525 */
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
+
3327 #include <linux/backlight.h>
3428 #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"
3539
3640 extern int atom_debug;
3741
....@@ -1882,11 +1886,10 @@
18821886 if (ASIC_IS_AVIVO(rdev))
18831887 args.v1.ucCRTC = radeon_crtc->crtc_id;
18841888 else {
1885
- if (radeon_encoder->encoder_id == ENCODER_OBJECT_ID_INTERNAL_DAC1) {
1889
+ if (radeon_encoder->encoder_id == ENCODER_OBJECT_ID_INTERNAL_DAC1)
18861890 args.v1.ucCRTC = radeon_crtc->crtc_id;
1887
- } else {
1891
+ else
18881892 args.v1.ucCRTC = radeon_crtc->crtc_id << 2;
1889
- }
18901893 }
18911894 switch (radeon_encoder->encoder_id) {
18921895 case ENCODER_OBJECT_ID_INTERNAL_TMDS1:
....@@ -2188,11 +2191,12 @@
21882191
21892192 /*
21902193 * 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,
21922195 * otherwise the internal eDP panel will stay dark.
21932196 */
21942197 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"))
21962200 enc_idx = (dig->linkb) ? 1 : 0;
21972201 else
21982202 enc_idx = radeon_crtc->crtc_id;
....@@ -2231,9 +2235,9 @@
22312235 DRM_ERROR("Got encoder index incorrect - returning 0\n");
22322236 return 0;
22332237 }
2234
- if (rdev->mode_info.active_encoders & (1 << enc_idx)) {
2238
+ if (rdev->mode_info.active_encoders & (1 << enc_idx))
22352239 DRM_ERROR("chosen encoder in use %d\n", enc_idx);
2236
- }
2240
+
22372241 rdev->mode_info.active_encoders |= (1 << enc_idx);
22382242 return enc_idx;
22392243 }