Revert "hasvk: Encode B pictures on gen7."

This reverts commit 81cf1c16db.

The B frame work was never verified beyond its own four tests: every attempt
to run the whole encode family since has aborted on a device loss.  The
bisect that seemed to clear it was worthless, because only the first run
after a reboot was on a healthy GPU and every later measurement was taken on
a ring that had already hung.

Going back to the last commit with a completed run behind it: 120 of 120
executed, 92 passing, none failing.  B pictures can come back once they can
be verified one change at a time, on a machine with no other GPU client to
lose.
This commit is contained in:
elwrcl committed 2026-08-21 18:06:06 +03:00
1 parent 81cf1c16db
commit 26405fe38c
5 files changed
+22 -51

No files matched your search

+11 -15
View File
@@ -192,9 +192,9 @@ genX(hasvk_mfc_emit_static_state)(struct anv_cmd_buffer *cmd_buffer,
avc_img.TrellisQuantizationChromaDisable = false;
avc_img.IntraMBConformanceMaxSize = 0xEE8;
avc_img.InterMBConformanceMaxSize = 0xBB8;
avc_img.NumberofReferenceFrames = refs->l0_count + refs->l1_count;
avc_img.NumberofActiveReferencePicturesfromL0 = refs->l0_count;
avc_img.NumberofActiveReferencePicturesfromL1 = refs->l1_count;
avc_img.NumberofReferenceFrames = is_p ? 1 : 0;
avc_img.NumberofActiveReferencePicturesfromL0 = is_p ? 1 : 0;
avc_img.NumberofActiveReferencePicturesfromL1 = 0;
avc_img.InitialQPValue = 0; /* per-slice QP comes from SLICE_STATE */
avc_img.PicOrderPresent = pps->flags.bottom_field_pic_order_in_frame_present_flag;
avc_img.DeltaPicOrderAlwaysZero = sps->flags.delta_pic_order_always_zero_flag;
@@ -304,12 +304,11 @@ genX(hasvk_mfc_emit_static_state)(struct anv_cmd_buffer *cmd_buffer,
anv_batch_emit(&cmd_buffer->batch, GENX(MFX_AVC_REF_IDX_STATE), ref_idx) {
ref_idx.ReferencePictureListSelect = list;
memset(ref_idx.ReferenceListEntry, 0x80, sizeof(ref_idx.ReferenceListEntry));
const uint8_t *slots = list == 0 ? refs->l0_slot : refs->l1_slot;
unsigned count = list == 0 ? refs->l0_count : refs->l1_count;
if (is_p) {
unsigned n = MIN2(count, ARRAY_SIZE(ref_idx.ReferenceListEntry));
if (is_p && list == 0) {
unsigned n = MIN2(refs->l0_count,
ARRAY_SIZE(ref_idx.ReferenceListEntry));
for (unsigned i = 0; i < n; i++)
ref_idx.ReferenceListEntry[i] = 0x20 | (slots[i] << 1);
ref_idx.ReferenceListEntry[i] = 0x20 | (refs->l0_slot[i] << 1);
}
}
}
@@ -329,19 +328,16 @@ genX(hasvk_mfc_emit_slice)(struct anv_cmd_buffer *cmd_buffer,
uint32_t dst_page_offset,
const struct anv_video_intra_refresh *intra_refresh)
{
/* An I slice predicts from nothing; P and B slices both predict from L0,
* and a B slice additionally has L1 available. */
bool is_b = (slice_hdr->slice_type == STD_VIDEO_H264_SLICE_TYPE_B);
bool is_p = is_b || (slice_hdr->slice_type == STD_VIDEO_H264_SLICE_TYPE_P);
/* A P slice references the previous reconstructed frame; an I slice does
* not. B slices are out of scope. */
bool is_p = (slice_hdr->slice_type == STD_VIDEO_H264_SLICE_TYPE_P);
/* MFX_AVC_SLICE_STATE is not used by decode; fields are matched against the
* VA-API reference encoder (gen6_mfc_avc_slice_state). The slice covers the
* macroblock range [slice_start_mb, slice_end_mb) in raster order. */
anv_batch_emit(&cmd_buffer->batch, GENX(MFX_AVC_SLICE_STATE), slice) {
slice.SliceType = is_b ? BSlice :
is_p ? PSlice : ISlice; /* P=0,B=1,I=2 */
slice.SliceType = is_p ? PSlice : ISlice; /* P=0,B=1,I=2 */
slice.NumberofReferencePicturesinInterpredictionList0 = is_p ? 1 : 0;
slice.NumberofReferencePicturesinInterpredictionList1 = is_b ? 1 : 0;
slice.SliceQuantizationParameter = qp;
slice.CABACInitIDC = is_p ? slice_hdr->cabac_init_idc : 0;
slice.DisableDeblockingFilterIndicator = 1;