From mboxrd@z Thu Jan 1 00:00:00 1970
From: bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ@public.gmane.org
Subject: [Bug 89969] vaDriverInit fails with gallium/nouveau driver
Date: Fri, 17 Jul 2015 23:08:26 +0000
Message-ID:
Created attachment 117214 [details] [review]
WIP - nouveau: add support for chunk decoding
A: resize buffer in nvc0_decoder_bsp:
http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/nouveau/nvc0/nvc0_video_bsp.c#n73
B: memcpy of the data in nouveau_vp3_bsp:
http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/nouveau/nouveau_vp3_video_bsp.c#n294
For radeon driver it both happens in ruvd_decode_bitstream.
To compare radeon to nouveau:
struct ruvd_decoder.bs_buffers is an array of struct rvid_buffer that hold a
ref on struct r600_resource, aka pipe_resource.
struct nouveau_vp3_decoder.bsp_bo is an array of struct nouveau_bo (which comes
from libdrm/nouveau library)
So if I am right, in the function nvc0_decoder_decode_bitstream it should
resize the nouveau_bo buffers and store current data, i.e. A and B.
So I made a patch that first splits nvc0_decoder_bsp to extract A and B into a
new function nvc0_decoder_bsp_next_chunk. The remaining part of
nvc0_decoder_bsp go to nvc0_decoder_bsp_end_frame.
I just realize the patch is missing the preserving part while resizing buffers
(equivalent of the memcpy in rvid_resize_buffer
http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/radeon/radeon_video.c#n100)
that could explain why it is still not working.
But I wanted to know if I am on the right track or not ?