[Note: This e-mail get's into some additional design discussions, so I'm
adding anybody who has responded to this thread directly to the CC list,
to circumvent the sourceforge e-mail log jam.]

Alan Hourihane wrote:
> 
> On Mon, Apr 01, 2002 at 08:01:58 -0700, Jens Owen wrote:
> > Alan Hourihane wrote:
> > >
> > > Jens,
> > >
> > > Are we moving the files in
> > >
> > > xc/programs/Xserver/hw/xfree86/os-support
> > >
> > > into their relevant ddx drivers directory ?
> >
> > If you are specifically asking about the xf86drm<DriverName>.h files in
> > that directory, we certainly could.  There is a fair amount of cleanup
> > that can be done now that we down to two layers.  I really tried to
> > minimize my changes to just the semantics of this interface, however, I
> > notice a couple of areas along the way that could be cleaned up:
> >
> > I) Right now, we have one os independent header file per driver:
> >
> > xc/programs/Xserver/hw/xfree86/os-support/xf86drm<driver>.h
> >
> > and one OS specific header file:
> >
> > xc/programs/Xserver/hw/xfree86/os-support/*/drm/kernel/<driver>_drm.h
> >
> > The 2D driver references the first, which is OS independent, the 3D
> > driver and kernel module reference the second which is not.  It would be
> > good to get the interface down to one header only, but I think there are
> > some tough issues to wrestle here.
> >
> Jens,
> 
> I'm currently building the tree to test the gamma, but looking at the
> above again - I'm finding that....
> 
> xf86drm<driver>.h is referenced by the 2D and 3D drivers (certainly
> in the radeon case), and that <driver>_drm.h is only referenced by
> the lib/GL/dri/drm code which is right as thats coming from the
> symlinks for the libdrm.a code.

Right, I was able to get more OS independence in the 3D driver.  The 2D
and 3D OS independent drivers should never reference the kernel headers
directly.  In fact, I would move all of the <driver>_drm.h definitions
into xf86drmCompat.h, except I plan on removing the compatability module
from lib/GL/drm/drm once we have all the 3D drivers converted.  The
compatability module isn't needed on the 3D side because libdrm.a is
staticly linked.
 
> I think we can safely move the header files from os-support/*.h to
> their relevant 2D ddx directories.

Yes, these headers can safely be moved, now.

> We already include that as a
> search path in the 3D drivers.

True.  3D drivers are picking up SAREA and a few additional defines
directly from <driver>_dri.h and/or <driver>_sarea.h headers in the 2D
ddx directories.
 
> I think we should probably put a bigger warning in these header files
> though to make sure the OS maintainers know that the structures need
> to match in the respective kernel interfaces.

I agree 100%, in fact, I would suggest that we move all driver specific
common headers into a unique subdirectory all by themselves in each 2d
ddx directory.  At least for new drivers.  That way they are more likely
to stand out and not get mixed up with defines that aren't shared.

> Any problems with moving them now ?

If we don't do this last step, move them into an isolated subdirectory,
we can easily move them now.  No file name, structure name or path name
changes required.  However, I'm wondering if it wouldn't be better to
make the larger effort and try to achieve stronger, cleaner separation. 
Specifically I'm thinking:

  1) Update include paths to allow a subdirectory, perhaps
hw/xfree86/driver/<driver>/drm where we put all the common driver
specific headers.

  2) Update all file and structure names to have a consistent naming
convention in that subdirectoy.

  3) Possibly address sharing these files with the kernel, so we have
one OS independent file for both user and kernel space.  The biggest
problem I see here is that we would need to copy these files to the
kernel directories before releasing them for inclusion with the kernel
teams.  Right now, we have a nice mechanism for Linux where everything
that is needed by the kernel source tree is in a single subdirectory.  I
guess FreeBSD has links in it, so that is already in the, need to copy,
boat.  Do you have a "make standalone_directory" option you use before
releasing the hw/xfree86/os-support/bsd/drm/kernel/* source files to the
FreeBSD kernel team?

--                             /\
         Jens Owen            /  \/\ _    
  [EMAIL PROTECTED]  /    \ \ \   Steamboat Springs, Colorado

_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to