aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2886-drm-amd-display-Remove-redundant-checks-in-set_defau.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2886-drm-amd-display-Remove-redundant-checks-in-set_defau.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2886-drm-amd-display-Remove-redundant-checks-in-set_defau.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2886-drm-amd-display-Remove-redundant-checks-in-set_defau.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2886-drm-amd-display-Remove-redundant-checks-in-set_defau.patch
new file mode 100644
index 00000000..07d15cf2
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2886-drm-amd-display-Remove-redundant-checks-in-set_defau.patch
@@ -0,0 +1,46 @@
+From 8579c7fac5768af2915576265eec175736227480 Mon Sep 17 00:00:00 2001
+From: Harry Wentland <harry.wentland@amd.com>
+Date: Fri, 10 Nov 2017 12:08:13 -0500
+Subject: [PATCH 2886/4131] drm/amd/display: Remove redundant checks in
+ set_default_colors
+
+pipe_ctx->stream and pipe_ctx->plane_state are never NULL
+
+Found by smatch:
+drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_hw_sequencer.c:2111
+set_default_colors() error: we previously assumed 'pipe_ctx->stream'
+could be null (see line 2101)
+
+Signed-off-by: Harry Wentland <harry.wentland@amd.com>
+Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
+Acked-by: Harry Wentland <harry.wentland@amd.com>
+---
+ drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 12 ++----------
+ 1 file changed, 2 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
+index da2e440..981bcd2 100644
+--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
++++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
+@@ -2095,16 +2095,8 @@ static void set_default_colors(struct pipe_ctx *pipe_ctx)
+ struct default_adjustment default_adjust = { 0 };
+
+ default_adjust.force_hw_default = false;
+- if (pipe_ctx->plane_state == NULL)
+- default_adjust.in_color_space = COLOR_SPACE_SRGB;
+- else
+- default_adjust.in_color_space =
+- pipe_ctx->plane_state->color_space;
+- if (pipe_ctx->stream == NULL)
+- default_adjust.out_color_space = COLOR_SPACE_SRGB;
+- else
+- default_adjust.out_color_space =
+- pipe_ctx->stream->output_color_space;
++ default_adjust.in_color_space = pipe_ctx->plane_state->color_space;
++ default_adjust.out_color_space = pipe_ctx->stream->output_color_space;
+ default_adjust.csc_adjust_type = GRAPHICS_CSC_ADJUST_TYPE_SW;
+ default_adjust.surface_pixel_format = pipe_ctx->plane_res.scl_data.format;
+
+--
+2.7.4
+