linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jon Smirl <jonsmirl@yahoo.com>
To: Eric Anholt <eta@lclark.edu>, kronos@kronoz.cjb.net
Cc: linux-kernel@vger.kernel.org,
	linux-fbdev-devel@lists.sourceforge.net,
	dri-devel <dri-devel@lists.sourceforge.net>
Subject: Re: [Linux-fbdev-devel] DRM and pci_driver conversion
Date: Thu, 23 Oct 2003 14:31:44 -0700 (PDT)	[thread overview]
Message-ID: <20031023213144.66685.qmail@web14916.mail.yahoo.com> (raw)
In-Reply-To: <1066943415.662.9.camel@leguin>

I don't think DRM drivers are doing things correctly yet. DRM is missing the
code for marking PCI resources as being in use while DRM is using them. This
could lead to problems with hotplug.  XFree is also mapping PCI ROMs in without
informing the kernel and that can definitely cause problems. I'm looking at
adding the resource marking code right now.

I am not a fan of having two device drivers (DRM and FB) trying to control the
same piece of hardware, but if we are going to insist on doing it we need to do
it in a way where both drivers work and mark the resources in use independent
of the order in which they are loaded.

So I think we need to implement both the old and new PCI ID schemes and
fallback to the
old one if the other driver is present. DRM also needs to add code marking
resources in use which will also conflict with framebuffer. 

It would flow something like this:
new style probe
if (new probe has device)
   mark resources in use
else
   do old style probe (make sure card is really there)
   assume other driver has marked resources in use

The framebuffer drivers that have DRM parallels would need to implement the
same code. That way it won't matter what order things get loaded.

A second possibility would be to implement a tiny stub for just attaching to
the PCI ID and resources. Then framebuffer and DRM could both share the stub.

A third scheme would disallow mixing DRM and FB. A DRM-console module would be
written to replace FB console. Accelerated console could be written using DRM
since it already knows about the 3D hardware. This would fix the problem with
radeonfb mapping upto 256K of memory into the 1GB kernel space and pushing all
the page tables high. Everything would be coordinated in a single drive so
there is no state saving on VT switch problem either.

--- Eric Anholt <eta@lclark.edu> wrote:
> On Thu, 2003-10-23 at 12:04, Kronos wrote:
> > Il Mon, Oct 20, 2003 at 07:31:56PM -0700, Eric Anholt ha scritto: 
> > > I recently committed a change to the DRM for Linux in DRI CVS that
> > > converted it to use pci_driver and that probe system.  Unfortunately,
> > > we've found that there is a conflict between the DRM now and at least
> > > the radeon framebuffer.  Both want to attach to the same device, and
> > > with pci_driver, the second one to come along doesn't get probe called
> > > for that device.  Is there any way to mark things shared, or in some
> > > other way get the DRM to attach to a device that's already attached to,
> > > in the new model?
> > 
> > AFAIK no,  pci_dev only  stores one pointer  to the  driver. Two drivers
> > fiddling with the same hw can be dangerous. What will happen if radeonfb
> > starts using hw  accel, touching registers without  DRM knowing it? What
> > is (IMHO) needed is a common  layer that works with hardware and exposes
> > an interface to both radeonfb and DRM. I think that Jon Smirl is working
> > on something like this.
> 
> Apparently loading DRM after radeonfb is okay.  Loading radeonfb after
> DRM is okay as long as the DRM is not in use.  For some cards, the fb
> after the DRM would still be okay (sis, tdfx at the moment, for
> example), but it isn't the case on radeon, apparently.  Other than that
> there aren't any issues I know of.
> 
> I've moved the Linux DRM to old-style probing as pci.txt described,
> which hopefully restores the ability of fb and drm to coexist as well as
> they have in the past.  I hope some linux developers can get this all
> done right so that the two can coexist better.
> 
> -- 
> Eric Anholt                                eta@lclark.edu          
> http://people.freebsd.org/~anholt/         anholt@FreeBSD.org
> 
> 

=====
Jon Smirl
jonsmirl@yahoo.com

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

  reply	other threads:[~2003-10-23 21:31 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1066703516.646.24.camel@leguin>
2003-10-23 19:04 ` DRM and pci_driver conversion Kronos
2003-10-23 21:10   ` [Linux-fbdev-devel] " Eric Anholt
2003-10-23 21:31     ` Jon Smirl [this message]
2003-10-23 23:23       ` [Dri-devel] " Linus Torvalds
2003-10-23 23:46         ` Eric Anholt
2003-10-24  1:19         ` [Dri-devel] " Jeff Garzik
2003-10-24  1:52           ` [Dri-devel] Re: [Linux-fbdev-devel] " Jon Smirl
2003-10-24  3:47           ` Multiple drivers for same hardware:, was: " Jon Smirl
2003-10-24  4:40             ` Linus Torvalds
2003-10-28 18:00               ` James Simmons
2003-10-24 16:44           ` [Dri-devel] " Linus Torvalds
2003-10-24 16:57             ` [Dri-devel] Re: [Linux-fbdev-devel] " Petr Vandrovec
2003-10-24 17:59               ` Linus Torvalds
2003-10-24 18:34                 ` Jon Smirl
2003-10-24 19:45                   ` [Dri-devel] " Ivan Kokshaysky
2003-10-24 19:08               ` Ivan Kokshaysky
2003-10-24 17:06             ` Jeff Garzik
2003-10-24  1:50         ` Jon Smirl
2003-10-25 17:29         ` Egbert Eich
2003-10-25 18:37           ` [Dri-devel] Re: [Linux-fbdev-devel] " Linus Torvalds
2003-10-25 19:17             ` [Dri-devel] " Jeff Garzik
2003-10-27 14:37               ` Ingo Oeser
2003-10-27 15:14               ` Keith Whitwell
2003-10-27 15:38                 ` Jeff Garzik
     [not found]                 ` <20031027153824.GA19711@gtf.org>
2003-10-27 15:50                   ` Keith Whitwell
     [not found]               ` <200310271537.30435.ioe-lkml@rameria.de>
2003-10-27 15:43                 ` Jeff Garzik
2003-10-28 10:53                   ` [Dri-devel] Re: [Linux-fbdev-devel] " Ingo Oeser
2003-10-25 21:02             ` [Dri-devel] " Jon Smirl
2003-10-25 22:07             ` Benjamin Herrenschmidt
2003-10-27 15:10             ` Eric W. Biederman
2003-10-27 15:10             ` Keith Whitwell
     [not found]             ` <20031027114006.A66611@xfree86.org>
2003-10-27 19:38               ` Ian Romanick
2003-10-27 21:32                 ` Linus Torvalds
2003-10-27 23:55                   ` Benjamin Herrenschmidt
2003-10-28  2:13                     ` Linus Torvalds
2003-10-28  3:27                       ` Philip Brown
2003-10-28 19:40                       ` James Simmons
2003-10-28 21:35                         ` Benjamin Herrenschmidt
2003-10-28 22:09                           ` Jon Smirl
2003-10-28 22:26                             ` Benjamin Herrenschmidt
2003-10-28 22:54                         ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031023213144.66685.qmail@web14916.mail.yahoo.com \
    --to=jonsmirl@yahoo.com \
    --cc=dri-devel@lists.sourceforge.net \
    --cc=eta@lclark.edu \
    --cc=kronos@kronoz.cjb.net \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).