radeon/vce: use nblk_y instead of npix_y
authorMarek Olšák <marek.olsak@amd.com>
Sun, 23 Oct 2016 18:11:17 +0000 (20:11 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 26 Oct 2016 11:02:58 +0000 (13:02 +0200)
npix_y will be removed. level[0].npix_y will be removed too. nblk_y should
be the same as npix_y if the block height == 1. However, nblk_y is aligned
to the tile size, so it can be greater than npix_y.

If that's a problem, we'll have to save the input height of surface_init
and use that.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeon/radeon_vce.c
src/gallium/drivers/radeon/radeon_vce_40_2_2.c
src/gallium/drivers/radeon/radeon_vce_50.c
src/gallium/drivers/radeon/radeon_vce_52.c

index ef93e46c195a9066585e6eb1958eafb11f66da23..7e7bf2a6d565a7945c27a4070c1fa219d8176bbb 100644 (file)
@@ -224,7 +224,7 @@ void rvce_frame_offset(struct rvce_encoder *enc, struct rvce_cpb_slot *slot,
                       signed *luma_offset, signed *chroma_offset)
 {
        unsigned pitch = align(enc->luma->level[0].pitch_bytes, 128);
-       unsigned vpitch = align(enc->luma->npix_y, 16);
+       unsigned vpitch = align(enc->luma->level[0].nblk_y, 16);
        unsigned fsize = pitch * (vpitch + vpitch / 2);
 
        *luma_offset = slot->index * fsize;
@@ -455,7 +455,7 @@ struct pipe_video_codec *rvce_create_encoder(struct pipe_context *context,
 
        get_buffer(((struct vl_video_buffer *)tmp_buf)->resources[0], NULL, &tmp_surf);
        cpb_size = align(tmp_surf->level[0].pitch_bytes, 128);
-       cpb_size = cpb_size * align(tmp_surf->npix_y, 32);
+       cpb_size = cpb_size * align(tmp_surf->level[0].nblk_y, 32);
        cpb_size = cpb_size * 3 / 2;
        cpb_size = cpb_size * enc->cpb_num;
        if (enc->dual_pipe)
index fe15ded3972d40f9c3551448c9db5b5fddc1daa6..f19406387603b447dec41c8a7387efcbfe81095a 100644 (file)
@@ -96,7 +96,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(0x00000000); // encRefPic(Addr|Array)Mode, encPicStructRestriction, disableRDO
        RVCE_END();
 }
@@ -323,7 +323,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
        RVCE_CS(0x00000000); // encInputPic(Addr|Array)Mode
index 262e13ba987a04cbcd02ae3ce1a4afe7ad019f65..a2877f809b23ed5558747908a319340e59a16606 100644 (file)
@@ -130,7 +130,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)
index 5db01fe5240bf3e9aa75222d8a4f342b22d482d6..0922f13bf3678b5d3150d7981f332debee82619b 100644 (file)
@@ -179,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);
@@ -243,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)