aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4044-drm-amd-display-Added-pixel-dynamic-expansion-contro.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4044-drm-amd-display-Added-pixel-dynamic-expansion-contro.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4044-drm-amd-display-Added-pixel-dynamic-expansion-contro.patch144
1 files changed, 144 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4044-drm-amd-display-Added-pixel-dynamic-expansion-contro.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4044-drm-amd-display-Added-pixel-dynamic-expansion-contro.patch
new file mode 100644
index 00000000..36df2639
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4044-drm-amd-display-Added-pixel-dynamic-expansion-contro.patch
@@ -0,0 +1,144 @@
+From baae5de0423aab2578facf11caad89f4770539f5 Mon Sep 17 00:00:00 2001
+From: Robin Singh <robin.singh@amd.com>
+Date: Thu, 22 Aug 2019 14:42:49 -0400
+Subject: [PATCH 4044/4256] drm/amd/display: Added pixel dynamic expansion
+ control.
+
+[Why]
+To compare the crc of the framebuffer data at input of
+display pipeline with the crc of the otg, we need to
+disable pixel formatter's dynamic expansion feature during
+crc capture and keep it enable in the normal operation.
+
+[HOW]
+Expose a new interface in DM and dc for pixel formatter
+(fmt dynamic bitdepth expansion control). Interface control
+the FMT_DYNAMIC_EXP_EN bit, during crc capture keep
+it disabled.
+
+Signed-off-by: Robin Singh <robin.singh@amd.com>
+Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
+Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
+---
+ .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 9 ++++++--
+ drivers/gpu/drm/amd/display/dc/core/dc.c | 21 +++++++++++++++++++
+ drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 5 +++++
+ drivers/gpu/drm/amd/display/dc/dc_stream.h | 3 +++
+ .../gpu/drm/amd/display/dc/dcn10/dcn10_opp.c | 3 +++
+ drivers/gpu/drm/amd/display/dc/inc/hw/opp.h | 1 +
+ 6 files changed, 40 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c
+index fa8e2c3ddf9d..f68f9f6d953e 100644
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c
+@@ -122,11 +122,16 @@ int amdgpu_dm_crtc_configure_crc_source(struct drm_crtc *crtc,
+ }
+
+ /* Configure dithering */
+- if (!dm_need_crc_dither(source))
++ if (!dm_need_crc_dither(source)) {
+ dc_stream_set_dither_option(stream_state, DITHER_OPTION_TRUN8);
+- else
++ dc_stream_set_dyn_expansion(stream_state->ctx->dc, stream_state,
++ DYN_EXPANSION_DISABLE);
++ } else {
+ dc_stream_set_dither_option(stream_state,
+ DITHER_OPTION_DEFAULT);
++ dc_stream_set_dyn_expansion(stream_state->ctx->dc, stream_state,
++ DYN_EXPANSION_AUTO);
++ }
+
+ unlock:
+ mutex_unlock(&adev->dm.dc_lock);
+diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
+index 56861f796406..6c1de21380ce 100644
+--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
++++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
+@@ -408,6 +408,27 @@ bool dc_stream_get_crc(struct dc *dc, struct dc_stream_state *stream,
+ return false;
+ }
+
++void dc_stream_set_dyn_expansion(struct dc *dc, struct dc_stream_state *stream,
++ enum dc_dynamic_expansion option)
++{
++ /* OPP FMT dyn expansion updates*/
++ int i = 0;
++ struct pipe_ctx *pipe_ctx;
++
++ for (i = 0; i < MAX_PIPES; i++) {
++ if (dc->current_state->res_ctx.pipe_ctx[i].stream
++ == stream) {
++ pipe_ctx = &dc->current_state->res_ctx.pipe_ctx[i];
++ pipe_ctx->stream_res.opp->dyn_expansion = option;
++ pipe_ctx->stream_res.opp->funcs->opp_set_dyn_expansion(
++ pipe_ctx->stream_res.opp,
++ COLOR_SPACE_YCBCR601,
++ stream->timing.display_color_depth,
++ stream->signal);
++ }
++ }
++}
++
+ void dc_stream_set_dither_option(struct dc_stream_state *stream,
+ enum dc_dither_option option)
+ {
+diff --git a/drivers/gpu/drm/amd/display/dc/dc_hw_types.h b/drivers/gpu/drm/amd/display/dc/dc_hw_types.h
+index 2869b26d966a..e0856bb8511f 100644
+--- a/drivers/gpu/drm/amd/display/dc/dc_hw_types.h
++++ b/drivers/gpu/drm/amd/display/dc/dc_hw_types.h
+@@ -578,6 +578,11 @@ enum dc_quantization_range {
+ QUANTIZATION_RANGE_LIMITED
+ };
+
++enum dc_dynamic_expansion {
++ DYN_EXPANSION_AUTO,
++ DYN_EXPANSION_DISABLE
++};
++
+ /* XFM */
+
+ /* used in struct dc_plane_state */
+diff --git a/drivers/gpu/drm/amd/display/dc/dc_stream.h b/drivers/gpu/drm/amd/display/dc/dc_stream.h
+index 3c061d4f214f..fdb6adc37857 100644
+--- a/drivers/gpu/drm/amd/display/dc/dc_stream.h
++++ b/drivers/gpu/drm/amd/display/dc/dc_stream.h
+@@ -451,6 +451,9 @@ void dc_stream_set_static_screen_events(struct dc *dc,
+ int num_streams,
+ const struct dc_static_screen_events *events);
+
++void dc_stream_set_dyn_expansion(struct dc *dc, struct dc_stream_state *stream,
++ enum dc_dynamic_expansion option);
++
+ void dc_stream_set_dither_option(struct dc_stream_state *stream,
+ enum dc_dither_option option);
+
+diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_opp.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_opp.c
+index 7045c00edab9..5be042acf9fa 100644
+--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_opp.c
++++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_opp.c
+@@ -238,6 +238,9 @@ void opp1_set_dyn_expansion(
+ FMT_DYNAMIC_EXP_EN, 0,
+ FMT_DYNAMIC_EXP_MODE, 0);
+
++ if (opp->dyn_expansion == DYN_EXPANSION_DISABLE)
++ return;
++
+ /*00 - 10-bit -> 12-bit dynamic expansion*/
+ /*01 - 8-bit -> 12-bit dynamic expansion*/
+ if (signal == SIGNAL_TYPE_HDMI_TYPE_A ||
+diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/opp.h b/drivers/gpu/drm/amd/display/dc/inc/hw/opp.h
+index 957e9047381a..18def2b6fafe 100644
+--- a/drivers/gpu/drm/amd/display/dc/inc/hw/opp.h
++++ b/drivers/gpu/drm/amd/display/dc/inc/hw/opp.h
+@@ -208,6 +208,7 @@ struct output_pixel_processor {
+ struct mpc_tree mpc_tree_params;
+ bool mpcc_disconnect_pending[MAX_PIPES];
+ const struct opp_funcs *funcs;
++ uint32_t dyn_expansion;
+ };
+
+ enum fmt_stereo_action {
+--
+2.17.1
+