Re: [Xpert]The trouble when two Xv programe are running at the sametime

2001-11-22 Thread Paul Robertson

This subject has come up several times recently.
Matt Sottek provided an useful analogy comparing the overlay port to a
projector. Well it helped me anyway.
Think about the effect of moving the projector to point to a different part
of the screen.

Paul Robertson


___
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert



Re: [Xpert]The trouble when two Xv programe are running at the sametime

2001-11-22 Thread Kevin Brosius

Michel Dänzer wrote:
> 
> 
> On Thu, 2001-11-22 at 13:48, Peter Surda wrote:
> > On Thu, Nov 22, 2001 at 11:50:19AM +0100, Michel Dänzer wrote:
> > > > Or am I missing something here (as usually )?
> > > Yes, only one image can be displayed at a time per port so why bother.
> > How "displayed"? If the image is already on the visible part of the screen,
> > does it magically disappear when you tell the card to do
> > scaling/conversion/drawing into another window? If it did, that would be "a
> > really stupid thing" (TM). Are you sure this "magical disappearance" is caused
> > by card's hardware and not some X obscurity?
> 
> Yes, that's hiw an overlay works. May be different for Xv adaptors using
> the texture engine or similar, but I don't think that changes the
> semantics of an Xv port.
> 

Xv currently supports one port which is tied to the hardware as you
mention.  At the moment, one window is programmed for the overlay, and
the implementation only supports one window on hardware which only has
one set of overlay registers.  Thinking about it a little, I suspect it
may be possible to do multiple windows, since overlay usually uses color
keying to determine which portions overlay.  You'd need to merge the
window regions, plus handle overlap of the display data correctly prior
to copying, and then only color key for the displayable regions.  Seems
doable on the S3 Virge series, for example, although we'd have memory
problems if the regions are to big.  There may be other reasons why it's
undesirable...

-- 
Kevin
___
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert



Re: [Xpert]The trouble when two Xv programe are running at the sametime

2001-11-22 Thread Michel Dänzer

On Thu, 2001-11-22 at 13:48, Peter Surda wrote:
> On Thu, Nov 22, 2001 at 11:50:19AM +0100, Michel Dänzer wrote:
> > > Or am I missing something here (as usually )?
> > Yes, only one image can be displayed at a time per port so why bother.
> How "displayed"? If the image is already on the visible part of the screen,
> does it magically disappear when you tell the card to do
> scaling/conversion/drawing into another window? If it did, that would be "a
> really stupid thing" (TM). Are you sure this "magical disappearance" is caused
> by card's hardware and not some X obscurity?

Yes, that's hiw an overlay works. May be different for Xv adaptors using
the texture engine or similar, but I don't think that changes the
semantics of an Xv port.


-- 
Earthling Michel Dänzer (MrCooper)/ Debian GNU/Linux (powerpc) developer
XFree86 and DRI project member   /  CS student, Free Software enthusiast
___
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert



Re: [Xpert]The trouble when two Xv programe are running at the sametime

2001-11-22 Thread Michel Dänzer

On Thu, 2001-11-22 at 10:42, Peter Surda wrote:
> On Wed, Nov 21, 2001 at 11:50:57AM -0800, Mark Vojkovich wrote:
> >This is an application bug.  Apps are supposed to Grab the
> > port when they want to use it so noone else can.  When an app
> > tries to grab the port and finds that it is already grabbed
> > it will know that it is in use and it should fall back to some
> > other method to display the video.   When the apps do not grab
> > the port they are using, continual preempting of each other's
> > video is the expected behavior.
> Hmm, does it really have to be like this? From my understanding of how
> XvShmPutImage is implemented on most cards, there should be a way to implement
> this reasonably:
> 
> - make sure when allocating offscreen memory for data that it doesn't overlap
> - make sure when *CopyData422/420 are using DMA that only 1 DMA transfer
>   happens at a time (dunno, is this really necessary?)
> - make sure calling *DisplayVideo422/420 only happens once at a time (from my
>   experience this takes an insignificant amount of time => chance that these 2
>   will overlap is low => can be ignored
> 
> So, in theory, making sure the allocated memory segments don't overlap should
> be enough. As the CopyData422/420 takes almost all the time of the PutImage
> function, there shouldn't be any strage slowdown besides lineary proportional
> to the amount of data transferred (i.e. image size*depth).
> 
> Or am I missing something here (as usually )?

Yes, only one image can be displayed at a time per port so why bother.


-- 
Earthling Michel Dänzer (MrCooper)/ Debian GNU/Linux (powerpc) developer
XFree86 and DRI project member   /  CS student, Free Software enthusiast
___
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert



Re: [Xpert]The trouble when two Xv programe are running at the sametime

2001-11-21 Thread hzeng

Hi Mark,
Thank you very much.
It's just the grabport is lost when  I change the source code.
Thanks again
Hzeng 

- Original Message - 
From: Mark Vojkovich <[EMAIL PROTECTED]>
To: hzeng <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, November 22, 2001 3:50 AM
Subject: Re: [Xpert]The trouble when two Xv programe are running at the sametime


> On Wed, 21 Nov 2001, hzeng wrote:
> 
> > Hi,
> > I'm writting a Xv driver. I meet a trouble and I don't know how to
> > deal with it. When two app useing Xv
> > are running at the same time, such as Xine, they all use the my PutImage
> > founction, and they send the Xv driver with the same port index, so they
> > will do the same thing use my Xv driver and they will rap resource.I
> > don't know where and how to differ the two Xine which are running in my
> > Xv driver, so I have to watch them rendering in the screen disorderly
> > but do nothing.How can I deal with these situation?
> > Thanks a lot!
> > Hzeng
> 
>This is an application bug.  Apps are supposed to Grab the
> port when they want to use it so noone else can.  When an app
> tries to grab the port and finds that it is already grabbed
> it will know that it is in use and it should fall back to some
> other method to display the video.   When the apps do not grab
> the port they are using, continual preempting of each other's
> video is the expected behavior.
> 
> 
> Mark.
___
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert



Re: [Xpert]The trouble when two Xv programe are running at the sametime

2001-11-21 Thread Mark Vojkovich

On Wed, 21 Nov 2001, hzeng wrote:

> Hi,
> I'm writting a Xv driver. I meet a trouble and I don't know how to
> deal with it. When two app useing Xv
> are running at the same time, such as Xine, they all use the my PutImage
> founction, and they send the Xv driver with the same port index, so they
> will do the same thing use my Xv driver and they will rap resource.I
> don't know where and how to differ the two Xine which are running in my
> Xv driver, so I have to watch them rendering in the screen disorderly
> but do nothing.How can I deal with these situation?
> Thanks a lot!
> Hzeng

   This is an application bug.  Apps are supposed to Grab the
port when they want to use it so noone else can.  When an app
tries to grab the port and finds that it is already grabbed
it will know that it is in use and it should fall back to some
other method to display the video.   When the apps do not grab
the port they are using, continual preempting of each other's
video is the expected behavior.


Mark.

___
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert