@@ -4245,48 +4245,64 @@ static void update_seamless_boot_flags(struct dc *dc,
4245
4245
4246
4246
static void populate_fast_updates (struct dc_fast_update * fast_update ,
4247
4247
struct dc_surface_update * srf_updates ,
4248
+ int surface_count ,
4248
4249
struct dc_stream_update * stream_update )
4249
4250
{
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
- }
4251
+ int i = 0 ;
4252
+
4257
4253
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 ;
4254
+ fast_update [0 ].out_transfer_func = stream_update -> out_transfer_func ;
4255
+ fast_update [0 ].output_csc_transform = stream_update -> output_csc_transform ;
4256
+ }
4257
+
4258
+ for (i = 0 ; i < surface_count ; i ++ ) {
4259
+ fast_update [i ].flip_addr = srf_updates [i ].flip_addr ;
4260
+ fast_update [i ].gamma = srf_updates [i ].gamma ;
4261
+ fast_update [i ].gamut_remap_matrix = srf_updates [i ].gamut_remap_matrix ;
4262
+ fast_update [i ].input_csc_color_matrix = srf_updates [i ].input_csc_color_matrix ;
4263
+ fast_update [i ].coeff_reduction_factor = srf_updates [i ].coeff_reduction_factor ;
4260
4264
}
4261
4265
}
4262
4266
4263
- static bool fast_updates_exist (struct dc_fast_update * fast_update )
4267
+ static bool fast_updates_exist (struct dc_fast_update * fast_update , int surface_count )
4264
4268
{
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 )
4269
+ int i ;
4270
+
4271
+ if (fast_update [0 ].out_transfer_func ||
4272
+ fast_update [0 ].output_csc_transform )
4272
4273
return true;
4273
4274
4275
+ for (i = 0 ; i < surface_count ; i ++ ) {
4276
+ if (fast_update [i ].flip_addr ||
4277
+ fast_update [i ].gamma ||
4278
+ fast_update [i ].gamut_remap_matrix ||
4279
+ fast_update [i ].input_csc_color_matrix ||
4280
+ fast_update [i ].coeff_reduction_factor )
4281
+ return true;
4282
+ }
4283
+
4274
4284
return false;
4275
4285
}
4276
4286
4277
4287
static bool full_update_required (struct dc_surface_update * srf_updates ,
4288
+ int surface_count ,
4278
4289
struct dc_stream_update * stream_update )
4279
4290
{
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;
4291
+
4292
+ int i ;
4293
+
4294
+ for (i = 0 ; i < surface_count ; i ++ ) {
4295
+ if (srf_updates &&
4296
+ (srf_updates [i ].plane_info ||
4297
+ srf_updates [i ].scaling_info ||
4298
+ (srf_updates [i ].hdr_mult .value &&
4299
+ srf_updates [i ].hdr_mult .value != srf_updates -> surface -> hdr_mult .value ) ||
4300
+ srf_updates [i ].in_transfer_func ||
4301
+ srf_updates [i ].func_shaper ||
4302
+ srf_updates [i ].lut3d_func ||
4303
+ srf_updates [i ].blend_tf ))
4304
+ return true;
4305
+ }
4290
4306
4291
4307
if (stream_update &&
4292
4308
(((stream_update -> src .height != 0 && stream_update -> src .width != 0 ) ||
@@ -4322,9 +4338,11 @@ static bool full_update_required(struct dc_surface_update *srf_updates,
4322
4338
4323
4339
static bool fast_update_only (struct dc_fast_update * fast_update ,
4324
4340
struct dc_surface_update * srf_updates ,
4341
+ int surface_count ,
4325
4342
struct dc_stream_update * stream_update )
4326
4343
{
4327
- return fast_updates_exist (fast_update ) && !full_update_required (srf_updates , stream_update );
4344
+ return fast_updates_exist (fast_update , surface_count )
4345
+ && !full_update_required (srf_updates , surface_count , stream_update );
4328
4346
}
4329
4347
4330
4348
bool dc_update_planes_and_stream (struct dc * dc ,
@@ -4336,7 +4354,7 @@ bool dc_update_planes_and_stream(struct dc *dc,
4336
4354
enum surface_update_type update_type ;
4337
4355
int i ;
4338
4356
struct mall_temp_config mall_temp_config ;
4339
- struct dc_fast_update fast_update = {0 };
4357
+ struct dc_fast_update fast_update [ MAX_SURFACES ] = {0 };
4340
4358
4341
4359
/* In cases where MPO and split or ODM are used transitions can
4342
4360
* cause underflow. Apply stream configuration with minimal pipe
@@ -4345,7 +4363,7 @@ bool dc_update_planes_and_stream(struct dc *dc,
4345
4363
bool force_minimal_pipe_splitting ;
4346
4364
bool is_plane_addition ;
4347
4365
4348
- populate_fast_updates (& fast_update , srf_updates , stream_update );
4366
+ populate_fast_updates (fast_update , srf_updates , surface_count , stream_update );
4349
4367
force_minimal_pipe_splitting = could_mpcc_tree_change_for_active_pipes (
4350
4368
dc ,
4351
4369
stream ,
@@ -4396,7 +4414,7 @@ bool dc_update_planes_and_stream(struct dc *dc,
4396
4414
}
4397
4415
4398
4416
update_seamless_boot_flags (dc , context , surface_count , stream );
4399
- if (fast_update_only (& fast_update , srf_updates , stream_update ) &&
4417
+ if (fast_update_only (fast_update , srf_updates , surface_count , stream_update ) &&
4400
4418
!dc -> debug .enable_legacy_fast_update ) {
4401
4419
commit_planes_for_stream_fast (dc ,
4402
4420
srf_updates ,
@@ -4454,9 +4472,9 @@ void dc_commit_updates_for_stream(struct dc *dc,
4454
4472
struct dc_state * context ;
4455
4473
struct dc_context * dc_ctx = dc -> ctx ;
4456
4474
int i , j ;
4457
- struct dc_fast_update fast_update = {0 };
4475
+ struct dc_fast_update fast_update [ MAX_SURFACES ] = {0 };
4458
4476
4459
- populate_fast_updates (& fast_update , srf_updates , stream_update );
4477
+ populate_fast_updates (fast_update , srf_updates , surface_count , stream_update );
4460
4478
stream_status = dc_stream_get_status (stream );
4461
4479
context = dc -> current_state ;
4462
4480
@@ -4542,7 +4560,7 @@ void dc_commit_updates_for_stream(struct dc *dc,
4542
4560
TRACE_DC_PIPE_STATE (pipe_ctx , i , MAX_PIPES );
4543
4561
4544
4562
update_seamless_boot_flags (dc , context , surface_count , stream );
4545
- if (fast_update_only (& fast_update , srf_updates , stream_update ) &&
4563
+ if (fast_update_only (fast_update , srf_updates , surface_count , stream_update ) &&
4546
4564
!dc -> debug .enable_legacy_fast_update ) {
4547
4565
commit_planes_for_stream_fast (dc ,
4548
4566
srf_updates ,
0 commit comments