aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2014-02-03 15:53:25 -0500
committerAlex Deucher <alexander.deucher@amd.com>2014-02-18 13:41:00 -0500
commit7d5a33b071d19314c452ca5252ecd990eb0dd696 (patch)
tree3da660abcc0aa4643297a89977dc6b9a368afb6b /drivers/gpu/drm
parentc2288d4d3830946d91ae7aba599d34828d07f103 (diff)
drm/radeon: unify bpc handling
We were already storing the bpc (bits per color) information in radeon_crtc, so just use that everywhere rather than calculating it everywhere we use it. This also allows us to change it in one place if we ever want to override it. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/radeon/atombios_crtc.c2
-rw-r--r--drivers/gpu/drm/radeon/atombios_encoders.c7
2 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
index a9338c85630f..f0d409d846f2 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -559,7 +559,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
559 u32 adjusted_clock = mode->clock; 559 u32 adjusted_clock = mode->clock;
560 int encoder_mode = atombios_get_encoder_mode(encoder); 560 int encoder_mode = atombios_get_encoder_mode(encoder);
561 u32 dp_clock = mode->clock; 561 u32 dp_clock = mode->clock;
562 int bpc = radeon_get_monitor_bpc(connector); 562 int bpc = radeon_crtc->bpc;
563 bool is_duallink = radeon_dig_monitor_is_duallink(encoder, mode->clock); 563 bool is_duallink = radeon_dig_monitor_is_duallink(encoder, mode->clock);
564 564
565 /* reset the pll flags */ 565 /* reset the pll flags */
diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c
index a42d61571f49..2cec2ab02f80 100644
--- a/drivers/gpu/drm/radeon/atombios_encoders.c
+++ b/drivers/gpu/drm/radeon/atombios_encoders.c
@@ -464,11 +464,12 @@ atombios_tv_setup(struct drm_encoder *encoder, int action)
464 464
465static u8 radeon_atom_get_bpc(struct drm_encoder *encoder) 465static u8 radeon_atom_get_bpc(struct drm_encoder *encoder)
466{ 466{
467 struct drm_connector *connector = radeon_get_connector_for_encoder(encoder);
468 int bpc = 8; 467 int bpc = 8;
469 468
470 if (connector) 469 if (encoder->crtc) {
471 bpc = radeon_get_monitor_bpc(connector); 470 struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc);
471 bpc = radeon_crtc->bpc;
472 }
472 473
473 switch (bpc) { 474 switch (bpc) {
474 case 0: 475 case 0: