On Don, 2002-01-31 at 19:50, Vladimir Dergachev wrote:
>
> On 31 Jan 2002, Michel [ISO-8859-1] D�nzer wrote:
>
> > On Mit, 2002-01-30 at 15:56, Vladimir Dergachev wrote:
> > >
> > > On Wed, 30 Jan 2002, Vladimir Dergachev wrote:
> > >
> > > > http://gatos.sf.net/ - they were there last time I submitted a patch.. but
> > > > it did not get in. Just to make sure I am not pulling your leg.. Yep, they
> > > > are there: search for R128WaitForIdle(pScrn) function.
> > >
> > > I've implemented this (easier than software CCE) scheme. If you want to
> > > please try the latest ati.2 CVS code at http://gatos.sf.net - or just take
> > > a look at it.
> >
> > I will.
> >
> > > Basically I put in info->accel->Sync(pScrn) at entrance points into Xv
> > > driver. SetupImageVideo, StopVideo, SetPortAttribute, GetPortAttribute and
> > > PutVideo are all "control" calls, perfomance is not critical. PutImage
> > > should, arguably, take more time during image trasfer.. And if you are
> > > playing Quake and watching DVD at the same you are making problems for
> > > yourself anyway ;) (And the faster the card the less noticable any
> > > slowdown from extra Sync calls will be)
> >
> > How does this interact with the CCE being used for the image transfer in
> > PutImage (if at all)?
>
> Not much. We are waiting for the card to finish doing whatever it was
> doing and only then we start the transfer. The only difference is that we
> wait for quiescence the right way.
Okay, I've looked at the GATOS CVS and tried the same Sync() calls. Has
been working fine on this PowerBook, but then I rarely ever experienced
crashes with it. Unfortunately, it doesn't seem to help the Rage128 Pro
card at work at all. I wonder if Xv is broken for Rage128 Pro?
Davor, does this patch fix the crashes? Peter, does the change in
r128_dri.c really fix the corruption (you said 'mostly' in a post)?
--
Earthling Michel D�nzer (MrCooper)/ Debian GNU/Linux (powerpc) developer
XFree86 and DRI project member / CS student, Free Software enthusiast
Index: r128_accel.c
===================================================================
RCS file: /cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_accel.c,v
retrieving revision 1.17
diff -u -r1.17 r128_accel.c
--- r128_accel.c 2002/01/27 20:05:30 1.17
+++ r128_accel.c 2002/02/03 01:58:17
@@ -231,6 +231,11 @@
R128InfoPtr info = R128PTR(pScrn);
int ret;
+ if(!info->CCEInUse){
+ R128WaitForIdle(pScrn);
+ return;
+ }
+
FLUSH_RING();
for (;;) {
Index: r128_video.c
===================================================================
RCS file: /cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_video.c,v
retrieving revision 1.11
diff -u -r1.11 r128_video.c
--- r128_video.c 2002/01/27 20:05:31 1.11
+++ r128_video.c 2002/02/03 01:58:21
@@ -208,6 +208,8 @@
R128PortPrivPtr pPriv;
XF86VideoAdaptorPtr adapt;
+ info->accel->Sync(pScrn);
+
if(!(adapt = R128AllocAdaptor(pScrn)))
return NULL;
@@ -372,6 +374,8 @@
unsigned char *R128MMIO = info->MMIO;
R128PortPrivPtr pPriv = (R128PortPrivPtr)data;
+ info->accel->Sync(pScrn);
+
REGION_EMPTY(pScrn->pScreen, &pPriv->clip);
if(cleanup) {
@@ -402,6 +406,8 @@
unsigned char *R128MMIO = info->MMIO;
R128PortPrivPtr pPriv = (R128PortPrivPtr)data;
+ info->accel->Sync(pScrn);
+
if(attribute == xvBrightness) {
if((value < -64) || (value > 63))
return BadValue;
@@ -443,6 +449,9 @@
pointer data
){
R128PortPrivPtr pPriv = (R128PortPrivPtr)data;
+ R128InfoPtr info = R128PTR(pScrn);
+
+ info->accel->Sync(pScrn);
if(attribute == xvBrightness) {
*value = pPriv->brightness;
@@ -746,6 +755,8 @@
left = (left >> 16) & 7;
+ info->accel->Sync(pScrn);
+
OUTREG(R128_OV0_REG_LOAD_CNTL, 1);
while(!(INREG(R128_OV0_REG_LOAD_CNTL) & (1 << 3)));
@@ -823,6 +834,8 @@
leftUV = (left >> 17) & 15;
left = (left >> 16) & 15;
+ info->accel->Sync(pScrn);
+
OUTREG(R128_OV0_REG_LOAD_CNTL, 1);
while(!(INREG(R128_OV0_REG_LOAD_CNTL) & (1 << 3)));
@@ -876,6 +889,8 @@
BoxRec dstBox;
CARD32 tmp;
+ info->accel->Sync(pScrn);
+
/*
* s1offset, s2offset, s3offset - byte offsets to the Y, U and V planes
* of the source.
@@ -1106,6 +1121,7 @@
if(pPriv->videoStatus & OFF_TIMER) {
if(pPriv->offTime < now) {
unsigned char *R128MMIO = info->MMIO;
+ info->accel->Sync(pScrn);
OUTREG(R128_OV0_SCALE_CNTL, 0);
pPriv->videoStatus = FREE_TIMER;
pPriv->freeTime = now + FREE_DELAY;
Index: r128_dri.c
===================================================================
RCS file: /cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c,v
retrieving revision 1.28
diff -u -r1.28 r128_dri.c
--- r128_dri.c 2002/01/27 20:05:30 1.28
+++ r128_dri.c 2002/02/03 02:44:22
@@ -300,14 +300,16 @@
unsigned char *R128MMIO = info->MMIO;
if (!info->directRenderingEnabled) {
- if (!info->CCEInUse) {
- /* Save all hardware scissors */
- info->sc_left = INREG(R128_SC_LEFT);
- info->sc_right = INREG(R128_SC_RIGHT);
- info->sc_top = INREG(R128_SC_TOP);
- info->sc_bottom = INREG(R128_SC_BOTTOM);
- info->aux_sc_cntl = INREG(R128_SC_BOTTOM);
- }
+ /* Save all hardware scissors */
+ info->sc_left = INREG(R128_SC_LEFT);
+ info->sc_right = INREG(R128_SC_RIGHT);
+ info->sc_top = INREG(R128_SC_TOP);
+ info->sc_bottom = INREG(R128_SC_BOTTOM);
+ info->aux_sc_cntl = INREG(R128_SC_BOTTOM);
+ } else if (info->CCEInUse) {
+ R128CCEReleaseIndirect(pScrn);
+
+ info->CCEInUse = FALSE;
}
}