Skip to contentSkip to conversation

drm/radeon/kms: don't use 0 bpc for adjusting hdmi clock

PATCH In review Dave Airlie 2 participants 2 messages Dec 20, 2011

Subsystems (2)
lore
Share & tools
lore

Dave Airlie

author maintainer
#0 lore raw

PATCH 1/1 drm/radeon/kms: don't use 0 bpc for adjusting hdmi clock

From: Dave Airlie <[email protected]>

If the bpc is set from the connector is 0, we then use it later to adjust in a special case the HDMI pixel clock, however if the bpc is 0, we end up passing a 0 pixel clock into the code.

I'm not sure if this is the correct answer or if we should avoid the HDMI clock adjustment for 0 values.

This fixes a divide by 0 on my Llano system with a HDMI monitor and hdmi audio enabled.

---
 drivers/gpu/drm/radeon/atombios_crtc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/radeon/atombios_crtc.c +1 -1
index 2b97262..260fcdc 100644
@@ -554,7 +554,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
 		if (encoder->crtc == crtc) {
 			radeon_encoder = to_radeon_encoder(encoder);
 			connector = radeon_get_connector_for_encoder(encoder);
-			if (connector)
+			if (connector && connector->display_info.bpc)
 				bpc = connector->display_info.bpc;
 			encoder_mode = atombios_get_encoder_mode(encoder);
 			if ((radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT | ATOM_DEVICE_DFP_SUPPORT)) ||
Signature · 1 line
1.7.7.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Dave Airlie

From: Dave Airlie <[email protected]>

If the bpc is set from the connector is 0, we then use it later to adjust in a special case the HDMI pixel clock, however if the bpc is 0, we end up passing a 0 pixel clock into the code.

I'm not sure if this is the correct answer or if we should avoid the HDMI clock adjustment for 0 values.

This fixes a divide by 0 on my Llano system with a HDMI monitor and hdmi audio enabled.

Quoted 26 lines

---
 drivers/gpu/drm/radeon/atombios_crtc.c |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/radeon/atombios_crtc.c +1 -1
index 2b97262..260fcdc 100644
@@ -554,7 +554,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
                if (encoder->crtc == crtc) {
                        radeon_encoder = to_radeon_encoder(encoder);
                        connector = radeon_get_connector_for_encoder(encoder);
-                       if (connector)
+                       if (connector && connector->display_info.bpc)
                                bpc = connector->display_info.bpc;
                        encoder_mode = atombios_get_encoder_mode(encoder);

                       if ((radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT | ATOM_DEVICE_DFP_SUPPORT)) || --
1.7.7.3

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel