linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Vertical retrace interrupts?
@ 2003-01-26  1:51 Fredrik Noring
  2003-01-28 19:21 ` James Simmons
  0 siblings, 1 reply; 17+ messages in thread
From: Fredrik Noring @ 2003-01-26  1:51 UTC (permalink / raw)
  To: linux-fbdev-devel

Hi,

Are there any plans on merging DirectFB features? Stuff like vertical
retrace interrupts etc.?

	Fredrik




-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Vertical retrace interrupts?
  2003-01-26  1:51 Vertical retrace interrupts? Fredrik Noring
@ 2003-01-28 19:21 ` James Simmons
  2003-01-30  2:34   ` Antonino Daplas
  0 siblings, 1 reply; 17+ messages in thread
From: James Simmons @ 2003-01-28 19:21 UTC (permalink / raw)
  To: Fredrik Noring; +Cc: linux-fbdev-devel


> Are there any plans on merging DirectFB features? Stuff like vertical
> retrace interrupts etc.?

Thats already supported. Just add a poll function to fb_ops. To date no 
one has used this feature.




-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Vertical retrace interrupts?
  2003-01-28 19:21 ` James Simmons
@ 2003-01-30  2:34   ` Antonino Daplas
  2003-01-30 11:45     ` Michel Dänzer
  0 siblings, 1 reply; 17+ messages in thread
From: Antonino Daplas @ 2003-01-30  2:34 UTC (permalink / raw)
  To: James Simmons; +Cc: Fredrik Noring, Linux Fbdev development list

On Wed, 2003-01-29 at 03:21, James Simmons wrote:
> 
> > Are there any plans on merging DirectFB features? Stuff like vertical
> > retrace interrupts etc.?
> 

I wholeheartedly agree with this.  There are a lot of applications out
there (especially video players) where vtrace signal delivery is
critical for optimum operation.  Polling for VGA registers is not
totally correct for newer cards and is too inefficient, so this has to
be done at a per driver level.

> Thats already supported. Just add a poll function to fb_ops. To date no 
> one has used this feature.
> 

It's because there is no .poll entry in the struct file_operations in
fbmem.c  Something like this:

static struct file_operations fb_fops = {
	.owner =	THIS_MODULE,
	.read =		fb_read,
	.write =	fb_write,
	.ioctl =	fb_ioctl,
	.mmap =		fb_mmap,
	.open =		fb_open,
	.release =	fb_release,
#ifdef HAVE_ARCH_FB_UNMAPPED_AREA
	.get_unmapped_area = get_fb_unmapped_area,
#endif
	.poll =         fb_poll,
};

static unsigned int fb_poll(struct file *file, poll_table *wait)
{
	if (info->fbops->fb_poll)
		return (info->fbops->fb_poll(file, wait));
	return -EINVAL;
}

Also, poll is blocking.  You might want to include an .fasync entry too
for asynchronous I/O.

Finally, is the poll function too generic? I'm not sure about this but
basically we can only wait for events like 'there is data to read, it's
now okay to write', etc.  Is this too ambiguous?   Is it okay to define
a private event flag?  Or do we just agree that fb_poll means wait for
vretrace?

I know that there's already an overuse of ioctls, but for something
specific and important as this, we might not have a choice.

Tony

BTW:  It's not too difficult to add generic vsync interrupt handlers for
most VGA cards via register CR11. 




-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Vertical retrace interrupts?
  2003-01-30  2:34   ` Antonino Daplas
@ 2003-01-30 11:45     ` Michel Dänzer
  2003-01-30 23:22       ` Antonino Daplas
  2003-02-12 20:08       ` James Simmons
  0 siblings, 2 replies; 17+ messages in thread
From: Michel Dänzer @ 2003-01-30 11:45 UTC (permalink / raw)
  To: Antonino Daplas
  Cc: James Simmons, Fredrik Noring, Linux Fbdev development list

On Don, 2003-01-30 at 03:34, Antonino Daplas wrote:
> On Wed, 2003-01-29 at 03:21, James Simmons wrote:
> > 
> > > Are there any plans on merging DirectFB features? Stuff like vertical
> > > retrace interrupts etc.?
> 
> I wholeheartedly agree with this.  There are a lot of applications out
> there (especially video players) where vtrace signal delivery is
> critical for optimum operation.  Polling for VGA registers is not
> totally correct for newer cards and is too inefficient, so this has to
> be done at a per driver level.

