On Tue, 3 Jun 2003, [iso-8859-15] José Fonseca wrote:
> >    Quite frankly, looking at the current DRI tree, there's not a lot of 
> >    code like this there that I can see. Almost every single "library" 
> >    function has intimate details about the hardware through macro 
> >    expansion.
> 
> By the contrary. Most functions in the drm_*.h templates are likely
> candidates. For the major part template costumization consists of "have
> DMA", "need AGP", "use SG", ... but if the associated functions go into
> a new common module, there is no point to conditionaly enable them -
> they are always there, and it's up to the driver to use them or not.

The above is indeed true for some header files (I pointed out three, 
there may be others).  

However, look at things like "drm_drv.h", "drm_dma.h" etc, which both use
the DRM() macros and other macros to call functions that are very much
card-specific.

It may not be immediately obvious, but doing things like

        DRM(driver_irq_preinstall)(dev);

immediately means that that function cannot be a generic library function. 
Some other header files use the DRM() prefix to create per-driver data 
structures, ie things like DRM(parse_options) use it to create separate 
option "flag" variables for separate drivers.

But yes, part of this definitely can be cleaned up and shared.

                Linus



-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to