Skip to content

Commit 1a3148b

Browse files
Alvin Leealexdeucher
authored andcommitted
drm/amd/display: Limit new fast update path to addr and gamma / color
[Description] - We want to limit the new fast update path to address and gamma updates only. - Add a check in dc_update_planes_and_stream to only take the new fast update path if we only have the specific fast updates defined. Tested-by: Daniel Wheeler <[email protected]> Reviewed-by: Jun Lei <[email protected]> Acked-by: Rodrigo Siqueira <[email protected]> Signed-off-by: Alvin Lee <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 27fc10d commit 1a3148b

File tree

2 files changed

+102
-2
lines changed
  • drivers/gpu/drm/amd/display/dc

2 files changed

+102
-2
lines changed

drivers/gpu/drm/amd/display/dc/core/dc.c

Lines changed: 92 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4243,6 +4243,90 @@ static void update_seamless_boot_flags(struct dc *dc,
42434243
}
42444244
}
42454245

4246+
static void populate_fast_updates(struct dc_fast_update *fast_update,
4247+
struct dc_surface_update *srf_updates,
4248+
struct dc_stream_update *stream_update)
4249+
{
4250+
if (srf_updates) {
4251+
fast_update->flip_addr = srf_updates->flip_addr;
4252+
fast_update->gamma = srf_updates->gamma;
4253+
fast_update->gamut_remap_matrix = srf_updates->gamut_remap_matrix;
4254+
fast_update->input_csc_color_matrix = srf_updates->input_csc_color_matrix;
4255+
fast_update->coeff_reduction_factor = srf_updates->coeff_reduction_factor;
4256+
}
4257+
if (stream_update) {
4258+
fast_update->out_transfer_func = stream_update->out_transfer_func;
4259+
fast_update->output_csc_transform = stream_update->output_csc_transform;
4260+
}
4261+
}
4262+
4263+
static bool fast_updates_exist(struct dc_fast_update *fast_update)
4264+
{
4265+
if (fast_update->flip_addr ||
4266+
fast_update->gamma ||
4267+
fast_update->gamut_remap_matrix ||
4268+
fast_update->input_csc_color_matrix ||
4269+
fast_update->coeff_reduction_factor ||
4270+
fast_update->out_transfer_func ||
4271+
fast_update->output_csc_transform)
4272+
return true;
4273+
4274+
return false;
4275+
}
4276+
4277+
static bool full_update_required(struct dc_surface_update *srf_updates,
4278+
struct dc_stream_update *stream_update)
4279+
{
4280+
if (srf_updates &&
4281+
(srf_updates->plane_info ||
4282+
srf_updates->scaling_info ||
4283+
(srf_updates->hdr_mult.value &&
4284+
srf_updates->hdr_mult.value != srf_updates->surface->hdr_mult.value) ||
4285+
srf_updates->in_transfer_func ||
4286+
srf_updates->func_shaper ||
4287+
srf_updates->lut3d_func ||
4288+
srf_updates->blend_tf))
4289+
return true;
4290+
4291+
if (stream_update &&
4292+
(((stream_update->src.height != 0 && stream_update->src.width != 0) ||
4293+
(stream_update->dst.height != 0 && stream_update->dst.width != 0) ||
4294+
stream_update->integer_scaling_update) ||
4295+
stream_update->hdr_static_metadata ||
4296+
stream_update->abm_level ||
4297+
stream_update->periodic_interrupt ||
4298+
stream_update->vrr_infopacket ||
4299+
stream_update->vsc_infopacket ||
4300+
stream_update->vsp_infopacket ||
4301+
stream_update->hfvsif_infopacket ||
4302+
stream_update->vtem_infopacket ||
4303+
stream_update->adaptive_sync_infopacket ||
4304+
stream_update->dpms_off ||
4305+
stream_update->allow_freesync ||
4306+
stream_update->vrr_active_variable ||
4307+
stream_update->vrr_active_fixed ||
4308+
stream_update->gamut_remap ||
4309+
stream_update->output_color_space ||
4310+
stream_update->dither_option ||
4311+
stream_update->wb_update ||
4312+
stream_update->dsc_config ||
4313+
stream_update->mst_bw_update ||
4314+
stream_update->func_shaper ||
4315+
stream_update->lut3d_func ||
4316+
stream_update->pending_test_pattern ||
4317+
stream_update->crtc_timing_adjust))
4318+
return true;
4319+
4320+
return false;
4321+
}
4322+
4323+
static bool fast_update_only(struct dc_fast_update *fast_update,
4324+
struct dc_surface_update *srf_updates,
4325+
struct dc_stream_update *stream_update)
4326+
{
4327+
return fast_updates_exist(fast_update) && !full_update_required(srf_updates, stream_update);
4328+
}
4329+
42464330
bool dc_update_planes_and_stream(struct dc *dc,
42474331
struct dc_surface_update *srf_updates, int surface_count,
42484332
struct dc_stream_state *stream,
@@ -4252,6 +4336,7 @@ bool dc_update_planes_and_stream(struct dc *dc,
42524336
enum surface_update_type update_type;
42534337
int i;
42544338
struct mall_temp_config mall_temp_config;
4339+
struct dc_fast_update fast_update = {0};
42554340

42564341
/* In cases where MPO and split or ODM are used transitions can
42574342
* cause underflow. Apply stream configuration with minimal pipe
@@ -4260,6 +4345,7 @@ bool dc_update_planes_and_stream(struct dc *dc,
42604345
bool force_minimal_pipe_splitting;
42614346
bool is_plane_addition;
42624347

4348+
populate_fast_updates(&fast_update, srf_updates, stream_update);
42634349
force_minimal_pipe_splitting = could_mpcc_tree_change_for_active_pipes(
42644350
dc,
42654351
stream,
@@ -4310,7 +4396,8 @@ bool dc_update_planes_and_stream(struct dc *dc,
43104396
}
43114397

43124398
update_seamless_boot_flags(dc, context, surface_count, stream);
4313-
if (!dc->debug.enable_legacy_fast_update && update_type == UPDATE_TYPE_FAST) {
4399+
if (fast_update_only(&fast_update, srf_updates, stream_update) &&
4400+
!dc->debug.enable_legacy_fast_update) {
43144401
commit_planes_for_stream_fast(dc,
43154402
srf_updates,
43164403
surface_count,
@@ -4367,7 +4454,9 @@ void dc_commit_updates_for_stream(struct dc *dc,
43674454
struct dc_state *context;
43684455
struct dc_context *dc_ctx = dc->ctx;
43694456
int i, j;
4457+
struct dc_fast_update fast_update = {0};
43704458

4459+
populate_fast_updates(&fast_update, srf_updates, stream_update);
43714460
stream_status = dc_stream_get_status(stream);
43724461
context = dc->current_state;
43734462

@@ -4453,7 +4542,8 @@ void dc_commit_updates_for_stream(struct dc *dc,
44534542
TRACE_DC_PIPE_STATE(pipe_ctx, i, MAX_PIPES);
44544543

44554544
update_seamless_boot_flags(dc, context, surface_count, stream);
4456-
if (!dc->debug.enable_legacy_fast_update && update_type == UPDATE_TYPE_FAST) {
4545+
if (fast_update_only(&fast_update, srf_updates, stream_update) &&
4546+
!dc->debug.enable_legacy_fast_update) {
44574547
commit_planes_for_stream_fast(dc,
44584548
srf_updates,
44594549
surface_count,

drivers/gpu/drm/amd/display/dc/dc.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,6 +1264,16 @@ struct dc_scaling_info {
12641264
struct scaling_taps scaling_quality;
12651265
};
12661266

1267+
struct dc_fast_update {
1268+
const struct dc_flip_addrs *flip_addr;
1269+
const struct dc_gamma *gamma;
1270+
const struct colorspace_transform *gamut_remap_matrix;
1271+
const struct dc_csc_transform *input_csc_color_matrix;
1272+
const struct fixed31_32 *coeff_reduction_factor;
1273+
struct dc_transfer_func *out_transfer_func;
1274+
struct dc_csc_transform *output_csc_transform;
1275+
};
1276+
12671277
struct dc_surface_update {
12681278
struct dc_plane_state *surface;
12691279

0 commit comments

Comments
 (0)