Let me point out that the DRM in XFree86 4.3.0 and 2.5 kernels has a
generic ioctl which can block or send a signal on vertical blank
interrupts.


-- 
Earthling Michel Dänzer (MrCooper)/ Debian GNU/Linux (powerpc) developer
XFree86 and DRI project member   /  CS student, Free Software enthusiast



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Vertical retrace interrupts?
  2003-01-30 11:45     ` Michel Dänzer
@ 2003-01-30 23:22       ` Antonino Daplas
  2003-01-31  0:16         ` Fredrik Noring
  2003-01-31 11:24         ` Michel Dänzer
  2003-02-12 20:08       ` James Simmons
  1 sibling, 2 replies; 17+ messages in thread
From: Antonino Daplas @ 2003-01-30 23:22 UTC (permalink / raw)
  To: Michel Dänzer
  Cc: James Simmons, Fredrik Noring, Linux Fbdev development list

On Thu, 2003-01-30 at 19:45, Michel Dänzer wrote:
> On Don, 2003-01-30 at 03:34, Antonino Daplas wrote:
> > On Wed, 2003-01-29 at 03:21, James Simmons wrote:
> > > 
> > > > Are there any plans on merging DirectFB features? Stuff like vertical
> > > > retrace interrupts etc.?
> > 
> > I wholeheartedly agree with this.  There are a lot of applications out
> > there (especially video players) where vtrace signal delivery is
> > critical for optimum operation.  Polling for VGA registers is not
> > totally correct for newer cards and is too inefficient, so this has to
> > be done at a per driver level.
> 
> Let me point out that the DRM in XFree86 4.3.0 and 2.5 kernels has a
> generic ioctl which can block or send a signal on vertical blank
> interrupts.
> 
> 

Yes, I've seen the dri list archives, and adding support for this in
fbdev will result in code dupliation :-(.

However, at least 3 people have mailed me that they are using their
somewhat old pc as a set top box with mplayer, DirectFB and i810fb. No
X.  The image instability is noticeable because they are driving
big-screen TV's, especially because DirecFB is double-buffered, with
triple-buffering in the TODO list.  It's because of this that I have to
hack in vretrace signal delivary to i810fb.  There's also a similar
patch for matroxfb.


Tony




-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Vertical retrace interrupts?
  2003-01-30 23:22       ` Antonino Daplas
@ 2003-01-31  0:16         ` Fredrik Noring
  2003-01-31  1:35           ` Antonino Daplas
  2003-01-31 11:24         ` Michel Dänzer
  1 sibling, 1 reply; 17+ messages in thread
From: Fredrik Noring @ 2003-01-31  0:16 UTC (permalink / raw)
  To: Antonino Daplas
  Cc: Michel Dänzer, James Simmons, Linux Fbdev development list

Hi Antonino,

fre 2003-01-31 klockan 00.22 skrev Antonino Daplas:
> However, at least 3 people have mailed me that they are using their
> somewhat old pc as a set top box with mplayer, DirectFB and i810fb. No
> X.  The image instability is noticeable because they are driving
> big-screen TV's, especially because DirecFB is double-buffered, with
> triple-buffering in the TODO list.

I don't think vertical retrace synchronisation is strictly necessary 
for excellent video playback on low-grade systems. Reason is that I
believe most graphics cards delay the flip automatically in hardware
using shadow registers which load the real registers during retrace.

The software only needs to flip the buffers with approximately the same
frequency, and it'll work fine.

I've sent a few patches to the Xine (video player) developers to improve
the frame buffer driver and player. The new driver allocates as many
buffers as possible natively in video RAM. Thus, with a 16 MB TNT card
you'll get about 9 buffers at 768x576x32 (PAL DVD) resolution. That
should give the driver plenty of margins to deal with occasional
scheduling problems etc. because the only essential thing it needs to
do meanwhile is flipping buffers using the FBIOPAN_DISPLAY ioctl. This
can be done with the regular Linux kernel frame buffer drivers.

I think Xine being threaded (as compared with mplayer which is not) is
an advantage when implementing this. It's still work-in-progress but I
hope the theory will work out when I have the ability to do more
advanced tests than I've done so far. :)

	Fredrik




-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Vertical retrace interrupts?
  2003-01-31  0:16         ` Fredrik Noring
@ 2003-01-31  1:35           ` Antonino Daplas
  0 siblings, 0 replies; 17+ messages in thread
From: Antonino Daplas @ 2003-01-31  1:35 UTC (permalink / raw)
  To: Fredrik Noring
  Cc: Michel Dänzer, James Simmons, Linux Fbdev development list

On Fri, 2003-01-31 at 08:16, Fredrik Noring wrote:
> Hi Antonino,
> 
> fre 2003-01-31 klockan 00.22 skrev Antonino Daplas:
> > However, at least 3 people have mailed me that they are using their
> > somewhat old pc as a set top box with mplayer, DirectFB and i810fb. No
> > X.  The image instability is noticeable because they are driving
> > big-screen TV's, especially because DirecFB is double-buffered, with
> > triple-buffering in the TODO list.
> 
> I don't think vertical retrace synchronisation is strictly necessary 
> for excellent video playback on low-grade systems. Reason is that I
> believe most graphics cards delay the flip automatically in hardware
> using shadow registers which load the real registers during retrace.

This is true if you have triple, or more, buffers -- (buffer currently
being displayed, buffer waiting to be displayed, and buffer being
decoded to) and if the display refresh rate is faster than the video
frame frate.  In this case, you can just simply rely on the hardware
doing the actual buffer flip during vblank since you are guaranteed that
the next frame will not arrive until at least one vertical retrace
later.

With double buffers, you still need to synchronize with the retrace
signal, otherwise the video decoder will write to the buffer currently
being displayed (because the actual flip was delayed by the hardware). 
Polling for the VGA registers will be enough in most cases, but will not
work correctly with some hardware.
 
> 
> The software only needs to flip the buffers with approximately the same
> frequency, and it'll work fine.

Right, the software will flip the buffers at the correct frequency.
However, decoding will occur immediately after returning from the flip
command.

> 
> I've sent a few patches to the Xine (video player) developers to improve
> the frame buffer driver and player. The new driver allocates as many
> buffers as possible natively in video RAM. Thus, with a 16 MB TNT card
> you'll get about 9 buffers at 768x576x32 (PAL DVD) resolution. That
> should give the driver plenty of margins to deal with occasional
> scheduling problems etc. because the only essential thing it needs to
> do meanwhile is flipping buffers using the FBIOPAN_DISPLAY ioctl. This
> can be done with the regular Linux kernel frame buffer drivers.

Ahh, you have a lot of buffers here, so vretrace synchronization is not
a problem.  I was referring to DirectFB which is only double-buffered. 

Tony



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Vertical retrace interrupts?
  2003-01-30 23:22       ` Antonino Daplas
  2003-01-31  0:16         ` Fredrik Noring
@ 2003-01-31 11:24         ` Michel Dänzer
  2003-01-31 11:55           ` Ville Syrjälä
  2003-01-31 18:35           ` Antonino Daplas
  1 sibling, 2 replies; 17+ messages in thread
From: Michel Dänzer @ 2003-01-31 11:24 UTC (permalink / raw)
  To: Antonino Daplas; +Cc: Fredrik Noring, Linux Fbdev development list

