This repository was archived by the owner on Jan 31, 2025. It is now read-only.
File tree 4 files changed +44
-0
lines changed
4 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -515,6 +515,8 @@ gen6_mfd_avc_slice_state(VADriverContextP ctx,
515
515
int first_mb_in_slice = 0 , first_mb_in_next_slice = 0 ;
516
516
unsigned int chroma_log2_weight_denom , luma_log2_weight_denom ;
517
517
int slice_type ;
518
+ int num_surfaces = 0 ;
519
+ int i ;
518
520
519
521
if (slice_param -> slice_type == SLICE_TYPE_I ||
520
522
slice_param -> slice_type == SLICE_TYPE_SI ) {
@@ -552,6 +554,15 @@ gen6_mfd_avc_slice_state(VADriverContextP ctx,
552
554
}
553
555
}
554
556
557
+ /* Don't bind a surface which doesn't exist, that crashes the GPU */
558
+ for (i = 0 ; i < ARRAY_ELEMS (gen6_mfd_context -> reference_surface ); i ++ )
559
+ if (gen6_mfd_context -> reference_surface [i ].surface_id != VA_INVALID_ID )
560
+ num_surfaces ++ ;
561
+ if (num_surfaces == 0 ) {
562
+ num_ref_idx_l0 = 0 ;
563
+ num_ref_idx_l1 = 0 ;
564
+ }
565
+
555
566
first_mb_in_slice = slice_param -> first_mb_in_slice ;
556
567
slice_hor_pos = first_mb_in_slice % width_in_mbs ;
557
568
slice_ver_pos = first_mb_in_slice / width_in_mbs ;
Original file line number Diff line number Diff line change @@ -837,6 +837,8 @@ gen75_mfd_avc_slice_state(VADriverContextP ctx,
837
837
pic_param -> seq_fields .bits .mb_adaptive_frame_field_flag );
838
838
int first_mb_in_slice = 0 , first_mb_in_next_slice = 0 ;
839
839
int slice_type ;
840
+ int num_surfaces = 0 ;
841
+ int i ;
840
842
841
843
if (slice_param -> slice_type == SLICE_TYPE_I ||
842
844
slice_param -> slice_type == SLICE_TYPE_SI ) {
@@ -863,6 +865,15 @@ gen75_mfd_avc_slice_state(VADriverContextP ctx,
863
865
num_ref_idx_l1 = slice_param -> num_ref_idx_l1_active_minus1 + 1 ;
864
866
}
865
867
868
+ /* Don't bind a surface which doesn't exist, that crashes the GPU */
869
+ for (i = 0 ; i < ARRAY_ELEMS (gen7_mfd_context -> reference_surface ); i ++ )
870
+ if (gen7_mfd_context -> reference_surface [i ].surface_id != VA_INVALID_ID )
871
+ num_surfaces ++ ;
872
+ if (num_surfaces == 0 ) {
873
+ num_ref_idx_l0 = 0 ;
874
+ num_ref_idx_l1 = 0 ;
875
+ }
876
+
866
877
first_mb_in_slice = slice_param -> first_mb_in_slice ;
867
878
slice_hor_pos = first_mb_in_slice % width_in_mbs ;
868
879
slice_ver_pos = first_mb_in_slice / width_in_mbs ;
Original file line number Diff line number Diff line change @@ -531,6 +531,8 @@ gen7_mfd_avc_slice_state(VADriverContextP ctx,
531
531
pic_param -> seq_fields .bits .mb_adaptive_frame_field_flag );
532
532
int first_mb_in_slice = 0 , first_mb_in_next_slice = 0 ;
533
533
int slice_type ;
534
+ int num_surfaces = 0 ;
535
+ int i ;
534
536
535
537
if (slice_param -> slice_type == SLICE_TYPE_I ||
536
538
slice_param -> slice_type == SLICE_TYPE_SI ) {
@@ -557,6 +559,15 @@ gen7_mfd_avc_slice_state(VADriverContextP ctx,
557
559
num_ref_idx_l1 = slice_param -> num_ref_idx_l1_active_minus1 + 1 ;
558
560
}
559
561
562
+ /* Don't bind a surface which doesn't exist, that crashes the GPU */
563
+ for (i = 0 ; i < ARRAY_ELEMS (gen7_mfd_context -> reference_surface ); i ++ )
564
+ if (gen7_mfd_context -> reference_surface [i ].surface_id != VA_INVALID_ID )
565
+ num_surfaces ++ ;
566
+ if (num_surfaces == 0 ) {
567
+ num_ref_idx_l0 = 0 ;
568
+ num_ref_idx_l1 = 0 ;
569
+ }
570
+
560
571
first_mb_in_slice = slice_param -> first_mb_in_slice ;
561
572
slice_hor_pos = first_mb_in_slice % width_in_mbs ;
562
573
slice_ver_pos = first_mb_in_slice / width_in_mbs ;
Original file line number Diff line number Diff line change @@ -614,6 +614,8 @@ gen8_mfd_avc_slice_state(VADriverContextP ctx,
614
614
pic_param -> seq_fields .bits .mb_adaptive_frame_field_flag );
615
615
int first_mb_in_slice = 0 , first_mb_in_next_slice = 0 ;
616
616
int slice_type ;
617
+ int num_surfaces = 0 ;
618
+ int i ;
617
619
618
620
if (slice_param -> slice_type == SLICE_TYPE_I ||
619
621
slice_param -> slice_type == SLICE_TYPE_SI ) {
@@ -640,6 +642,15 @@ gen8_mfd_avc_slice_state(VADriverContextP ctx,
640
642
num_ref_idx_l1 = slice_param -> num_ref_idx_l1_active_minus1 + 1 ;
641
643
}
642
644
645
+ /* Don't bind a surface which doesn't exist, that crashes the GPU */
646
+ for (i = 0 ; i < ARRAY_ELEMS (gen7_mfd_context -> reference_surface ); i ++ )
647
+ if (gen7_mfd_context -> reference_surface [i ].surface_id != VA_INVALID_ID )
648
+ num_surfaces ++ ;
649
+ if (num_surfaces == 0 ) {
650
+ num_ref_idx_l0 = 0 ;
651
+ num_ref_idx_l1 = 0 ;
652
+ }
653
+
643
654
first_mb_in_slice = slice_param -> first_mb_in_slice ;
644
655
slice_hor_pos = first_mb_in_slice % width_in_mbs ;
645
656
slice_ver_pos = first_mb_in_slice / width_in_mbs ;
You can’t perform that action at this time.
0 commit comments