[Mesa-dev] nouveau: xvmc on nv43

Pali Rohár pali.rohar at gmail.com
Fri Aug 16 07:54:05 PDT 2013


On Friday 16 August 2013 16:34:43 you wrote:
> On Fri, Aug 16, 2013 at 5:40 AM, Pali Rohár 
<pali.rohar at gmail.com> wrote:
> > Hello Ilia,
> > 
> > I was your last commit which fixing xvmc support for nv30 hw
> > in mesa git tree. Maybe you can help me. I have graphics
> > card nvidia geforce 6600 gt (nv43 chip) According to wiki
> > page http://nouveau.freedesktop.org/wiki/FeatureMatrix/
> > xvmc
> 
> > support for nv43 is already done. When I start xvmcinfo it 
print:
> FTR, an individual with a NV43 AGP had trouble with it. See
> http://nouveau.freedesktop.org/wiki/VideoAcceleration/ for a
> few more details. Note that if you're using a recent kernel,
> you need 3.11-rc4 or later (nouveau/master is fine too, of
> course), as support got broken at some point.
> 

Ok, I'm using kernel 3.8 from ubuntu. Will try 3.11 if something 
change. Also I have PCI-E card, not AGP.

> > $ ./xvmcinfo
> 
> Huh, never heard of that. No gentoo ebuild either.
> 

You can download it from:
http://www.mythtv.org/wiki/XvMC#Checking_your_installation
or from:
http://svnweb.freebsd.org/ports/head/x11/xvmcinfo/files/

> > Xv version 2.2
> > XvMC version 1.1
> > 
> > screen number 0
> > 
> >    info for adaptor 0 [NV40 texture adapter]
> >    
> >       number of XvMC surface types: 2
> >       
> >       info about surface 0:
> >          max_width=2048
> >          max_height=2048
> >          subpicture_max_width=2048
> >          subpicture_max_height=2048
> >          
> >          chroma_format:
> >             XVMC_CHROMA_FORMAT_420
> >          
> >          mc_type:
> >             format                   : MPEG2
> >             accelaration start from  : IDCT
> >          
> >          flags:
> >             XVMC_BACKEND_SUBPICTURE
> >             XVMC_SUBPICTURE_INDEPENDENT_SCALING
> >       
> >       info about surface 1:
> >          max_width=2048
> >          max_height=2048
> >          subpicture_max_width=2048
> >          subpicture_max_height=2048
> >          
> >          chroma_format:
> >             XVMC_CHROMA_FORMAT_422
> >          
> >          mc_type:
> >             format                   : MPEG2
> >             accelaration start from  : IDCT
> >          
> >          flags:
> >             XVMC_BACKEND_SUBPICTURE
> >             XVMC_SUBPICTURE_INDEPENDENT_SCALING
> >    
> >    info for adaptor 1 [NV40 high quality adapter]
> >    
> >       number of XvMC surface types: 0
> >    
> >    info for adaptor 2 [NV Video Blitter]
> >    
> >       number of XvMC surface types: 0
> 
> This actually doesn't (necessarily) have anything to do with
> reality. It's reported entirely by X, which has little to do
> with actual XvMC operation.
> 

It calling some XvMC functions. At least this means that X has 
XvMC support for screen.

