Commit cf65ebeb authored by Eric Yang's avatar Eric Yang Committed by Alex Deucher

drm/amd/display: fix link bw calculation for 422 and 420 encoding

Link bw required is reduced when we have chroma subsampling.
Signed-off-by: default avatarEric Yang <Eric.Yang2@amd.com>
Reviewed-by: default avatarCharlene Liu <Charlene.Liu@amd.com>
Acked-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 3dc8acad
...@@ -1378,6 +1378,11 @@ static uint32_t bandwidth_in_kbps_from_timing( ...@@ -1378,6 +1378,11 @@ static uint32_t bandwidth_in_kbps_from_timing(
{ {
uint32_t bits_per_channel = 0; uint32_t bits_per_channel = 0;
uint32_t kbps; uint32_t kbps;
if (timing->pixel_encoding == PIXEL_ENCODING_YCBCR422)
bits_per_channel = 12;
else{
switch (timing->display_color_depth) { switch (timing->display_color_depth) {
case COLOR_DEPTH_666: case COLOR_DEPTH_666:
...@@ -1401,14 +1406,20 @@ static uint32_t bandwidth_in_kbps_from_timing( ...@@ -1401,14 +1406,20 @@ static uint32_t bandwidth_in_kbps_from_timing(
default: default:
break; break;
} }
}
ASSERT(bits_per_channel != 0); ASSERT(bits_per_channel != 0);
kbps = timing->pix_clk_khz; kbps = timing->pix_clk_khz;
kbps *= bits_per_channel; kbps *= bits_per_channel;
if (timing->flags.Y_ONLY != 1) if (timing->flags.Y_ONLY != 1) {
/*Only YOnly make reduce bandwidth by 1/3 compares to RGB*/ /*Only YOnly make reduce bandwidth by 1/3 compares to RGB*/
kbps *= 3; kbps *= 3;
if (timing->pixel_encoding == PIXEL_ENCODING_YCBCR420)
kbps /= 2;
else if (timing->pixel_encoding == PIXEL_ENCODING_YCBCR422)
kbps = kbps * 2 / 3;
}
return kbps; return kbps;
......
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