On Fre, 2003-01-31 at 00:22, Antonino Daplas wrote:
> On Thu, 2003-01-30 at 19:45, Michel Dänzer wrote:
> > On Don, 2003-01-30 at 03:34, Antonino Daplas wrote:
> > > On Wed, 2003-01-29 at 03:21, James Simmons wrote:
> > > > 
> > > > > Are there any plans on merging DirectFB features? Stuff like vertical
> > > > > retrace interrupts etc.?
> > > 
> > > I wholeheartedly agree with this.  There are a lot of applications out
> > > there (especially video players) where vtrace signal delivery is
> > > critical for optimum operation.  Polling for VGA registers is not
> > > totally correct for newer cards and is too inefficient, so this has to
> > > be done at a per driver level.
> > 
> > Let me point out that the DRM in XFree86 4.3.0 and 2.5 kernels has a
> > generic ioctl which can block or send a signal on vertical blank
> > interrupts.
> 
> Yes, I've seen the dri list archives, and adding support for this in
> fbdev will result in code dupliation :-(.
> 
> However, at least 3 people have mailed me that they are using their
> somewhat old pc as a set top box with mplayer, DirectFB and i810fb. No
> X.

You don't need X to use the DRM, just some privileged client to
initialize it.


-- 
Earthling Michel Dänzer (MrCooper)/ Debian GNU/Linux (powerpc) developer
XFree86 and DRI project member   /  CS student, Free Software enthusiast



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Vertical retrace interrupts?
  2003-01-31 11:24         ` Michel Dänzer
@ 2003-01-31 11:55           ` Ville Syrjälä
  2003-01-31 18:35           ` Antonino Daplas
  1 sibling, 0 replies; 17+ messages in thread
From: Ville Syrjälä @ 2003-01-31 11:55 UTC (permalink / raw)
  To: Linux Fbdev development list

On Fri, Jan 31, 2003 at 12:24:33PM +0100, Michel Dänzer wrote:
> > Yes, I've seen the dri list archives, and adding support for this in
> > fbdev will result in code dupliation :-(.
> > 
> > However, at least 3 people have mailed me that they are using their
> > somewhat old pc as a set top box with mplayer, DirectFB and i810fb. No
> > X.
> 
> You don't need X to use the DRM, just some privileged client to
> initialize it.

It feels a bit silly to to use drm just for vsync interrupts. Besides
there are a lot of cards that don't have a drm driver but do have an fbdev
driver. IMHO fbdev is the logical place for this stuff.

-- 
Ville Syrjälä
syrjala@sci.fi
http://www.sci.fi/~syrjala/


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Vertical retrace interrupts?
  2003-01-31 11:24         ` Michel Dänzer
  2003-01-31 11:55           ` Ville Syrjälä
@ 2003-01-31 18:35           ` Antonino Daplas
  2003-01-31 19:12             ` Michel Dänzer
  1 sibling, 1 reply; 17+ messages in thread
From: Antonino Daplas @ 2003-01-31 18:35 UTC (permalink / raw)
  To: Michel Dänzer; +Cc: Fredrik Noring, Linux Fbdev development list

On Fri, 2003-01-31 at 19:24, Michel Dänzer wrote:
> 
> You don't need X to use the DRM, just some privileged client to
> initialize it.
> 

You're right.  I just realized that since DRM already has an interrupt
handler, it is unwise for fbdev to install its own interrupt handler
too, as this will fatally lock up the machine when DRM and fbdev are
loaded simultaneously.

So, how about this?  Let fbdev have its own vblank ioctl, but for fbdev
drivers with a DRM counterpart, fbdev will just call the DRM
wait_vblank() and send_vbl_signals() functions.   Do you think this is
doable, I haven't examined the code thoroughly?  

The main goal is too avoid having 2 independent interrupt handlers for
one device.

Tony 
 




-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Vertical retrace interrupts?
  2003-01-31 18:35           ` Antonino Daplas
@ 2003-01-31 19:12             ` Michel Dänzer
  2003-01-31 21:32               ` Sven Luther
  0 siblings, 1 reply; 17+ messages in thread
From: Michel Dänzer @ 2003-01-31 19:12 UTC (permalink / raw)
  To: Antonino Daplas; +Cc: Fredrik Noring, Linux Fbdev development list

On Fre, 2003-01-31 at 19:35, Antonino Daplas wrote:
> On Fri, 2003-01-31 at 19:24, Michel Dänzer wrote:
> > 
> > You don't need X to use the DRM, just some privileged client to
> > initialize it.
> 
> You're right.  I just realized that since DRM already has an interrupt
> handler, it is unwise for fbdev to install its own interrupt handler
> too, as this will fatally lock up the machine when DRM and fbdev are
> loaded simultaneously.
> 
> So, how about this?  Let fbdev have its own vblank ioctl, but for fbdev
> drivers with a DRM counterpart, fbdev will just call the DRM
> wait_vblank() and send_vbl_signals() functions.   Do you think this is
> doable, I haven't examined the code thoroughly?  
> 
> The main goal is too avoid having 2 independent interrupt handlers for
> one device.

A noble goal, but the framebuffer device would still need its own code
when the DRM isn't active, so I'm afraid there's no way around code
duplication, unless we could somehow factor out the common code for the
two to share?


-- 
Earthling Michel Dänzer (MrCooper)/ Debian GNU/Linux (powerpc) developer
XFree86 and DRI project member   /  CS student, Free Software enthusiast



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Vertical retrace interrupts?
  2003-01-31 19:12             ` Michel Dänzer
@ 2003-01-31 21:32               ` Sven Luther
  2003-01-31 23:34                 ` Antonino Daplas
  0 siblings, 1 reply; 17+ messages in thread
From: Sven Luther @ 2003-01-31 21:32 UTC (permalink / raw)
  To: Michel Dänzer
  Cc: Antonino Daplas, Fredrik Noring, Linux Fbdev development list

On Fri, Jan 31, 2003 at 08:12:16PM +0100, Michel Dänzer wrote:
> On Fre, 2003-01-31 at 19:35, Antonino Daplas wrote:
> > On Fri, 2003-01-31 at 19:24, Michel Dänzer wrote:
> > > 
> > > You don't need X to use the DRM, just some privileged client to
> > > initialize it.
> > 
> > You're right.  I just realized that since DRM already has an interrupt
> > handler, it is unwise for fbdev to install its own interrupt handler
> > too, as this will fatally lock up the machine when DRM and fbdev are
> > loaded simultaneously.
> > 
> > So, how about this?  Let fbdev have its own vblank ioctl, but for fbdev
> > drivers with a DRM counterpart, fbdev will just call the DRM
> > wait_vblank() and send_vbl_signals() functions.   Do you think this is
> > doable, I haven't examined the code thoroughly?  
> > 
> > The main goal is too avoid having 2 independent interrupt handlers for
> > one device.
> 
> A noble goal, but the framebuffer device would still need its own code
> when the DRM isn't active, so I'm afraid there's no way around code
> duplication, unless we could somehow factor out the common code for the
> two to share?

Could it not be that the fbdev sort of minimally intialize the DRM when
it is not already active ? After all, the fbdev knows as much, if not
more, than the X driver about the graphic chips state, especially if the
X driver is using the fbdev.

Friendly,

Sven Luther


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Vertical retrace interrupts?
  2003-01-31 21:32               ` Sven Luther
@ 2003-01-31 23:34                 ` Antonino Daplas
  2003-02-01 15:45                   ` Michel Dänzer
  0 siblings, 1 reply; 17+ messages in thread
From: Antonino Daplas @ 2003-01-31 23:34 UTC (permalink / raw)
  To: Sven Luther
  Cc: Michel Dänzer, Fredrik Noring, Linux Fbdev development list

On Sat, 2003-02-01 at 05:32, Sven Luther wrote:
> On Fri, Jan 31, 2003 at 08:12:16PM +0100, Michel Dänzer wrote:
> > On Fre, 2003-01-31 at 19:35, Antonino Daplas wrote:
> > > On Fri, 2003-01-31 at 19:24, Michel Dänzer wrote:
> > > > 
> > > > You don't need X to use the DRM, just some privileged client to
> > > > initialize it.
> > > 
> > > You're right.  I just realized that since DRM already has an interrupt
> > > handler, it is unwise for fbdev to install its own interrupt handler
> > > too, as this will fatally lock up the machine when DRM and fbdev are
> > > loaded simultaneously.
> > > 
> > > So, how about this?  Let fbdev have its own vblank ioctl, but for fbdev
> > > drivers with a DRM counterpart, fbdev will just call the DRM
> > > wait_vblank() and send_vbl_signals() functions.   Do you think this is
> > > doable, I haven't examined the code thoroughly?  
> > > 
> > > The main goal is too avoid having 2 independent interrupt handlers for
> > > one device.
> > 
> > A noble goal, but the framebuffer device would still need its own code
> > when the DRM isn't active, so I'm afraid there's no way around code
> > duplication, unless we could somehow factor out the common code for the
> > two to share?

The fbdev driver will automatically load the DRM module when it refers
to any exportable symbol of DRM.  We can also make the fbdev drivers
specifically depend on DRM in Kconfig so users don't accidentally
compile fbdev without its DRM counterpart.

The aim is not to avoid code duplication, although that is a plus, it's
two independent handlers clashing and locking up the machine.

> 
> Could it not be that the fbdev sort of minimally intialize the DRM when
> it is not already active ? After all, the fbdev knows as much, if not
> more, than the X driver about the graphic chips state, especially if the
> X driver is using the fbdev.
> 

I was wondering about this to.  How much initialization is required?  Is
it not enough to just load the DRM module?

Also, we have fbdev drivers that are incompatible with DRM, so having
fbdev load DRM is like telling it to commit suicide :-)

Tony




-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Vertical retrace interrupts?
  2003-01-31 23:34                 ` Antonino Daplas
@ 2003-02-01 15:45                   ` Michel Dänzer
  2003-02-01 16:50                     ` Antonino Daplas
  0 siblings, 1 reply; 17+ messages in thread
From: Michel Dänzer @ 2003-02-01 15:45 UTC (permalink / raw)
  To: Antonino Daplas; +Cc: Sven Luther, Fredrik Noring, Linux Fbdev development list

On Sam, 2003-02-01 at 00:34, Antonino Daplas wrote: 
> On Sat, 2003-02-01 at 05:32, Sven Luther wrote:
> > On Fri, Jan 31, 2003 at 08:12:16PM +0100, Michel Dänzer wrote:
> > > On Fre, 2003-01-31 at 19:35, Antonino Daplas wrote:
> > > > On Fri, 2003-01-31 at 19:24, Michel Dänzer wrote:
> > > > > 
> > > > > You don't need X to use the DRM, just some privileged client to
> > > > > initialize it.
> > > > 
> > > > You're right.  I just realized that since DRM already has an interrupt
> > > > handler, it is unwise for fbdev to install its own interrupt handler
> > > > too, as this will fatally lock up the machine when DRM and fbdev are
> > > > loaded simultaneously.
> > > > 
> > > > So, how about this?  Let fbdev have its own vblank ioctl, but for fbdev
> > > > drivers with a DRM counterpart, fbdev will just call the DRM
> > > > wait_vblank() and send_vbl_signals() functions.   Do you think this is
> > > > doable, I haven't examined the code thoroughly?  
> > > > 
> > > > The main goal is too avoid having 2 independent interrupt handlers for
> > > > one device.
> > > 
> > > A noble goal, but the framebuffer device would still need its own code
> > > when the DRM isn't active, so I'm afraid there's no way around code
> > > duplication, unless we could somehow factor out the common code for the
> > > two to share?
> 
> The fbdev driver will automatically load the DRM module when it refers
> to any exportable symbol of DRM.  We can also make the fbdev drivers
> specifically depend on DRM in Kconfig so users don't accidentally
> compile fbdev without its DRM counterpart.

I wonder if people will like having to build the DRM for a framebuffer
device... a solution where one component uses the other if it's there,
but works without it otherwise, might be better.

> The aim is not to avoid code duplication, although that is a plus, it's
> two independent handlers clashing and locking up the machine.

I'm not sure it would be that bad, but certainly suboptimal. :)


> > Could it not be that the fbdev sort of minimally intialize the DRM when
> > it is not already active ? After all, the fbdev knows as much, if not
> > more, than the X driver about the graphic chips state, especially if the
> > X driver is using the fbdev.
> 
> I was wondering about this to.  How much initialization is required?  Is
> it not enough to just load the DRM module?

No. The DRM_INST_HANDLER ioctl needs to be called to make the IRQs work,
and I suspect more needs to be done before that.

> Also, we have fbdev drivers that are incompatible with DRM, so having
> fbdev load DRM is like telling it to commit suicide :-)

Out of curiosity, is that about i8xx?


-- 
Earthling Michel Dänzer (MrCooper)/ Debian GNU/Linux (powerpc) developer
XFree86 and DRI project member   /  CS student, Free Software enthusiast



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Vertical retrace interrupts?
  2003-02-01 15:45                   ` Michel Dänzer
