<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 17 December 2015 at 04:16, Ilia Mirkin <span dir="ltr"><<a href="mailto:imirkin@alum.mit.edu" target="_blank">imirkin@alum.mit.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is there any guarantee that bsp_next is called a number of times equal<br>
to the number of slices? Seems like it's just for appending on more<br>
data, which may or may not be equal to the number of slices... Why is<br>
the value in the descriptor wrong?<br></blockquote><div><br></div><div>You are entirely right, it is actually a problem in st/va which does not set slice_count at all. It should use num_elements from the slice param. So I'll drop this patch and submit another one because it will look completely different.<br><br></div><div>Thx for the reviews !<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div><br>
On Wed, Dec 16, 2015 at 9:40 AM, Julien Isorce <<a href="mailto:j.isorce@samsung.com" target="_blank">j.isorce@samsung.com</a>> wrote:<br>
> <a href="https://bugs.freedesktop.org/show_bug.cgi?id=89969" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=89969</a><br>
><br>
> Signed-off-by: Julien Isorce <<a href="mailto:j.isorce@samsung.com" target="_blank">j.isorce@samsung.com</a>><br>
> ---<br>
> src/gallium/drivers/nouveau/nouveau_vp3_video.h | 3 +++<br>
> src/gallium/drivers/nouveau/nouveau_vp3_video_bsp.c | 17 +++++++++++++++--<br>
> 2 files changed, 18 insertions(+), 2 deletions(-)<br>
><br>
> diff --git a/src/gallium/drivers/nouveau/nouveau_vp3_video.h b/src/gallium/drivers/nouveau/nouveau_vp3_video.h<br>
> index 1e10693..a826532 100644<br>
> --- a/src/gallium/drivers/nouveau/nouveau_vp3_video.h<br>
> +++ b/src/gallium/drivers/nouveau/nouveau_vp3_video.h<br>
> @@ -121,6 +121,9 @@ struct nouveau_vp3_decoder {<br>
><br>
> /* Total data appended so far after last begin frame. */<br>
> unsigned bsp_size;<br>
> +<br>
> + /* Number of slices so far since last begin frame */<br>
> + unsigned int nb_slices;<br>
> };<br>
><br>
> struct comm {<br>
> diff --git a/src/gallium/drivers/nouveau/nouveau_vp3_video_bsp.c b/src/gallium/drivers/nouveau/nouveau_vp3_video_bsp.c<br>
> index aab8e25..7a1dc8c 100644<br>
> --- a/src/gallium/drivers/nouveau/nouveau_vp3_video_bsp.c<br>
> +++ b/src/gallium/drivers/nouveau/nouveau_vp3_video_bsp.c<br>
> @@ -128,6 +128,8 @@ nouveau_vp3_fill_picparm_mpeg12_bsp(struct nouveau_vp3_decoder *dec,<br>
> for (i = 0; i < 4; ++i)<br>
> pic_bsp->f_code[i/2][i%2] = desc->f_code[i/2][i%2] + 1; // FU<br>
><br>
> + desc->num_slices = dec->nb_slices;<br>
> +<br>
> return (desc->num_slices << 4) | (dec->base.profile != PIPE_VIDEO_PROFILE_MPEG1);<br>
> }<br>
><br>
> @@ -162,7 +164,11 @@ nouveau_vp3_fill_picparm_vc1_bsp(struct nouveau_vp3_decoder *dec,<br>
> char *map)<br>
> {<br>
> struct vc1_picparm_bsp *vc = (struct vc1_picparm_bsp *)map;<br>
> - uint32_t caps = (d->slice_count << 4)&0xfff0;<br>
> + uint32_t caps = 0;<br>
> +<br>
> + d->slice_count = dec->nb_slices;<br>
> + caps = (d->slice_count << 4)&0xfff0;<br>
> +<br>
> vc->width = dec->base.width;<br>
> vc->height = dec->base.height;<br>
> vc->profile = dec->base.profile - PIPE_VIDEO_PROFILE_VC1_SIMPLE; // 04<br>
> @@ -194,9 +200,12 @@ nouveau_vp3_fill_picparm_h264_bsp(struct nouveau_vp3_decoder *dec,<br>
> char *map)<br>
> {<br>
> struct h264_picparm_bsp stub_h = {}, *h = &stub_h;<br>
> - uint32_t caps = (d->slice_count << 4)&0xfff0;<br>
> + uint32_t caps = 0;<br>
> +<br>
> + d->slice_count = dec->nb_slices;<br>
><br>
> assert(!(d->slice_count & ~0xfff));<br>
> + caps = (d->slice_count << 4)&0xfff0;<br>
> if (d->slice_count & 0x1000)<br>
> caps |= 1 << 20;<br>
><br>
> @@ -239,6 +248,7 @@ nouveau_vp3_bsp_begin(struct nouveau_vp3_decoder *dec)<br>
><br>
> dec->bsp_ptr = bsp_bo->map;<br>
> dec->bsp_size = NOUVEAU_VP3_BSP_RESERVED_SIZE;<br>
> + dec->nb_slices = 0;<br>
><br>
> dec->bsp_ptr += 0x100;<br>
><br>
> @@ -266,6 +276,8 @@ nouveau_vp3_bsp_next(struct nouveau_vp3_decoder *dec, unsigned num_buffers,<br>
> struct strparm_bsp *str_bsp = NULL;<br>
> int i = 0;<br>
><br>
> + ++dec->nb_slices;<br>
> +<br>
> bsp_origin += 0x100;<br>
> str_bsp = (struct strparm_bsp *)bsp_origin;<br>
><br>
> @@ -331,6 +343,7 @@ nouveau_vp3_bsp_end(struct nouveau_vp3_decoder *dec, union pipe_desc desc)<br>
><br>
> dec->bsp_ptr = NULL;<br>
> dec->bsp_size = 0;<br>
> + dec->nb_slices = 0;<br>
><br>
> return caps;<br>
> }<br>
> --<br>
> 1.9.1<br>
><br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div></div>