mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
drm/amd/display: Fix dc_create failure handling and 666 color depths
[ Upstream commit 0905f32977 ]
[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: Julian Parkin <julian.parkin@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2961a5916c
commit
94e0d52ab7
@@ -608,8 +608,10 @@ const struct dc_link_settings *dc_link_get_link_cap(
|
|||||||
|
|
||||||
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)
|
|||||||
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;
|
||||||
|
|||||||
Reference in New Issue
Block a user