@ 2003-02-01 16:50                     ` Antonino Daplas
  2003-02-12 20:21                       ` James Simmons
  0 siblings, 1 reply; 17+ messages in thread
From: Antonino Daplas @ 2003-02-01 16:50 UTC (permalink / raw)
  To: Michel Dänzer
  Cc: Sven Luther, Fredrik Noring, Linux Fbdev development list

On Sat, 2003-02-01 at 23:45, Michel Dänzer wrote:
[snip]
> > 
> > The fbdev driver will automatically load the DRM module when it refers
> > to any exportable symbol of DRM.  We can also make the fbdev drivers
> > specifically depend on DRM in Kconfig so users don't accidentally
> > compile fbdev without its DRM counterpart.
> 
> I wonder if people will like having to build the DRM for a framebuffer
> device... a solution where one component uses the other if it's there,
> but works without it otherwise, might be better.
> 
Yes, your suggestion is better.  I did browse the dri code, and my
feeling is drm is coded for userspace clients without any usable hooks
for clients residing in kernel space. I'm still wondering how to access
DRM services from kernel space.  

> > The aim is not to avoid code duplication, although that is a plus, it's
> > two independent handlers clashing and locking up the machine.
> 
> I'm not sure it would be that bad, but certainly suboptimal. :)
> 

