NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: NetBSD on the Asus EeePC (drm and such)



Hello,

I noticed that the drm is untested.  If anyone tries it and has
problems, please let me know and I'll see if I can't help fix them.
There are plenty of fixes in GIT that I could "cherry-pick" if need
be.  Then again, it might "just work".
I think supporting drm on this hardware is important--at least from an
advocacy point of view, though I'm sure users will appreciate it--and
so I'd like to make sure it works.

FWIW:  I've started on my "port-linux-drm-no-matter-how-long-it-takes"
project (the BSD DRM code is moribund and way behind the
state-of-the-art).  There's some stuff that I don't know how to do;
however, by and large, my impression is that much of the code could be
dramatically simplified by using our handy bus_dma/bus_space
facilities.  I also came upon some code which is essentially a
hand-rolled implementation of reader-writer locks, and so that could
be dramatically simplified, too.  From what I can tell (unless the drm
code is mysteriously not using them), linux only has functions to
map/unmap DMA/bus space:  driver code has to handle the rest itself.
Really makes me appreciate NetBSD!

Also, their drm code uses a hash table of to keep track of its e.g.
dma handles instead of simply by their addresses.  Each entry is a
32-bit value, and so they much of the 64-bit madness our code is prone
to.  These values, which are unsigned long in the BSD drm, are passed
back to userspace via ioctl and subsequently used by libdrm to mmap
various regions of memory.  This causes huge problems for our code on
64-bit platforms because voff_t is signed.  Thus, values >2^63 become
negative and the mmapping from userland fails.

Of course, the linux code still does evil things like [whatever their
equivalent is] of vtophys, but once I abstract the dma/bus_space
allocation into their own functions and use them throughout, that
should disappear.

Sorry about digressing from the topic--it just sort of happened, and I
figured some people might like to know what's going on with drm.  I'm
relatively new at this, so if anyone wants to help in any way, please
don't hesitate to contact me.
Undoubtedly there will be many bugs and/or incorrect code when I get
to the point where I might try building it. ;)

Regards,

--Blair


Home | Main Index | Thread Index | Old Index