[Mesa-dev] nouveau: xvmc on nv43

2013-08-19 Thread Pali Rohár
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:

$ ./xvmcinfo 

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

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  0x in ?? ()
#1  0x7fca300cd345 in XvMCCreateContext (dpy=0xbefd00, port=63, 
surface_type_id=842094169, width=720, height=480, flags=1, context=0x60dee0)
at context.c:248
#2  0x0040941f in init_display () at display.c:270
#3  0x00402f0c in initdecoder () at mpeg2dec.c:211
#4  0x00402b57 in main (argc=2, argv=0x7fff94c89f10) at mpeg2dec.c:121
(gdb) bt full
#0  0x in ?? ()
No symbol table info available.
#1  0x7fca300cd345 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  0x0040941f in init_display () at display.c:270
surface_type_id = 842094169
result = 0
i = 4204800
color = 0
root = 652
#3  0x00402f0c in initdecoder () at mpeg2dec.c:211
i = 640
blk_cnt_tab = {6, 8, 12}
#4  0x00402b57 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, 

Re: [Mesa-dev] nouveau: xvmc on nv43

2013-08-19 Thread Pali Rohár
On Friday 16 August 2013 16:34:43 you wrote:
 On Fri, Aug 16, 2013 at 5:40 AM, Pali Rohár 
pali.ro...@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  0x in ?? ()
  #1  0x7fca300cd345 in XvMCCreateContext (dpy=0xbefd00,
  port=63, surface_type_id=842094169, width=720, height=480,
  flags=1, context=0x60dee0)
  
  at context.c:248
  
  #2  0x0040941f in init_display () at display.c:270
  #3  0x00402f0c in initdecoder () at mpeg2dec.c:211
  #4  0x00402b57 in main (argc=2, argv=0x7fff94c89f10)
  at mpeg2dec.c:121 (gdb) bt full
  #0  0x in ?? ()
  No symbol table info available.
  #1  0x7fca300cd345 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  0x0040941f in init_display ()
  at display.c:270
  
  surface_type_id = 842094169
  result = 0
  i = 4204800
  color = 0
  root = 652
  
  #3  0x00402f0c in initdecoder () at mpeg2dec.c:211
  
  i = 640
  blk_cnt_tab = {6, 8, 12}
  
  #4  0x00402b57 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 

Re: [Mesa-dev] nouveau: xvmc on nv43

2013-08-17 Thread Ilia Mirkin
On Sat, Aug 17, 2013 at 11:56 AM, Pali Rohár pali.ro...@gmail.com wrote:
 Now I compiled mesa from git master again and installed kernel 3.11-rc5. After
 that mpeg2play_accel not crashing anymore. It looks like I forgot to install
 mesa with your xvmc patches (only compiled), so I had in system last version.
 So this was probably reason for above NULL pointer crash.

Yes, before my patches all the video stuff was unset, and I guess the
xvmc state tracker doesn't check for things too carefully.


 Anyway, now it not crashing, it show some X window, but only with random
 colors (see attachment of video screenshot). So there is problem with HW
 deconding... Also in dmesg I see this error message every milisecond:

 [  179.232807] nouveau E[   PMPEG][:05:00.0] ch -1 [0x unknown]
 0x0100 0x0020 HEXNUM1 HEXNUM2

 I tried also vdpau output with mplayer, but this caused instant freeze and
 then Xserver crashed. In dmesg was:

Hm, well vdpau isn't hooked up, so decoder-decode_bitstream is null.
(I tried hooking it all up, but the resulting video was no good, xvmc
ends up doing a bunch of normalization on things, and I guess the
current code doesn't handle some of the conditions.) Of course that
shouldn't cause *X* to crash :(


 [  614.990022] nouveau E[ DRM] GPU lockup - switching to software fbcon
 [  630.096021] nouveau E[Xorg[1751]] failed to idle channel 0x0001
 [Xorg[1751]]
 [  645.096021] nouveau E[Xorg[1751]] failed to idle channel 0x0001
 [Xorg[1751]]
 [  660.096018] nouveau E[Xorg[1751]] failed to idle channel 0x
 [Xorg[1751]]
 [  675.096020] nouveau E[Xorg[1751]] failed to idle channel 0x
 [Xorg[1751]]

 So xvmc not crashing anymore, but not playing video and vdpau cause crashing X

Right, so it sounds like wrt xvmc you have the same issue as the other
person with a NV43 AGP card... everything's working fine, but no
decoding actually happening. I bet those PMPEG interrupt errors have
something to do with it. I'm getting a NV43 PCIE end of next week, so
I'll take a look at it then. FWIW it's (most likely) not a mesa issue,
it's a kernel issue in not setting up the engine properly, or
something. (Not that this helps you at all...)

  -ilia
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] nouveau: xvmc on nv43

2013-08-16 Thread Ilia Mirkin
On Fri, Aug 16, 2013 at 5:40 AM, Pali Rohár pali.ro...@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.


 $ ./xvmcinfo

Huh, never heard of that. No gentoo ebuild either.


 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.


 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  0x in ?? ()
 #1  0x7fca300cd345 in XvMCCreateContext (dpy=0xbefd00, port=63,
 surface_type_id=842094169, width=720, height=480, flags=1, context=0x60dee0)
 at context.c:248
 #2  0x0040941f in init_display () at display.c:270
 #3  0x00402f0c in initdecoder () at mpeg2dec.c:211
 #4  0x00402b57 in main (argc=2, argv=0x7fff94c89f10) at mpeg2dec.c:121
 (gdb) bt full
 #0  0x in ?? ()
 No symbol table info available.
 #1  0x7fca300cd345 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  0x0040941f in init_display () at display.c:270
 surface_type_id = 842094169
 result = 0
 i = 4204800
 color = 0
 root = 652
 #3  0x00402f0c in initdecoder () at mpeg2dec.c:211
 i = 640
 blk_cnt_tab = {6, 8, 12}
 #4  0x00402b57 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 = 

Re: [Mesa-dev] nouveau: xvmc on nv43

2013-08-16 Thread Matt Turner
On Fri, Aug 16, 2013 at 7:34 AM, Ilia Mirkin imir...@alum.mit.edu wrote:
 On Fri, Aug 16, 2013 at 5:40 AM, Pali Rohár pali.ro...@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.


 $ ./xvmcinfo

 Huh, never heard of that. No gentoo ebuild either.

It's available here: http://www.mythtv.org/wiki/XvMC#Checking_your_installation

Maybe we (X.Org) should package it or add it to libXvMC if it's useful.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev