On 6/28/05, Ian Romanick <[EMAIL PROTECTED]> wrote: > > 1) Should the maps be created once at driver load time or on > > open/close? I can probably make the egl drivers work either way. > > I did it at neither time in the MGA driver. When I added support there > for PCI cards, I added a DMA boot-strap ioctl. User-mode passes in some > parameters to the kernel (e.g., size of DMA buffers, requested AGP mode, > etc.). The kernel then uses those parameters as guidelines to > initialize itself. Any changes the kernel has to make (e.g., 4x AGP was > requested, but the card is 0x AGP aka PCI) are communicated back via the > same structure.
A future development path might allow two independent users, one on each head. How do we handle them setting conflicting requests for AGP mode and DMA buffer size? Should AGP mode be a DRM property? It is easy to add an attribute to the driver. Same for DMA buffer size. We would try to pick the right default value for these in the driver. The attributes would only be used for override if the default was wrong. Make these attributes into DRM properties gets rid of the multiuser problem. > > 3) Can the driver pre-build the AGP/PCI gart maps? If these maps are > > marked differently it is way for my driver to tell AGP from PCI cards. > > I would advise against that. There are (rare) cases where user-mode > wants to select AGP parameters, AGP mode vs. PCI mode, etc. If AGP is > acquired and those maps added at module load, the only way to make those > selections will be via module paramters. Yuck. Is it ok to let non-root users build these maps? Another solution would be to build a default set in and require root priv to override it. Module parameters aren't as bad as they used to be. You can echo/cat from /sys/module/driver/parameter and read/write them while the module is running. Just load the module and then change the defaults with a shell script. For example turn on drm debug while drm is running: echo 1 >/sys/module/drm/debug > > 6) Is there some need for user space collecting info about the > > hardware and then feeding it back into the driver that I can't see? > > Yes and no. Detecting certain hardware features in the kernel can add > extra bloat. For example, MGA needs to know (at least for G200) whether > the card has SDRAM or SGRAM. It's easier to have that in user-mode so > that you don't add a big chunk of one-time code to the kernel. > > This example is a little weak. I think there may be a different way to > do this detection than the way X does it. Dunno. Since my drivers aren't running as root they have a hard time collecting info like this. Other solutions: 1) call_userhelper() - user mode driver helper that runs in root context 2) put the complex code in the driver and just mark it _init. It will go poof as soon as the driver load is finished. -- Jon Smirl [EMAIL PROTECTED] ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click -- _______________________________________________ Dri-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dri-devel
