提交 cf3fb891 编写于 作者: J Julian Parkin 提交者: Xie XiuQi

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

[ Upstream commit 0905f32977268149f06e3ce6ea4bd6d374dd891f ]

[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: NJulian Parkin <julian.parkin@amd.com>
Reviewed-by: NCharlene Liu <Charlene.Liu@amd.com>
Acked-by: NLeo Li <sunpeng.li@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 220c06c6
...@@ -462,8 +462,10 @@ void dc_link_set_test_pattern(struct dc_link *link, ...@@ -462,8 +462,10 @@ void dc_link_set_test_pattern(struct dc_link *link,
static void destruct(struct dc *dc) static void destruct(struct dc *dc)
{ {
dc_release_state(dc->current_state); if (dc->current_state) {
dc->current_state = NULL; dc_release_state(dc->current_state);
dc->current_state = NULL;
}
destroy_links(dc); destroy_links(dc);
......
...@@ -1872,6 +1872,7 @@ static int get_norm_pix_clk(const struct dc_crtc_timing *timing) ...@@ -1872,6 +1872,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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册