On Sat, 27 Oct 2001, Manuel Teira wrote:

> El Sáb 27 Oct 2001 19:49, Leif Delgass escribió:
> > Well, I just got my box to hang hard (like with the vt switching) when
> > running tuxracer and switching modes with Ctrl-Alt-+ (I have 3 modes
> > defined in my config and the hang happened when looping back to the
> > original mode, i.e. the third switch), so I think the
> > answer is yes, it needs locking.  I really should use a journalling
> > filesystem, all this fsck-ing is getting a bit tedious. ;)
> >
> 
> OK. I have added the DRILock/Unlock to the AtiModeSet function in the 
> atimode.c file. I've added another condition (also to the locks in the 
> aticonsole.c file for vt changing) in this way:

It looks like ATIEnter/LeaveVT calls ATIEnter/LeaveGraphics, which in turn
calls ATIModeSet.  Won't this lead to trying to obtain a lock when the
lock is already secured?  It might be better to put the lock in
aticonsole.c in the ATIModeSwitch function.
 
> #ifdef XF86DRI
>     if (pATI->Chip >= ATI_CHIP_264GT &&
>         pATI->directRenderingEnabled)
>     {
>         DRILock(pScreen,0);
>     }
> #endif
> ...
> #ifdef XF86DRI
>     if (pATI->Chip >= ATI_CHIP_264GT &&
>         pATI->directRenderingEnabled)
>     {
>         DRIUnlock(pScreen);
>     }
> #endif
> 
> 
> I think this is a better way because the code in aticonsole.c and atimode.c 
> is generic for all the ATI adapters, so we are restricting the checking to 
> the Mach64 chips greater than the GT that is the first one (if I'm not 
> mistaken) supporting 3D.

Yep, that looks better.

> I'm also changing the related macros for locking the 2D accelerated functions.

OK.  I'm attaching a small patch that defines and uses a convenience macro
used by the other drm drivers (LOCK_TEST_WITH_RETURN).  We can use this
when we add more ioctls.  The patch also includes the FIFO size defines,
but you can just say no to that and delete the .rej file.

Another thing I noticed is that all the other 2D/dri drivers notify the 
xf86 module loader about DRI/DRM symbols using [xf86]LoaderRefSymLists, in 
addition to other symbols (see R128PreInit in r128_driver.c for an 
example).  I can't find anywhere that the ati/mach64 driver does this, but 
it doesn't seem to be causing any problems.

On a totally unrelated note, do you know how to get etags to index K&R 
style functions like the ones in aticonsole.c?

-- 
Leif Delgass 

m64-locking-macro.patch.gz

Reply via email to