Skip to content

Commit 4cb5aa1

Browse files
committed
Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: drm/radeon/kms: don't try to be smart in the hpd handler drm/radeon: re-POST the asic on Apple hardware when booted via EFI drm/radeon: Allow panel preferred EDID to override BIOS native mode drm/radeon/kms: make some watermark messages debug only drm/radeon/kms: fix regression is handling >2 heads on cedar/caicos drm/radeon/kms: don't enable connectors that are off in the hotplug handler
2 parents aa2b1cf + d5811e8 commit 4cb5aa1

File tree

6 files changed

+41
-10
lines changed

6 files changed

+41
-10
lines changed

drivers/gpu/drm/radeon/atombios_dp.c

+12
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,18 @@ static bool radeon_dp_get_link_status(struct radeon_connector *radeon_connector,
613613
return true;
614614
}
615615

616+
bool radeon_dp_needs_link_train(struct radeon_connector *radeon_connector)
617+
{
618+
u8 link_status[DP_LINK_STATUS_SIZE];
619+
struct radeon_connector_atom_dig *dig = radeon_connector->con_priv;
620+
621+
if (!radeon_dp_get_link_status(radeon_connector, link_status))
622+
return false;
623+
if (dp_channel_eq_ok(link_status, dig->dp_lane_count))
624+
return false;
625+
return true;
626+
}
627+
616628
struct radeon_dp_link_train_info {
617629
struct radeon_device *rdev;
618630
struct drm_encoder *encoder;

drivers/gpu/drm/radeon/evergreen.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ static void evergreen_program_watermarks(struct radeon_device *rdev,
743743
!evergreen_average_bandwidth_vs_available_bandwidth(&wm) ||
744744
!evergreen_check_latency_hiding(&wm) ||
745745
(rdev->disp_priority == 2)) {
746-
DRM_INFO("force priority to high\n");
746+
DRM_DEBUG_KMS("force priority to high\n");
747747
priority_a_cnt |= PRIORITY_ALWAYS_ON;
748748
priority_b_cnt |= PRIORITY_ALWAYS_ON;
749749
}

drivers/gpu/drm/radeon/radeon_connectors.c

+20-9
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,20 @@ void radeon_connector_hotplug(struct drm_connector *connector)
6060

6161
radeon_hpd_set_polarity(rdev, radeon_connector->hpd.hpd);
6262

63-
/* powering up/down the eDP panel generates hpd events which
64-
* can interfere with modesetting.
65-
*/
66-
if (connector->connector_type == DRM_MODE_CONNECTOR_eDP)
63+
/* if the connector is already off, don't turn it back on */
64+
if (connector->dpms != DRM_MODE_DPMS_ON)
6765
return;
6866

69-
/* pre-r600 did not always have the hpd pins mapped accurately to connectors */
70-
if (rdev->family >= CHIP_R600) {
71-
if (radeon_hpd_sense(rdev, radeon_connector->hpd.hpd))
67+
/* just deal with DP (not eDP) here. */
68+
if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) {
69+
int saved_dpms = connector->dpms;
70+
71+
if (radeon_hpd_sense(rdev, radeon_connector->hpd.hpd) &&
72+
radeon_dp_needs_link_train(radeon_connector))
7273
drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
7374
else
7475
drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF);
76+
connector->dpms = saved_dpms;
7577
}
7678
}
7779

@@ -474,11 +476,19 @@ static void radeon_fixup_lvds_native_mode(struct drm_encoder *encoder,
474476
{
475477
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
476478
struct drm_display_mode *native_mode = &radeon_encoder->native_mode;
479+
struct drm_display_mode *t, *mode;
480+
481+
/* If the EDID preferred mode doesn't match the native mode, use it */
482+
list_for_each_entry_safe(mode, t, &connector->probed_modes, head) {
483+
if (mode->type & DRM_MODE_TYPE_PREFERRED) {
484+
if (mode->hdisplay != native_mode->hdisplay ||
485+
mode->vdisplay != native_mode->vdisplay)
486+
memcpy(native_mode, mode, sizeof(*mode));
487+
}
488+
}
477489

478490
/* Try to get native mode details from EDID if necessary */
479491
if (!native_mode->clock) {
480-
struct drm_display_mode *t, *mode;
481-
482492
list_for_each_entry_safe(mode, t, &connector->probed_modes, head) {
483493
if (mode->hdisplay == native_mode->hdisplay &&
484494
mode->vdisplay == native_mode->vdisplay) {
@@ -489,6 +499,7 @@ static void radeon_fixup_lvds_native_mode(struct drm_encoder *encoder,
489499
}
490500
}
491501
}
502+
492503
if (!native_mode->clock) {
493504
DRM_DEBUG_KMS("No LVDS native mode details, disabling RMX\n");
494505
radeon_encoder->rmx_type = RMX_OFF;

drivers/gpu/drm/radeon/radeon_device.c

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <drm/radeon_drm.h>
3333
#include <linux/vgaarb.h>
3434
#include <linux/vga_switcheroo.h>
35+
#include <linux/efi.h>
3536
#include "radeon_reg.h"
3637
#include "radeon.h"
3738
#include "atom.h"
@@ -348,6 +349,9 @@ bool radeon_card_posted(struct radeon_device *rdev)
348349
{
349350
uint32_t reg;
350351

352+
if (efi_enabled && rdev->pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE)
353+
return false;
354+
351355
/* first check CRTCs */
352356
if (ASIC_IS_DCE41(rdev)) {
353357
reg = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET) |

drivers/gpu/drm/radeon/radeon_encoders.c

+3
Original file line numberDiff line numberDiff line change
@@ -2323,6 +2323,9 @@ radeon_add_atom_encoder(struct drm_device *dev,
23232323
default:
23242324
encoder->possible_crtcs = 0x3;
23252325
break;
2326+
case 4:
2327+
encoder->possible_crtcs = 0xf;
2328+
break;
23262329
case 6:
23272330
encoder->possible_crtcs = 0x3f;
23282331
break;

drivers/gpu/drm/radeon/radeon_mode.h

+1
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ extern void radeon_dp_set_link_config(struct drm_connector *connector,
479479
struct drm_display_mode *mode);
480480
extern void radeon_dp_link_train(struct drm_encoder *encoder,
481481
struct drm_connector *connector);
482+
extern bool radeon_dp_needs_link_train(struct radeon_connector *radeon_connector);
482483
extern u8 radeon_dp_getsinktype(struct radeon_connector *radeon_connector);
483484
extern bool radeon_dp_getdpcd(struct radeon_connector *radeon_connector);
484485
extern void atombios_dig_encoder_setup(struct drm_encoder *encoder, int action, int panel_mode);

0 commit comments

Comments
 (0)