aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4654-drm-amd-display-Use-a-temporary-copy-of-the-current-.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4654-drm-amd-display-Use-a-temporary-copy-of-the-current-.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4654-drm-amd-display-Use-a-temporary-copy-of-the-current-.patch87
1 files changed, 87 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4654-drm-amd-display-Use-a-temporary-copy-of-the-current-.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4654-drm-amd-display-Use-a-temporary-copy-of-the-current-.patch
new file mode 100644
index 00000000..1a756d53
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4654-drm-amd-display-Use-a-temporary-copy-of-the-current-.patch
@@ -0,0 +1,87 @@
+From 0021da190e287eb7c2b8dd43b32f8404f7dd75bb Mon Sep 17 00:00:00 2001
+From: Nikola Cornij <nikola.cornij@amd.com>
+Date: Mon, 4 Nov 2019 17:44:23 -0500
+Subject: [PATCH 4654/4736] drm/amd/display: Use a temporary copy of the
+ current state when updating DSC config
+
+[why]
+When updating DSC config, a new config has to be validated before proceeding
+with applying the update. Validation, however, modifies the current state.
+This means DSC config validation would affect pipe re-assignment, causing
+intermittent screen corruption issues when ODM is required for DSC.
+
+[how]
+- Use a copy of the current state for modified DSC config validation
+- Set the update type to FULL_UPDATE to correctly validate and set the
+ actual state used for committing the streams
+
+Signed-off-by: Nikola Cornij <nikola.cornij@amd.com>
+Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
+Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
+Signed-off-by: Rahul Kumar <rahul.kumar1@amd.com>
+---
+ drivers/gpu/drm/amd/display/dc/core/dc.c | 33 +++++++++++++++++++-----
+ 1 file changed, 26 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
+index 562a24f4553f..584127a5ec18 100644
+--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
++++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
+@@ -1672,6 +1672,11 @@ static enum surface_update_type check_update_surfaces_for_stream(
+
+ if (stream_update->output_csc_transform || stream_update->output_color_space)
+ su_flags->bits.out_csc = 1;
++
++#if defined(CONFIG_DRM_AMD_DC_DSC_SUPPORT)
++ if (stream_update->dsc_config)
++ overall_type = UPDATE_TYPE_FULL;
++#endif
+ }
+
+ for (i = 0 ; i < surface_count; i++) {
+@@ -1863,8 +1868,10 @@ static void copy_surface_update_to_plane(
+ static void copy_stream_update_to_stream(struct dc *dc,
+ struct dc_state *context,
+ struct dc_stream_state *stream,
+- const struct dc_stream_update *update)
++ struct dc_stream_update *update)
+ {
++ struct dc_context *dc_ctx = dc->ctx;
++
+ if (update == NULL || stream == NULL)
+ return;
+
+@@ -1941,12 +1948,24 @@ static void copy_stream_update_to_stream(struct dc *dc,
+ uint32_t enable_dsc = (update->dsc_config->num_slices_h != 0 &&
+ update->dsc_config->num_slices_v != 0);
+
+- stream->timing.dsc_cfg = *update->dsc_config;
+- stream->timing.flags.DSC = enable_dsc;
+- if (!dc->res_pool->funcs->validate_bandwidth(dc, context,
+- true)) {
+- stream->timing.dsc_cfg = old_dsc_cfg;
+- stream->timing.flags.DSC = old_dsc_enabled;
++ /* Use temporarry context for validating new DSC config */
++ struct dc_state *dsc_validate_context = dc_create_state(dc);
++
++ if (dsc_validate_context) {
++ dc_resource_state_copy_construct(dc->current_state, dsc_validate_context);
++
++ stream->timing.dsc_cfg = *update->dsc_config;
++ stream->timing.flags.DSC = enable_dsc;
++ if (!dc->res_pool->funcs->validate_bandwidth(dc, dsc_validate_context, true)) {
++ stream->timing.dsc_cfg = old_dsc_cfg;
++ stream->timing.flags.DSC = old_dsc_enabled;
++ update->dsc_config = false;
++ }
++
++ dc_release_state(dsc_validate_context);
++ } else {
++ DC_ERROR("Failed to allocate new validate context for DSC change\n");
++ update->dsc_config = false;
+ }
+ }
+ }
+--
+2.17.1
+