Commit 7d5a33b0 authored by Alex Deucher's avatar Alex Deucher

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: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c2288d4d
...@@ -559,7 +559,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, ...@@ -559,7 +559,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
u32 adjusted_clock = mode->clock; u32 adjusted_clock = mode->clock;
int encoder_mode = atombios_get_encoder_mode(encoder); int encoder_mode = atombios_get_encoder_mode(encoder);
u32 dp_clock = mode->clock; u32 dp_clock = mode->clock;
int bpc = radeon_get_monitor_bpc(connector); int bpc = radeon_crtc->bpc;
bool is_duallink = radeon_dig_monitor_is_duallink(encoder, mode->clock); bool is_duallink = radeon_dig_monitor_is_duallink(encoder, mode->clock);
/* reset the pll flags */ /* reset the pll flags */
......
...@@ -464,11 +464,12 @@ atombios_tv_setup(struct drm_encoder *encoder, int action) ...@@ -464,11 +464,12 @@ atombios_tv_setup(struct drm_encoder *encoder, int action)
static u8 radeon_atom_get_bpc(struct drm_encoder *encoder) static u8 radeon_atom_get_bpc(struct drm_encoder *encoder)
{ {
struct drm_connector *connector = radeon_get_connector_for_encoder(encoder);
int bpc = 8; int bpc = 8;
if (connector) if (encoder->crtc) {
bpc = radeon_get_monitor_bpc(connector); struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc);
bpc = radeon_crtc->bpc;
}
switch (bpc) { switch (bpc) {
case 0: case 0:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment