aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorZeyu Fan <Zeyu.Fan@amd.com>2017-06-02 17:25:49 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-09-26 18:07:53 -0400
commit1bf56e62cc4fbff6d701b798da05a91f78aa12e9 (patch)
treea9b5fb284ebc780f907c06746d1156e2166b1722 /drivers/gpu
parenta235bd9f1ea0c610a5cddfb79f98b651dc8dc5bd (diff)
drm/amd/display: Call program_gamut explicitly instead of entire set_plane
This fixes on boot crush on Vega, Polaris with Dal3. Signed-off-by: Zeyu Fan <Zeyu.Fan@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Harry Wentland <Harry.Wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc.c3
-rw-r--r--drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c42
-rw-r--r--drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c1
-rw-r--r--drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h3
4 files changed, 47 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 f5102b644942..657e10bae93f 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -213,8 +213,7 @@ static bool set_gamut_remap(struct dc *dc, const struct dc_stream *stream)
213 == core_stream) { 213 == core_stream) {
214 214
215 pipes = &core_dc->current_context->res_ctx.pipe_ctx[i]; 215 pipes = &core_dc->current_context->res_ctx.pipe_ctx[i];
216 core_dc->hwss.set_plane_config(core_dc, pipes, 216 core_dc->hwss.program_gamut_remap(pipes);
217 &core_dc->current_context->res_ctx);
218 ret = true; 217 ret = true;
219 } 218 }
220 } 219 }
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 7dd4b02b5938..616533e25534 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
@@ -1894,6 +1894,47 @@ static void program_surface_visibility(const struct core_dc *dc,
1894 1894
1895} 1895}
1896 1896
1897static void program_gamut_remap(struct pipe_ctx *pipe_ctx)
1898{
1899 struct xfm_grph_csc_adjustment adjust;
1900 memset(&adjust, 0, sizeof(adjust));
1901 adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_BYPASS;
1902
1903
1904 if (pipe_ctx->stream->public.gamut_remap_matrix.enable_remap == true) {
1905 adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_SW;
1906 adjust.temperature_matrix[0] =
1907 pipe_ctx->stream->
1908 public.gamut_remap_matrix.matrix[0];
1909 adjust.temperature_matrix[1] =
1910 pipe_ctx->stream->
1911 public.gamut_remap_matrix.matrix[1];
1912 adjust.temperature_matrix[2] =
1913 pipe_ctx->stream->
1914 public.gamut_remap_matrix.matrix[2];
1915 adjust.temperature_matrix[3] =
1916 pipe_ctx->stream->
1917 public.gamut_remap_matrix.matrix[4];
1918 adjust.temperature_matrix[4] =
1919 pipe_ctx->stream->
1920 public.gamut_remap_matrix.matrix[5];
1921 adjust.temperature_matrix[5] =
1922 pipe_ctx->stream->
1923 public.gamut_remap_matrix.matrix[6];
1924 adjust.temperature_matrix[6] =
1925 pipe_ctx->stream->
1926 public.gamut_remap_matrix.matrix[8];
1927 adjust.temperature_matrix[7] =
1928 pipe_ctx->stream->
1929 public.gamut_remap_matrix.matrix[9];
1930 adjust.temperature_matrix[8] =
1931 pipe_ctx->stream->
1932 public.gamut_remap_matrix.matrix[10];
1933 }
1934
1935 pipe_ctx->xfm->funcs->transform_set_gamut_remap(pipe_ctx->xfm, &adjust);
1936}
1937
1897/** 1938/**
1898 * TODO REMOVE, USE UPDATE INSTEAD 1939 * TODO REMOVE, USE UPDATE INSTEAD
1899 */ 1940 */
@@ -2509,6 +2550,7 @@ static void dce110_power_down_fe(struct core_dc *dc, struct pipe_ctx *pipe)
2509} 2550}
2510 2551
2511static const struct hw_sequencer_funcs dce110_funcs = { 2552static const struct hw_sequencer_funcs dce110_funcs = {
2553 .program_gamut_remap = program_gamut_remap,
2512 .init_hw = init_hw, 2554 .init_hw = init_hw,
2513 .apply_ctx_to_hw = dce110_apply_ctx_to_hw, 2555 .apply_ctx_to_hw = dce110_apply_ctx_to_hw,
2514 .apply_ctx_for_surface = dce110_apply_ctx_for_surface, 2556 .apply_ctx_for_surface = dce110_apply_ctx_for_surface,
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
index 447f6bf4644c..107f82df3053 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
@@ -1899,6 +1899,7 @@ static void set_plane_config(
1899} 1899}
1900 1900
1901static const struct hw_sequencer_funcs dcn10_funcs = { 1901static const struct hw_sequencer_funcs dcn10_funcs = {
1902 .program_gamut_remap = program_gamut_remap,
1902 .init_hw = init_hw, 1903 .init_hw = init_hw,
1903 .apply_ctx_to_hw = dce110_apply_ctx_to_hw, 1904 .apply_ctx_to_hw = dce110_apply_ctx_to_hw,
1904 .apply_ctx_for_surface = dcn10_apply_ctx_for_surface, 1905 .apply_ctx_for_surface = dcn10_apply_ctx_for_surface,
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h b/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h
index b53e1206dfb3..6f8733ec9b16 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h
@@ -67,6 +67,9 @@ struct hw_sequencer_funcs {
67 struct pipe_ctx *pipe_ctx, 67 struct pipe_ctx *pipe_ctx,
68 struct resource_context *res_ctx); 68 struct resource_context *res_ctx);
69 69
70 void (*program_gamut_remap)(
71 struct pipe_ctx *pipe_ctx);
72
70 void (*update_plane_addr)( 73 void (*update_plane_addr)(
71 const struct core_dc *dc, 74 const struct core_dc *dc,
72 struct pipe_ctx *pipe_ctx); 75 struct pipe_ctx *pipe_ctx);