From: Lennert Buytenhek Subject: Re: radeon + DVI->mDP converter + mDP display blank screen issue since 3.0 Date: Fri, 23 Mar 2012 16:44:46 +0100 Message-ID: <20120323154446.GK28523@wantstofly.org> References: <20120322124919.GG28523@wantstofly.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Alex Deucher Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, alexander.deucher@amd.com List-Id: dri-devel@lists.freedesktop.org On Fri, Mar 23, 2012 at 10:59:27AM -0400, Alex Deucher wrote: > > Since Linux 3.0, a system with a Radeon HD 5450 (1002:68f9) connect= ed > > to a 27" Apple LED cinema display via an Atlona AT-DP400 Dual Link = DVI > > to Mini DisplayPort converter has started to stop giving screen > > output on switching from text mode to graphical framebuffer during > > system startup. > > > > I finally had some time to look at this, and it seems to have stopp= ed > > working after this commit: > > > > =A0 =A0 =A0 =A0commit df271bec805b42527d864777ed035fcbb42e76c0 > > =A0 =A0 =A0 =A0Author: Alex Deucher > > =A0 =A0 =A0 =A0Date: =A0 Fri May 20 04:34:15 2011 -0400 > > > > =A0 =A0 =A0 =A0 =A0 =A0drm/radeon/kms: properly handle bpc >8 in at= om command tables > > > > =A0 =A0 =A0 =A0 =A0 =A0Signed-off-by: Alex Deucher > > =A0 =A0 =A0 =A0 =A0 =A0Signed-off-by: Dave Airlie > > > > ...and with the patch below (i.e. reverting part of the commit abov= e) > > applied to 3.3 I get screen output again. > > > > Even though the monitor seems to have an 8 bit panel, it reports 10 > > bits per channel in its EDID: > > > > =A0 =A0 =A0 =A0[...] > > =A0 =A0 =A0 =A0Manufacturer: APP Model 9226 Serial Number 41959462 > > =A0 =A0 =A0 =A0Made week 38 of 2010 > > =A0 =A0 =A0 =A0EDID version: 1.4 > > =A0 =A0 =A0 =A0Digital display > > =A0 =A0 =A0 =A010 bits per primary color channel > > =A0 =A0 =A0 =A0DisplayPort interface > > =A0 =A0 =A0 =A0Maximum image size: 60 cm x 34 cm > > =A0 =A0 =A0 =A0[...] > > > > The (active, dual link) DVI->mDP converter spec sheet says it suppo= rts > > 24 bit color, and I'm guessing that it can't deal with 30. =A0Is th= e > > converter at fault here for passing through the EDID unchanged? > > > > Also, what would be the right way to handle this, a kernel command > > line or module option to limit color depth or something like that? > > ("Buy a video card with DP output." is a valid answer, I suppose.) > > > > I have no clue at all about graphics, and I have no idea whatsoever > > what I'm doing here, but I just wanted to post this somewhere for > > Google to find in case someone else runs into this! >=20 > I've inquired with out display team on how to best handle this. In > the meantime, it's probably best to just default to 8 bpc. Does the > attached patch fix your issue? I've been using the patch below in a custom Fedora 17 kernel RPM, and that seems to fix the issue. Your patch seems to be a superset of this patch, so logically, your patch should do the trick as well. :) thanks, Lennert diff -up linux-3.3.0-1.fc17.x86_64/drivers/gpu/drm/radeon/atombios_crtc= =2Ec.orig linux-3.3.0-1.fc17.x86_64/drivers/gpu/drm/radeon/atombios_crt= c.c --- linux-3.3.0-1.fc17.x86_64/drivers/gpu/drm/radeon/atombios_crtc.c.or= ig 2012-03-22 14:52:20.538854547 +0100 +++ linux-3.3.0-1.fc17.x86_64/drivers/gpu/drm/radeon/atombios_crtc.c 20= 12-03-22 14:55:39.740794113 +0100 @@ -550,8 +550,6 @@ static u32 atombios_adjust_pll(struct dr if (encoder->crtc =3D=3D crtc) { radeon_encoder =3D to_radeon_encoder(encoder); connector =3D radeon_get_connector_for_encoder(encoder); - if (connector && connector->display_info.bpc) - bpc =3D connector->display_info.bpc; encoder_mode =3D atombios_get_encoder_mode(encoder); is_duallink =3D radeon_dig_monitor_is_duallink(encoder, mode->clock= ); if ((radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT | ATOM_DEVI= CE_DFP_SUPPORT)) || @@ -922,7 +920,6 @@ static void atombios_crtc_set_pll(struct struct radeon_connector_atom_dig *dig_connector =3D radeon_connector->con_priv; int dp_clock; - bpc =3D connector->display_info.bpc; =20 switch (encoder_mode) { case ATOM_ENCODER_MODE_DP_MST: > From 22ca454eb749968f266d6788a5f4778acc08cc66 Mon Sep 17 00:00:00 200= 1 > From: Alex Deucher > Date: Fri, 23 Mar 2012 10:54:45 -0400 > Subject: [PATCH] drm/radeon/kms/atom: force bpc to 8 for now >=20 > Using the bpc (bits per color) specified by the monitor > can cause problems in some cases. Until we get a better > handle on how to deal with those cases, just use a bpc of 8. >=20 > Reported-by: Lennert Buytenhek > Signed-off-by: Alex Deucher > Cc: stable@kernel.org > --- > drivers/gpu/drm/radeon/atombios_crtc.c | 8 +++++--- > drivers/gpu/drm/radeon/atombios_dp.c | 3 +++ > drivers/gpu/drm/radeon/atombios_encoders.c | 4 ++-- > 3 files changed, 10 insertions(+), 5 deletions(-) >=20 > diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm= /radeon/atombios_crtc.c > index 083b3ea..b5ff1f7 100644 > --- a/drivers/gpu/drm/radeon/atombios_crtc.c > +++ b/drivers/gpu/drm/radeon/atombios_crtc.c > @@ -588,8 +588,8 @@ static u32 atombios_adjust_pll(struct drm_crtc *c= rtc, > if (encoder->crtc =3D=3D crtc) { > radeon_encoder =3D to_radeon_encoder(encoder); > connector =3D radeon_get_connector_for_encoder(encoder); > - if (connector && connector->display_info.bpc) > - bpc =3D connector->display_info.bpc; > + /* if (connector && connector->display_info.bpc) > + bpc =3D connector->display_info.bpc; */ > encoder_mode =3D atombios_get_encoder_mode(encoder); > is_duallink =3D radeon_dig_monitor_is_duallink(encoder, mode->clo= ck); > if ((radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT | ATOM_DE= VICE_DFP_SUPPORT)) || > @@ -965,7 +965,9 @@ static void atombios_crtc_set_pll(struct drm_crtc= *crtc, struct drm_display_mode > struct radeon_connector_atom_dig *dig_connector =3D > radeon_connector->con_priv; > int dp_clock; > - bpc =3D connector->display_info.bpc; > + > + /* if (connector->display_info.bpc) > + bpc =3D connector->display_info.bpc; */ > =20 > switch (encoder_mode) { > case ATOM_ENCODER_MODE_DP_MST: > diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/r= adeon/atombios_dp.c > index 6c62be2..c57d856 100644 > --- a/drivers/gpu/drm/radeon/atombios_dp.c > +++ b/drivers/gpu/drm/radeon/atombios_dp.c > @@ -405,10 +405,13 @@ static void dp_get_adjust_train(u8 link_status[= DP_LINK_STATUS_SIZE], > /* get bpc from the EDID */ > static int convert_bpc_to_bpp(int bpc) > { > +#if 0 > if (bpc =3D=3D 0) > return 24; > else > return bpc * 3; > +#endif > + return 24; > } > =20 > /* get the max pix clock supported by the link rate and lane num */ > diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu= /drm/radeon/atombios_encoders.c > index 468b874..e607c4d 100644 > --- a/drivers/gpu/drm/radeon/atombios_encoders.c > +++ b/drivers/gpu/drm/radeon/atombios_encoders.c > @@ -541,7 +541,7 @@ atombios_dig_encoder_setup(struct drm_encoder *en= coder, int action, int panel_mo > dp_clock =3D dig_connector->dp_clock; > dp_lane_count =3D dig_connector->dp_lane_count; > hpd_id =3D radeon_connector->hpd.hpd; > - bpc =3D connector->display_info.bpc; > + /* bpc =3D connector->display_info.bpc; */ > } > =20 > /* no dig encoder assigned */ > @@ -1159,7 +1159,7 @@ atombios_external_encoder_setup(struct drm_enco= der *encoder, > dp_lane_count =3D dig_connector->dp_lane_count; > connector_object_id =3D > (radeon_connector->connector_object_id & OBJECT_ID_MASK) >> OBJEC= T_ID_SHIFT; > - bpc =3D connector->display_info.bpc; > + /* bpc =3D connector->display_info.bpc; */ > } > =20 > memset(&args, 0, sizeof(args)); > --=20 > 1.7.7.5 >=20