El Sáb 27 Oct 2001 21:40, Leif Delgass escribió:
> 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.

You are right, I was deadlocking the server. Anyway, the idea is that
ATIModeSet has to Lock and Unlock, but ATIEnterVT(LeaveVT) has only to
Unlock(Lock) the DRM. We could Lock/Unlock  in  ATISwitchMode, but I think
that we are locking more that needed, because the ATIModeCalculate that is
also called from ATISwitchMode doesn't need to be locked.

I think that the better way to do this is:

ATIEnterVT: Unlock  at the end of the Function (to avoid interlocks)
ATILeaveVT: Lock at the end of the Function (to avoid interlocks)
ATIModeSet: Lock at the beginning and Unlock at the end.

What do you thing about this?


> 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.
All right. I've commited the changes to the CVS branch yet, but I have to fix
the deadlock you've found, so, I'll also send the changes you've sent me.

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


_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to