On Wed, 3 Sep 2003 14:10:50 -0700 (PDT)
Alex Deucher <[EMAIL PROTECTED]> wrote:

> This is probably better asked on dri-devel (cc:ed).
> 
> --- Cheshire Cat Fish <[EMAIL PROTECTED]> wrote:
> > I am investigating supporting DRI and OpenGL for the Silicon Motion
> > driver.
> > I'm new to both of those, so some of these may be newbie sounding
> > questions.
> > 
> > 1) I have the  OpenGL code from the Windows 2000 Silicon Motion
> > driver.  Can 
> > this code be mostly used "as is"?  Or will the Linux code be entirely
> > 
> > different?
> 
> How did you obtain this code?  If it was not under an agreement with
> SMI, then it probably won't be included the DRI for legal reasons.
> I've never programmed for windows, but I'd imagine their Direct
> rendering API and that of the DRI are pretty different.  Still, the
> source would be a good guide for development.  Basically you would want
> to create a new driver modeled after an existing DRI driver, then fill
> in support for the hw using the windows driver as a reference.  You
> also have to make the 2D driver DRI aware.  
> 
> > 
> > 2) In the DRI Users Guide, section 3.2-Graphics Hardware, Silicon
> > Motion is 
> > not listed as currently being supported.  Is this still the case? Is
> > anyone 
> > working on this?  Or am I starting from scratch?
> 
> SMI hardware is currently not supported and no one is actively working
> on it yet.
> 
> > 
> > 3) How big of a task am I looking at here? Since I alrady have the
> > Win2k OGL 
> > code to base my work on, it seems to me it shouldn't be too hard to
> > drop 
> > that code in and hook it up to DRI.  A few weeks maybe?  Or am I
> > missing 
> > something fundamental?
> > 

The existing drivers in DRI and XFree86 CVS use Mesa as the common
OpenGL library. If you want your code in DRI CVS you would probably have
to write a new driver using Mesa's infrastructure. Some bits that
actually deal with the hardware could be copied from the windows
sources. You would also have to consider the issues of concurrent
hardware access that are handled by the kernel drm driver. Again, there
is existing template code for the kernel drm driver that you may
consider using. Finally you also have to make the XFree86 2D driver DRI
aware, that means it has to be prepared that it is not exclusively
accessing the hardware and to proper locking via the DRM. If you choose
to take this approach it will take you a lot of time (months). You will
spend a lot of time reading source code as you have to understand Mesa,
at least one other Mesa-based driver (as a model for your driver), your
existing windows code, the kernel DRM driver and to some extent the
XFree86 2D driver.

The alternative (what I think you are imagining) is to change the
existing driver to interoperate with the XFree86 DRI extension and keep
the existing (windows) OpenGL code. You would still have to make the 2D
driver DRI aware and you will need some kernel component that
coordinates hardware access of direct rendering applications and the X
server. You would also have to write some GLX code because your windows
driver implements the WGL API.

Considering all this I am no longer sure which approach will take less
time. Either you have to rewire your driver code to fit into the Mesa
framework or you end up rewriting GLX. In either case you have to modify
the 2D driver and write a kernel driver component. I think the biggest
challenge in the beginning will be the number of components involved.

Now that I summarized what you're up against I guess I should say
something encouraging ... please don't give up before you even started.
It's going to take more time than you were expecting but there are some
people here who will support you in your effort.

> 
> It's a pretty big task.  To start off, I recommend reading the DRI FAQ:
> http://dri.sourceforge.net/doc/faq/
> This will give you a better understanding of how the DRI works.
> 
> Good Luck,
> 
> Alex

I think it's more about persistence than luck ;-)

Best regards,
  Felix

------------    __\|/__    ___     ___       -------------------------
 Felix       ___\_e -_/___/ __\___/ __\_____   You can do anything,
   Kühling  (_____\Ä/____/ /_____/ /________)  just not everything
 [EMAIL PROTECTED]       \___/   \___/   U        at the same time.


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to