[Mesa-dev] [PATCH v3 3/4] nouveau: fix chunk decoding by updating number of slices
Julien Isorce
j.isorce at samsung.com
Mon Sep 7 05:15:05 PDT 2015
https://bugs.freedesktop.org/show_bug.cgi?id=89969
Signed-off-by: Julien Isorce <j.isorce at samsung.com>
---
src/gallium/drivers/nouveau/nouveau_vp3_video.h | 3 +++
src/gallium/drivers/nouveau/nouveau_vp3_video_bsp.c | 8 ++++++++
2 files changed, 11 insertions(+)
diff --git a/src/gallium/drivers/nouveau/nouveau_vp3_video.h b/src/gallium/drivers/nouveau/nouveau_vp3_video.h
index 43b9556..87ae012 100644
--- a/src/gallium/drivers/nouveau/nouveau_vp3_video.h
+++ b/src/gallium/drivers/nouveau/nouveau_vp3_video.h
@@ -121,6 +121,9 @@ struct nouveau_vp3_decoder {
/* Total data appended so far after last begin frame. */
unsigned bsp_size;
+
+ /* Number of slices so far since last begin frame */
+ unsigned int nb_slices;
};
struct comm {
diff --git a/src/gallium/drivers/nouveau/nouveau_vp3_video_bsp.c b/src/gallium/drivers/nouveau/nouveau_vp3_video_bsp.c
index c1d70ea..7776e4e 100644
--- a/src/gallium/drivers/nouveau/nouveau_vp3_video_bsp.c
+++ b/src/gallium/drivers/nouveau/nouveau_vp3_video_bsp.c
@@ -128,6 +128,8 @@ nouveau_vp3_fill_picparm_mpeg12_bsp(struct nouveau_vp3_decoder *dec,
for (i = 0; i < 4; ++i)
pic_bsp->f_code[i/2][i%2] = desc->f_code[i/2][i%2] + 1; // FU
+ desc->num_slices = dec->nb_slices;
+
return (desc->num_slices << 4) | (dec->base.profile != PIPE_VIDEO_PROFILE_MPEG1);
}
@@ -196,6 +198,8 @@ nouveau_vp3_fill_picparm_h264_bsp(struct nouveau_vp3_decoder *dec,
struct h264_picparm_bsp stub_h = {}, *h = &stub_h;
uint32_t caps = (d->slice_count << 4)&0xfff0;
+ d->slice_count = dec->nb_slices;
+
assert(!(d->slice_count & ~0xfff));
if (d->slice_count & 0x1000)
caps |= 1 << 20;
@@ -239,6 +243,7 @@ nouveau_vp3_bsp_begin(struct nouveau_vp3_decoder *dec)
dec->bsp_ptr = bsp_bo->map;
dec->bsp_size = NOUVEAU_VP3_BSP_RESERVED_SIZE;
+ dec->nb_slices = 0;
dec->bsp_ptr += 0x100;
@@ -266,6 +271,8 @@ nouveau_vp3_bsp_next(struct nouveau_vp3_decoder *dec, unsigned num_buffers,
struct strparm_bsp *str_bsp = NULL;
int i = 0;
+ ++dec->nb_slices;
+
bsp_origin += 0x100;
str_bsp = (struct strparm_bsp *)bsp_origin;
@@ -331,6 +338,7 @@ nouveau_vp3_bsp_end(struct nouveau_vp3_decoder *dec, union pipe_desc desc)
dec->bsp_ptr = NULL;
dec->bsp_size = 0;
+ dec->nb_slices = 0;
return caps;
}
--
1.9.1
More information about the mesa-dev
mailing list