> > So some xvmc support is there (via nouveau xvmc library).
> > But when I tried to use mpeg2play_accel testing application
> > (or mplayer) it crash. Here is gdb backtrace from coredump
> > file:
> > 
> > (gdb) bt
> > #0  0x0000000000000000 in ?? ()
> > #1  0x00007fca300cd345 in XvMCCreateContext (dpy=0xbefd00,
> > port=63, surface_type_id=842094169, width=720, height=480,
> > flags=1, context=0x60dee0)
> > 
> >     at context.c:248
> > 
> > #2  0x000000000040941f in init_display () at display.c:270
> > #3  0x0000000000402f0c in initdecoder () at mpeg2dec.c:211
> > #4  0x0000000000402b57 in main (argc=2, argv=0x7fff94c89f10)
> > at mpeg2dec.c:121 (gdb) bt full
> > #0  0x0000000000000000 in ?? ()
> > No symbol table info available.
> > #1  0x00007fca300cd345 in XvMCCreateContext (dpy=0xbefd00,
> > port=63, surface_type_id=842094169, width=720, height=480,
> > flags=1, context=0x60dee0)
> > 
> >     at context.c:248
> >     
> >         found_port = true
> >         scrn = 0
> >         chroma_format = 1
> >         mc_type = 65538
> >         surface_flags = 6
> >         subpic_max_w = 2048
> >         subpic_max_h = 2048
> >         ret = 0
> >         vscreen = 0xbf13f0
> >         pipe = 0xc191e0
> >         context_priv = 0xbfead0
> >         csc = {{0, 0, 0, 0}, {-2.02570359e-26,
> >         4.59163468e-41, 5.89217978e-39,
> > 
> > 0}, {-2.02575536e-26, 4.59163468e-41, 8.44951942e-10,
> > 4.5842078e-41}} #2  0x000000000040941f in init_display ()
> > at display.c:270
> > 
> >         surface_type_id = 842094169
> >         result = 0
> >         i = 4204800
> >         color = 0
> >         root = 652
> > 
> > #3  0x0000000000402f0c in initdecoder () at mpeg2dec.c:211
> > 
> >         i = 640
> >         blk_cnt_tab = {6, 8, 12}
> > 
> > #4  0x0000000000402b57 in main (argc=2, argv=0x7fff94c89f10)
> > at mpeg2dec.c:121
> > 
> >         first = 1
> >         framenum = 0
> >         runtime = 0
> >         tstart = {tv_sec = 140735689563912, tv_usec =
> >         4236512} tstop = {tv_sec = 0, tv_usec = 4204800}
> > 
> > It looks like that in mesa code is calling
> > pipe->create_video_decoder(...) but create_video_decoder is
> > NULL and then it crash.
> > 
> > (gdb) print *pipe
> > $1 = {screen = 0xbffa50, priv = 0xbf13f0, draw = 0x0,
> > destroy = 0x7fca300d00a0 <nv30_context_destroy>, draw_vbo =
> > 0x7fca300da250 <nv30_draw_vbo>,
> > 
> >   render_condition = 0x7fca300dd760
> >   <nv40_query_render_condition>,
> > 
> > create_query = 0x7fca300dd510 <nv30_query_create>,
> > 
> >   destroy_query = 0x7fca300dd500 <nv30_query_destroy>,
> >   begin_query =
> > 
> > 0x7fca300dd890 <nv30_query_begin>, end_query =
> > 0x7fca300dd670 <nv30_query_end>,
> > 
> >   get_query_result = 0x7fca300dd410 <nv30_query_result>,
> >   create_blend_state =
> > 
> > 0x7fca300d47f0 <nv30_blend_state_create>,
> > 
> >   bind_blend_state = 0x7fca300d3da0 <nv30_blend_state_bind>,
> > 
> > delete_blend_state = 0x7fca300d4160
> > <nv30_blend_state_delete>,
> > 
> >   create_sampler_state = 0x7fca300d69f0
> >   <nv30_sampler_state_create>,
> > 
> > bind_fragment_sampler_states = 0x7fca300d72a0
> > <nv30_fragtex_sampler_states_bind>,
> > 
> >   bind_vertex_sampler_states = 0x7fca300d79a0
> > 
> > <nv40_verttex_sampler_states_bind>,
> > bind_geometry_sampler_states = 0,
> > bind_compute_sampler_states = 0,
> > 
> >   delete_sampler_state = 0x7fca300d69e0
> >   <nv30_sampler_state_delete>,
> > 
> > create_rasterizer_state = 0x7fca300d44a0
> > <nv30_rasterizer_state_create>,
> > 
> >   bind_rasterizer_state = 0x7fca300d3db0
> >   <nv30_rasterizer_state_bind>,
> > 
> > delete_rasterizer_state = 0x7fca300d4150
> > <nv30_rasterizer_state_delete>,
> > 
> >   create_depth_stencil_alpha_state = 0x7fca300d4170
> >   <nv30_zsa_state_create>,
> > 
> > bind_depth_stencil_alpha_state = 0x7fca300d3dc0
> > <nv30_zsa_state_bind>,
> > 
> >   delete_depth_stencil_alpha_state = 0x7fca300d4140
> >   <nv30_zsa_state_delete>,
> > 
> > create_fs_state = 0x7fca300d7cb0 <nv30_fp_state_create>,
> > 
> >   bind_fs_state = 0x7fca300d7c40 <nv30_fp_state_bind>,
> >   delete_fs_state =
> > 
> > 0x7fca300d7c50 <nv30_fp_state_delete>,
> > 
> >   create_vs_state = 0x7fca300d8240 <nv30_vp_state_create>,
> >   bind_vs_state =
> > 
> > 0x7fca300d8230 <nv30_vp_state_bind>,
> > 
> >   delete_vs_state = 0x7fca300d8360 <nv30_vp_state_delete>,
> >   create_gs_state =
> > 
> > 0, bind_gs_state = 0, delete_gs_state = 0,
> > 
> >   create_vertex_elements_state = 0x7fca300d9d90
> >   <nv30_vertex_state_create>,
> > 
> > bind_vertex_elements_state = 0x7fca300d9d40
> > <nv30_vertex_state_bind>,
> > 
> >   delete_vertex_elements_state = 0x7fca300d9d60
> >   <nv30_vertex_state_delete>,
> > 
> > set_blend_color = 0x7fca300d3dd0 <nv30_set_blend_color>,
> > 
> >   set_stencil_ref = 0x7fca300d3df0 <nv30_set_stencil_ref>,
> >   set_sample_mask =
> > 
> > 0x7fca300d3e10 <nv30_set_sample_mask>,
> > 
> >   set_clip_state = 0x7fca300d4080 <nv30_set_clip_state>,
> >   set_constant_buffer =
> > 
> > 0x7fca300d4c30 <nv30_set_constant_buffer>,
> > 
> >   set_framebuffer_state = 0x7fca300d3f50
> >   <nv30_set_framebuffer_state>,
> > 
> > set_polygon_stipple = 0x7fca300d3e30
> > <nv30_set_polygon_stipple>,
> > 
> >   set_scissor_states = 0x7fca300d3ef0
> >   <nv30_set_scissor_states>,
> > 
> > set_viewport_states = 0x7fca300d3f10
> > <nv30_set_viewport_states>,
> > 
> >   set_fragment_sampler_views = 0x7fca300d7330
> > 
> > <nv30_fragtex_set_sampler_views>,
> > 
> >   set_vertex_sampler_views = 0x7fca300d7a30
> >   <nv40_verttex_set_sampler_views>,
> > 
> > set_geometry_sampler_views = 0, set_compute_sampler_views =
> > 0,
> > 
> >   set_shader_resources = 0, set_vertex_buffers =
> >   0x7fca300d4000
> > 
> > <nv30_set_vertex_buffers>, set_index_buffer = 0x7fca300d4dc0
> > <nv30_set_index_buffer>,
> > 
> >   create_stream_output_target = 0,
> >   stream_output_target_destroy = 0,
> > 
> > set_stream_output_targets = 0,
> > 
> >   resource_copy_region = 0x7fca300d2e30
> >   <nv30_resource_copy_region>, blit =
> > 
> > 0x7fca300d3370 <nv30_blit>, clear = 0x7fca300d8be0
> > <nv30_clear>,
> > 
> >   clear_render_target = 0x7fca300d95c0
> >   <nv30_clear_render_target>,
> > 
> > clear_depth_stencil = 0x7fca300d91b0
> > <nv30_clear_depth_stencil>,
> > 
> >   flush = 0x7fca300d0130 <nv30_context_flush>,
> >   create_sampler_view =
> > 
> > 0x7fca300d6ec0 <nv30_sampler_view_create>,
> > 
> >   sampler_view_destroy = 0x7fca300d7220
> >   <nv30_sampler_view_destroy>,
> > 
> > create_surface = 0x7fca300d3be0 <nv30_miptree_surface_new>,
> > 
> >   surface_destroy = 0x7fca300d3d60
> >   <nv30_miptree_surface_del>, transfer_map =
> > 
> > 0x7fca30031040 <u_transfer_map_vtbl>,
> > 
> >   transfer_flush_region = 0x7fca30031050
> >   <u_transfer_flush_region_vtbl>,
> > 
> > transfer_unmap = 0x7fca30031060 <u_transfer_unmap_vtbl>,
> > 
> >   transfer_inline_write = 0x7fca30031070
> >   <u_transfer_inline_write_vtbl>,
> > 
> > texture_barrier = 0, create_video_decoder = 0,
> > create_video_buffer = 0,
> > 
> >   create_compute_state = 0, bind_compute_state = 0,
> >   delete_compute_state = 0,
> > 
> > set_compute_resources = 0, set_global_binding = 0,
> > launch_grid = 0,
> > 
> >   get_sample_position = 0}
> 
> That's rather odd... there isn't really a code path that
> doesn't initialize create_video_decoder at this point, take a
> look at nv30_context.c -- it calls nouveau_context_init_vdec
> unconditionally, which in turn just sets a couple of
> pointers. Are you sure that you're running with the latest
> version? Note that the XvMC library used is selected by
> /etc/X11/XvMCConfig. (I think libXvMCW reads that file and
> dlopens it.) It might be nice to see in strace -f -e open
> that it actually opens the libXvMCnouveau.so file that you
> built.
> 
>   -ilia

I'm sure that libXvMCnouveau.so is used. I modified 
mpeg2play_accel Makefile and code to use it directly.
I will re-check if everyhing is builded correctly.

-- 
Pali Rohár
pali.rohar at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130816/a1fa8c6f/attachment-0001.pgp>


More information about the mesa-dev mailing list