aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3081-drm-amd-display-Fix-dc_create-failure-handling-and-6.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3081-drm-amd-display-Fix-dc_create-failure-handling-and-6.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3081-drm-amd-display-Fix-dc_create-failure-handling-and-6.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3081-drm-amd-display-Fix-dc_create-failure-handling-and-6.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3081-drm-amd-display-Fix-dc_create-failure-handling-and-6.patch
new file mode 100644
index 00000000..c7cc95e3
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3081-drm-amd-display-Fix-dc_create-failure-handling-and-6.patch
@@ -0,0 +1,60 @@
+From c42bfe5dd7a03dd01309f4fba554f0e21afd1e7e Mon Sep 17 00:00:00 2001
+From: Julian Parkin <julian.parkin@amd.com>
+Date: Tue, 25 Jun 2019 14:55:53 -0400
+Subject: [PATCH 3081/4256] 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: Julian Parkin <julian.parkin@amd.com>
+Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
+Acked-by: Leo Li <sunpeng.li@amd.com>
+---
+ drivers/gpu/drm/amd/display/dc/core/dc.c | 6 ++++--
+ drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 1 +
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
+index 0b7fbd59cb3b..886fcc1e701f 100644
+--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
++++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
+@@ -506,8 +506,10 @@ void dc_stream_set_static_screen_events(struct dc *dc,
+
+ static void destruct(struct dc *dc)
+ {
+- dc_release_state(dc->current_state);
+- dc->current_state = NULL;
++ if (dc->current_state) {
++ dc_release_state(dc->current_state);
++ dc->current_state = NULL;
++ }
+
+ destroy_links(dc);
+
+diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+index 31a49c59c278..c5a740821c0e 100644
+--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
++++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+@@ -1852,6 +1852,7 @@ static int get_norm_pix_clk(const struct dc_crtc_timing *timing)
+ pix_clk /= 2;
+ if (timing->pixel_encoding != PIXEL_ENCODING_YCBCR422) {
+ switch (timing->display_color_depth) {
++ case COLOR_DEPTH_666:
+ case COLOR_DEPTH_888:
+ normalized_pix_clk = pix_clk;
+ break;
+--
+2.17.1
+