Commit 0905f329 authored by Julian Parkin's avatar Julian Parkin Committed by Alex Deucher

drm/amd/display: Fix dc_create failure handling and 666 color depths

[Why]
It is possible (but very unlikely) that constructing dc fails
before current_state is created.

We support 666 color depth in some scenarios, but this
isn't handled in get_norm_pix_clk. It uses exactly the
same pixel clock as the 888 case.

[How]
Check for non null current_state before destructing.

Add case for 666 color depth to get_norm_pix_clk to
avoid assertion.
Signed-off-by: default avatarJulian Parkin <julian.parkin@amd.com>
Reviewed-by: default avatarCharlene Liu <Charlene.Liu@amd.com>
Acked-by: default avatarLeo Li <sunpeng.li@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 67fd6c0d
...@@ -502,8 +502,10 @@ void dc_stream_set_static_screen_events(struct dc *dc, ...@@ -502,8 +502,10 @@ void dc_stream_set_static_screen_events(struct dc *dc,
static void destruct(struct dc *dc) static void destruct(struct dc *dc)
{ {
if (dc->current_state) {
dc_release_state(dc->current_state); dc_release_state(dc->current_state);
dc->current_state = NULL; dc->current_state = NULL;
}
destroy_links(dc); destroy_links(dc);
......
...@@ -1839,6 +1839,7 @@ static int get_norm_pix_clk(const struct dc_crtc_timing *timing) ...@@ -1839,6 +1839,7 @@ static int get_norm_pix_clk(const struct dc_crtc_timing *timing)
pix_clk /= 2; pix_clk /= 2;
if (timing->pixel_encoding != PIXEL_ENCODING_YCBCR422) { if (timing->pixel_encoding != PIXEL_ENCODING_YCBCR422) {
switch (timing->display_color_depth) { switch (timing->display_color_depth) {
case COLOR_DEPTH_666:
case COLOR_DEPTH_888: case COLOR_DEPTH_888:
normalized_pix_clk = pix_clk; normalized_pix_clk = pix_clk;
break; break;
......
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