aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd
diff options
context:
space:
mode:
authorDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>2017-06-02 19:01:37 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-09-26 18:07:53 -0400
commitba326a9185f1c56d86e51dd89589e4eff42f02eb (patch)
tree084a1c56ca8350de50673e29902bc733220df649 /drivers/gpu/drm/amd
parent1bf56e62cc4fbff6d701b798da05a91f78aa12e9 (diff)
drm/amd/display: propagate surface alpha setting from OS to DC
Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@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/drm/amd')
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc.c6
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc_debug.c6
-rw-r--r--drivers/gpu/drm/amd/display/dc/dc.h2
-rw-r--r--drivers/gpu/drm/amd/display/dc/dc_types.h2
-rw-r--r--drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c10
5 files changed, 16 insertions, 10 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 657e10bae93f..fb5bacb50ebc 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -998,6 +998,7 @@ bool dc_commit_surfaces_to_stream(
998 plane_info[i].stereo_format = new_surfaces[i]->stereo_format; 998 plane_info[i].stereo_format = new_surfaces[i]->stereo_format;
999 plane_info[i].tiling_info = new_surfaces[i]->tiling_info; 999 plane_info[i].tiling_info = new_surfaces[i]->tiling_info;
1000 plane_info[i].visible = new_surfaces[i]->visible; 1000 plane_info[i].visible = new_surfaces[i]->visible;
1001 plane_info[i].per_pixel_alpha = new_surfaces[i]->per_pixel_alpha;
1001 plane_info[i].dcc = new_surfaces[i]->dcc; 1002 plane_info[i].dcc = new_surfaces[i]->dcc;
1002 scaling_info[i].scaling_quality = new_surfaces[i]->scaling_quality; 1003 scaling_info[i].scaling_quality = new_surfaces[i]->scaling_quality;
1003 scaling_info[i].src_rect = new_surfaces[i]->src_rect; 1004 scaling_info[i].src_rect = new_surfaces[i]->src_rect;
@@ -1068,7 +1069,7 @@ static enum surface_update_type get_plane_info_update_type(
1068 const struct dc_surface_update *u, 1069 const struct dc_surface_update *u,
1069 int surface_index) 1070 int surface_index)
1070{ 1071{
1071 struct dc_plane_info temp_plane_info = { { { { 0 } } } }; 1072 struct dc_plane_info temp_plane_info = { 0 };
1072 1073
1073 if (!u->plane_info) 1074 if (!u->plane_info)
1074 return UPDATE_TYPE_FAST; 1075 return UPDATE_TYPE_FAST;
@@ -1091,6 +1092,7 @@ static enum surface_update_type get_plane_info_update_type(
1091 1092
1092 /* Special Validation parameters */ 1093 /* Special Validation parameters */
1093 temp_plane_info.format = u->plane_info->format; 1094 temp_plane_info.format = u->plane_info->format;
1095 temp_plane_info.per_pixel_alpha = u->plane_info->per_pixel_alpha;
1094 1096
1095 if (surface_index == 0) 1097 if (surface_index == 0)
1096 temp_plane_info.visible = u->plane_info->visible; 1098 temp_plane_info.visible = u->plane_info->visible;
@@ -1327,6 +1329,8 @@ void dc_update_surfaces_and_stream(struct dc *dc,
1327 srf_updates[i].plane_info->tiling_info; 1329 srf_updates[i].plane_info->tiling_info;
1328 surface->public.visible = 1330 surface->public.visible =
1329 srf_updates[i].plane_info->visible; 1331 srf_updates[i].plane_info->visible;
1332 surface->public.per_pixel_alpha =
1333 srf_updates[i].plane_info->per_pixel_alpha;
1330 surface->public.dcc = 1334 surface->public.dcc =
1331 srf_updates[i].plane_info->dcc; 1335 srf_updates[i].plane_info->dcc;
1332 } 1336 }
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_debug.c b/drivers/gpu/drm/amd/display/dc/core/dc_debug.c
index ee840e75ee1f..c60b59f41693 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_debug.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_debug.c
@@ -221,10 +221,12 @@ void update_surface_trace(
221 SURFACE_TRACE( 221 SURFACE_TRACE(
222 "plane_info->tiling_info.gfx8.pipe_config = %d;\n" 222 "plane_info->tiling_info.gfx8.pipe_config = %d;\n"
223 "plane_info->tiling_info.gfx8.array_mode = %d;\n" 223 "plane_info->tiling_info.gfx8.array_mode = %d;\n"
224 "plane_info->visible = %d;\n", 224 "plane_info->visible = %d;\n"
225 "plane_info->per_pixel_alpha = %d;\n",
225 update->plane_info->tiling_info.gfx8.pipe_config, 226 update->plane_info->tiling_info.gfx8.pipe_config,
226 update->plane_info->tiling_info.gfx8.array_mode, 227 update->plane_info->tiling_info.gfx8.array_mode,
227 update->plane_info->visible); 228 update->plane_info->visible,
229 update->plane_info->per_pixel_alpha);
228 230
229 SURFACE_TRACE("surface->tiling_info.gfx9.swizzle = %d;\n", 231 SURFACE_TRACE("surface->tiling_info.gfx9.swizzle = %d;\n",
230 update->plane_info->tiling_info.gfx9.swizzle); 232 update->plane_info->tiling_info.gfx9.swizzle);
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index a20ba01d9e7b..7191b2519334 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -290,6 +290,7 @@ struct dc_transfer_func {
290}; 290};
291 291
292struct dc_surface { 292struct dc_surface {
293 bool per_pixel_alpha;
293 bool visible; 294 bool visible;
294 bool flip_immediate; 295 bool flip_immediate;
295 struct dc_plane_address address; 296 struct dc_plane_address address;
@@ -316,6 +317,7 @@ struct dc_surface {
316}; 317};
317 318
318struct dc_plane_info { 319struct dc_plane_info {
320 bool per_pixel_alpha;
319 union plane_size plane_size; 321 union plane_size plane_size;
320 union dc_tiling_info tiling_info; 322 union dc_tiling_info tiling_info;
321 struct dc_plane_dcc_param dcc; 323 struct dc_plane_dcc_param dcc;
diff --git a/drivers/gpu/drm/amd/display/dc/dc_types.h b/drivers/gpu/drm/amd/display/dc/dc_types.h
index 06354c36c499..5269796b2a8e 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_types.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_types.h
@@ -97,7 +97,7 @@ struct dc_context {
97 97
98#define MAX_EDID_BUFFER_SIZE 512 98#define MAX_EDID_BUFFER_SIZE 512
99#define EDID_BLOCK_SIZE 128 99#define EDID_BLOCK_SIZE 128
100#define MAX_SURFACE_NUM 2 100#define MAX_SURFACE_NUM 4
101#define NUM_PIXEL_FORMATS 10 101#define NUM_PIXEL_FORMATS 10
102 102
103#include "dc_ddc_types.h" 103#include "dc_ddc_types.h"
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 107f82df3053..0a346aafacce 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
@@ -1559,7 +1559,9 @@ static void update_dchubp_dpp(
1559 struct pipe_ctx *temp_pipe; 1559 struct pipe_ctx *temp_pipe;
1560 int i; 1560 int i;
1561 int tree_pos = 0; 1561 int tree_pos = 0;
1562 bool per_pixel_alpha = surface->public.per_pixel_alpha && pipe_ctx->bottom_pipe;
1562 1563
1564 /* TODO: proper fix once fpga works */
1563 /* depends on DML calculation, DPP clock value may change dynamically */ 1565 /* depends on DML calculation, DPP clock value may change dynamically */
1564 enable_dppclk( 1566 enable_dppclk(
1565 dc->ctx, 1567 dc->ctx,
@@ -1604,11 +1606,7 @@ static void update_dchubp_dpp(
1604 /* TODO: build stream pipes group id. For now, use stream otg 1606 /* TODO: build stream pipes group id. For now, use stream otg
1605 * id as pipe group id 1607 * id as pipe group id
1606 */ 1608 */
1607 /*pipe_ctx->scl_data.lb_params.alpha_en = pipe_ctx->surface->public.per_pixel_alpha;*/ 1609 pipe_ctx->scl_data.lb_params.alpha_en = per_pixel_alpha;
1608 if (pipe_ctx->bottom_pipe && surface != pipe_ctx->bottom_pipe->surface)
1609 pipe_ctx->scl_data.lb_params.alpha_en = 1;
1610 else
1611 pipe_ctx->scl_data.lb_params.alpha_en = 0;
1612 pipe_ctx->mpc_idx = pipe_ctx->tg->inst; 1610 pipe_ctx->mpc_idx = pipe_ctx->tg->inst;
1613 tree_cfg = &context->res_ctx.mpc_tree[pipe_ctx->mpc_idx]; 1611 tree_cfg = &context->res_ctx.mpc_tree[pipe_ctx->mpc_idx];
1614 if (tree_cfg->num_pipes == 0) { 1612 if (tree_cfg->num_pipes == 0) {
@@ -1625,7 +1623,7 @@ static void update_dchubp_dpp(
1625 1623
1626 tree_cfg->dpp[tree_pos] = pipe_ctx->pipe_idx; 1624 tree_cfg->dpp[tree_pos] = pipe_ctx->pipe_idx;
1627 tree_cfg->mpcc[tree_pos] = pipe_ctx->pipe_idx; 1625 tree_cfg->mpcc[tree_pos] = pipe_ctx->pipe_idx;
1628 tree_cfg->per_pixel_alpha[tree_pos] = pipe_ctx->scl_data.lb_params.alpha_en; 1626 tree_cfg->per_pixel_alpha[tree_pos] = per_pixel_alpha;
1629 tree_cfg->num_pipes = tree_pos + 1; 1627 tree_cfg->num_pipes = tree_pos + 1;
1630 dcn10_set_mpc_tree(mpc, tree_cfg); 1628 dcn10_set_mpc_tree(mpc, tree_cfg);
1631 1629