Herramientas de usuario

Herramientas del sitio


Silicon Motion Driver

Here are the newest drivers for SM: http://www.anheng.com.cn/loongson2f/squeeze/xserver-xorg-video-siliconmotion/

The work to do is more than patching or compiling some parts of the GNU/Linux system.

A Xorg developer said me:

rixed@happyleptic.org wrote:

Apart from minor bugs that are already largely solved, Yeelong video driver 
suffers from performance issues related to video decoding.

The main problem, as I understand it, appears to be that the LynxEM chipset 
can handle only packed YUV while most of the time frames are given as planar 
YUV (I'm not experienced with video decoding but I assume it's due to
YUV components being encoded separately). So the video driver have to
pack the data it receives from the Xv client in order for the chipset to
perform its YUV->RGB on-the-fly conversion.
The current smi driver does this by calling Xv helper function for this job,
which is dog slow and deprive mplayer of needed CPU horsepower.  Noticing this 
bottleneck, Lemote devs added a faster conversion routine using MMX loongson 
assembler right into smi driver. As far as I know all the patchs around that 
makes mplayed videos fast are based on this ugly hack.

So, since the paid professionals were not given appropriate time to fix the 
slowness issue the proper way, we the unpaid amateurs will have to work on it 
on our spare time :-)

Of course SMI driver must keep calling Xv generic conversion function.
But patching Xv with architecture specific assembly is not much better. Xv 
should instead use a library that offers this kind of image processing 
functions optimised for the running architecture. This library already exist,
is called libpixman and is in fact already used by some other parts of X11.

Unfortunately YUV conversion functions are not currently supported by 
libpixman, although some work is being done in this direction. Finishing this 
work, adding support for loongson MMX instructions and then patch Xv to
use libpixman would be the perfect solution to our problem.
I was about to try this path when I discovered that libpixman project is also 
considering another radically different evolution : to replace all architecture 
specific pieces of code by a more generic JIT compiler.

Of course I quickly dropped the idea of patching YUV + loongson into pixman 
and embraced the JIT thing instead.
Why hack for two weeks when you could be hacking for six months ?

And starting THIS project. This can be the way to get a really good performance of the video card, as far as his “proof of concept” appears to show.

So, the efforts that has been tried this far are the following ones:

The actual drivers are available here. Hardware Tech documents here

For apply most of the patches it is needed to recompile xserver-xorg and recompile the driver to have all working properly. This is mostly insane to do in the current metad version, because the current distro xorg server version is more than old and it is not upgradeable, unless we wait for the next Debian Stable Release…

The closest approach to this was using the LOONUX repos. it brings a little more best performance, but it does not solve some others problem. MPLAYER crashes installing it in this way, giving a segfault error.

We are starting to work in a GNU/Linux From Scratch, to probe the sourcecode available without getting in trouble with binary versions and just sit waiting for the slow uptating time of Debian Stable distribution. it will be useful to probe also others programs like NetworkManager and the rest of the needs of FSF for the Yeelong Endorsement.

This has be done until now:

  • In LONGSON-DEV mailing list in google there was one effort. There was comments in this list that is important to put the light on:
    • Here, rixed published a patch for the 1.7.3 version of the driver (the last one ?).
    • He comments: “Still, it lacks the most interresting part : the MMX pack function, which should not be implemented there but probably either directly in Xv or in pixman (and make Xv use pixman). So for now the simpliest is to fix these manually. For the impatient I attach a patch against SM 1.7.3 With it, 16bpp and AccelMethod = “XAA” works quite well. ”
    • In the same thread he said a better patch would be publiseh, but I have not founded yet.
    • Zhang said: “I have tried it. It works. However this definitely does not qualify as a proper fix. Further investigation need to be done. One thing to note though: It is xorg-server which has fb/fb.h. So two packages to rebuild: xorg-server and xf86-video-siliconmotion ” [FIX: Will be god to put here these likns]
  • A (DEB Package) of the driver was publised in this page written in Chinesse. Translated by Google here There will be to have the sources and some documentation of how that was done.
  • Another page written in Chinesse talk about other probes. Google translated here
  • Bernie Inocent bernie@codewiz.org has this patch, but he says it is needed more work on it to make it work properly.
  • An interesting patch, with very good benchmarks results is in here. Google Translated HERE

In the gNewSense-dev mailing list, Daniel Clark give some advices:

  1. If you don't have commit access to xorg version control, be sure to form a relationship with someone who does, and is willing to help you get your changes in. Ditto for the upstream Debian packages, unless you have resources to maintain seperate gNS-specific packages until the end of time, and kk is cool with that.
  2. Make sure any development happens in a publicly available version control repository. Tell at least this list and loongson-dev where that is once anything at all useful is there.
  3. Keep in mind that the goal is to be included in upstream xorg; avoid quick hacks that will never be accepted upstream.
  4. If the people working on this on your end are not good at English, see if you can get someone who is to translate the available doc / list threads to them and vice versa.
  5. You may also want to follow Zhang Le's Gentoo work, it seems to be the most advanced loongson2f-optimized GNU/Linux distribution at the moment (i.e. it's actually all compiled with proper mipsel abi, loongson2f optimization, loongson2f bug workarounds). Also collaborating with people working on OpenBSD/Loongson may be useful; we may disagree politically at times, but we use the same upstream xorg code.
  6. Some low level info on the SM hardware is at http://groups.google.com/group/loongson-dev/files
  7. If you need to speed up compiles bug me on #gnewsense-dev - I'm close to having an icecc setup done, and should have 10 more 2f boxes to add to the existing 4 in the farm Monday.
  8. Most recent threads on xorg from bernie
octaviotron/lemote.txt · Última modificación: 2013/12/10 14:43 (editor externo)