It will be bad.  The handler that gets loaded first will receive the
interrupt signal first.  It will, by necessity, clear the registers of
the event it's watching for to reenable the interrupt.  So when it's the
second handler's turn, and if it is also watching for the same event,
then it will falsely assume that the event never happened.  At worst,
the second handler will wait indefinitely for an event that will never
arrive, at best it will time out and send false information.

> 
> > > Could it not be that the fbdev sort of minimally intialize the DRM when
> > > it is not already active ? After all, the fbdev knows as much, if not
> > > more, than the X driver about the graphic chips state, especially if the
> > > X driver is using the fbdev.
> > 
> > I was wondering about this to.  How much initialization is required?  Is
> > it not enough to just load the DRM module?
> 
> No. The DRM_INST_HANDLER ioctl needs to be called to make the IRQs work,
> and I suspect more needs to be done before that.
> 

Yes, I also realized that.  My feeling is if James or Geert do agree to
add support for this, fbdev will just have to duplicate the code, taking
care that another handler may exist, or DRM will be rewritten so the
interrupt handling can be shared or made available to other modules, as
you suggested.

> > Also, we have fbdev drivers that are incompatible with DRM, so having
> > fbdev load DRM is like telling it to commit suicide :-)
> 
> Out of curiosity, is that about i8xx?
> 

No, the i810fb driver is compatible with X and DRM.  

Tony




-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Vertical retrace interrupts?
  2003-01-30 11:45     ` Michel Dänzer
  2003-01-30 23:22       ` Antonino Daplas
@ 2003-02-12 20:08       ` James Simmons
  1 sibling, 0 replies; 17+ messages in thread
From: James Simmons @ 2003-02-12 20:08 UTC (permalink / raw)
  To: Michel Dänzer
  Cc: Antonino Daplas, Fredrik Noring, Linux Fbdev development list


> Let me point out that the DRM in XFree86 4.3.0 and 2.5 kernels has a
> generic ioctl which can block or send a signal on vertical blank
> interrupts.

Nice :-)



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Vertical retrace interrupts?
  2003-02-01 16:50                     ` Antonino Daplas
@ 2003-02-12 20:21                       ` James Simmons
  0 siblings, 0 replies; 17+ messages in thread
From: James Simmons @ 2003-02-12 20:21 UTC (permalink / raw)
  To: Antonino Daplas
  Cc: Michel Dänzer, Sven Luther, Fredrik Noring,
	Linux Fbdev development list


> > I wonder if people will like having to build the DRM for a framebuffer
> > device... a solution where one component uses the other if it's there,
> > but works without it otherwise, might be better.
> > 
> Yes, your suggestion is better.  I did browse the dri code, and my
> feeling is drm is coded for userspace clients without any usable hooks
> for clients residing in kernel space. I'm still wondering how to access
> DRM services from kernel space.  

I have to agree. For most platforms fbdev is a needed. You could view DRM 
as a power extenstion to fbdev. Well that is how I view it. If we have DRM 
enabled we can enable more features in fbdev.




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2003-02-12 20:22 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-26  1:51 Vertical retrace interrupts? Fredrik Noring
2003-01-28 19:21 ` James Simmons
2003-01-30  2:34   ` Antonino Daplas
2003-01-30 11:45     ` Michel Dänzer
2003-01-30 23:22       ` Antonino Daplas
2003-01-31  0:16         ` Fredrik Noring
2003-01-31  1:35           ` Antonino Daplas
2003-01-31 11:24         ` Michel Dänzer
2003-01-31 11:55           ` Ville Syrjälä
2003-01-31 18:35           ` Antonino Daplas
2003-01-31 19:12             ` Michel Dänzer
2003-01-31 21:32               ` Sven Luther
2003-01-31 23:34                 ` Antonino Daplas
2003-02-01 15:45                   ` Michel Dänzer
2003-02-01 16:50                     ` Antonino Daplas
2003-02-12 20:21                       ` James Simmons
2003-02-12 20:08       ` James Simmons

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).