@@ -4243,6 +4243,90 @@ static void update_seamless_boot_flags(struct dc *dc,
4243
4243
}
4244
4244
}
4245
4245
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
+
4246
4330
bool dc_update_planes_and_stream (struct dc * dc ,
4247
4331
struct dc_surface_update * srf_updates , int surface_count ,
4248
4332
struct dc_stream_state * stream ,
@@ -4252,6 +4336,7 @@ bool dc_update_planes_and_stream(struct dc *dc,
4252
4336
enum surface_update_type update_type ;
4253
4337
int i ;
4254
4338
struct mall_temp_config mall_temp_config ;
4339
+ struct dc_fast_update fast_update = {0 };
4255
4340
4256
4341
/* In cases where MPO and split or ODM are used transitions can
4257
4342
* cause underflow. Apply stream configuration with minimal pipe
@@ -4260,6 +4345,7 @@ bool dc_update_planes_and_stream(struct dc *dc,
4260
4345
bool force_minimal_pipe_splitting ;
4261
4346
bool is_plane_addition ;
4262
4347
4348
+ populate_fast_updates (& fast_update , srf_updates , stream_update );
4263
4349
force_minimal_pipe_splitting = could_mpcc_tree_change_for_active_pipes (
4264
4350
dc ,
4265
4351
stream ,
@@ -4310,7 +4396,8 @@ bool dc_update_planes_and_stream(struct dc *dc,
4310
4396
}
4311
4397
4312
4398
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 ) {
4314
4401
commit_planes_for_stream_fast (dc ,
4315
4402
srf_updates ,
4316
4403
surface_count ,
@@ -4367,7 +4454,9 @@ void dc_commit_updates_for_stream(struct dc *dc,
4367
4454
struct dc_state * context ;
4368
4455
struct dc_context * dc_ctx = dc -> ctx ;
4369
4456
int i , j ;
4457
+ struct dc_fast_update fast_update = {0 };
4370
4458
4459
+ populate_fast_updates (& fast_update , srf_updates , stream_update );
4371
4460
stream_status = dc_stream_get_status (stream );
4372
4461
context = dc -> current_state ;
4373
4462
@@ -4453,7 +4542,8 @@ void dc_commit_updates_for_stream(struct dc *dc,
4453
4542
TRACE_DC_PIPE_STATE (pipe_ctx , i , MAX_PIPES );
4454
4543
4455
4544
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 ) {
4457
4547
commit_planes_for_stream_fast (dc ,
4458
4548
srf_updates ,
4459
4549
surface_count ,
0 commit comments