--- Dave Airlie <[EMAIL PROTECTED]> wrote:
> My main worry is that this stuff break BSD compat, and without Eric around
> I'd say fixing it mightn't be the easiest, also for the 2.6 merge I've
> removed all the device ID strings as as Dave J pointed out they are
> duplicating pci.ids, can we not get this info from the pci layer on Linux
> and perhaps for BSD keep the strings if they have nothing similiar.....

I just added two columns to the device ID table in order to make it match the
one in Linux. BSD and the fallback Linux code use the loop at the bottom of
drm_init(). BSD does not use the OS for associating device drivers with the
hardware. BSD probably don't compile but it is easy to fix.

I had this code in the build once before when Eric was around. It got removed
because it was conflicting with framebuffer (after all Linux is designed to only
allow one driver to own the hardware). This version will revert to the fallback
scheme (stealth mode) if framebuffer is already loaded. In steath mode DRM is
accessing the hardware without informing the kernel.

The PCI IDs got duplicated because for a long time 2.6 was missing half of the
radeon IDs. There is probably no good solution to this problem if Linux and BSD
are using different strings. I've never looked at BSD, are the strings
different?

Please give the code a try locally and see if it works on i810/i830. I don't own
that hardware.

> Can you check against sysfs code I've added that was submitted to the
> kernel? just make sure it doesn't do things twice etc..

The patch removes your code and replaces it with mine. Yours works but since my
patch changes the probe function around the sysfs support needed to be changed
on exit. I also added the hotplug event support.

> > Most of the code is driver independent. postinit will need to be
> > implemented for each DRM driver. postinit marks the hardware in use to
> > the kernel and adds the permanent DRM maps for framebuffer and
> > registers. I've implemented postinit for the radeon.
> 
> Will the DRM still build for the other drivers without postinit?

It will build but it won't work. To make it work I would have to relax the
restriction about X not being able to change the DRM AddMaps for
registers/framebuffers. Can we try to get all of the driver to implement
postinit, it's only about 10 lines of code.

This is the only really necessary part:
/* registers */
/* PCI space is twice the real size, so that you can have a RW and RO mapping */
if( (retcode = DRM(initmap)( dev, pci_resource_start( dev->pdev, 2 ),
          pci_resource_len( dev->pdev, 2 ) / 2, _DRM_REGISTERS, 0 )))
          return retcode;
                                                                                
        
/* framebuffer */
  if( (retcode = DRM(initmap)( dev, pci_resource_start( dev->pdev, 0 ),
          pci_resource_len( dev->pdev, 0 ), _DRM_FRAME_BUFFER,
DRM_WRITE_COMBINING )))
          return retcode;
                                          
The rest of the code in the radeon postinit is telling the OS what resources we
are using. Radeon is a little complicated because the card implements two PCI
devices and I mark them both as being in use.

The last couple of lines check if the cards needs to be reset. This test will be
different for each card. If you want a reset set dev->need_reset = true;. By
default you won't get a reset.

=====
Jon Smirl
[EMAIL PROTECTED]


        
                
__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
--
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to