radeon/vce: use nblk_y instead of npix_y
[mesa.git] / src / gallium / drivers / radeon / radeon_vce_52.c
index 136f0801e4c561a08a4c9cc7d507c06d188a2d44..0922f13bf3678b5d3150d7981f332debee82619b 100644 (file)
@@ -158,13 +158,15 @@ void radeon_vce_52_get_param(struct rvce_encoder *enc, struct pipe_h264_enc_pict
        enc->enc_pic.ref_idx_l0 = pic->ref_idx_l0;
        enc->enc_pic.ref_idx_l1 = pic->ref_idx_l1;
        enc->enc_pic.not_referenced = pic->not_referenced;
-       enc->enc_pic.addrmode_arraymode_disrdo_distwoinstants = pic->ref_pic_mode;
+       if (enc->dual_inst)
+               enc->enc_pic.addrmode_arraymode_disrdo_distwoinstants = 0x00000201;
+       else
+               enc->enc_pic.addrmode_arraymode_disrdo_distwoinstants = 0x01000201;
        enc->enc_pic.is_idr = pic->is_idr;
 }
 
 static void create(struct rvce_encoder *enc)
 {
-       enc->enc_pic.addrmode_arraymode_disrdo_distwoinstants = 0x00000201;
        enc->task_info(enc, 0x00000000, 0, 0, 0);
 
        RVCE_BEGIN(0x01000001); // create cmd
@@ -177,7 +179,7 @@ static void create(struct rvce_encoder *enc)
        RVCE_CS(enc->base.height); // encImageHeight
        RVCE_CS(enc->luma->level[0].pitch_bytes); // encRefPicLumaPitch
        RVCE_CS(enc->chroma->level[0].pitch_bytes); // encRefPicChromaPitch
-       RVCE_CS(align(enc->luma->npix_y, 16) / 8); // encRefYHeightInQw
+       RVCE_CS(align(enc->luma->level[0].nblk_y, 16) / 8); // encRefYHeightInQw
        RVCE_CS(enc->enc_pic.addrmode_arraymode_disrdo_distwoinstants);
 
        RVCE_CS(enc->enc_pic.ec.enc_pre_encode_context_buffer_offset);
@@ -241,7 +243,7 @@ static void encode(struct rvce_encoder *enc)
                enc->luma->level[0].offset); // inputPictureLumaAddressHi/Lo
        RVCE_READ(enc->handle, RADEON_DOMAIN_VRAM,
                enc->chroma->level[0].offset); // inputPictureChromaAddressHi/Lo
-       RVCE_CS(align(enc->luma->npix_y, 16)); // encInputFrameYPitch
+       RVCE_CS(align(enc->luma->level[0].nblk_y, 16)); // encInputFrameYPitch
        RVCE_CS(enc->luma->level[0].pitch_bytes); // encInputPicLumaPitch
        RVCE_CS(enc->chroma->level[0].pitch_bytes); // encInputPicChromaPitch
        if (enc->dual_pipe)