2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Release the bitter from private usage
9 #include <aros/debug.h>
11 #include <proto/exec.h>
12 #include <graphics/gfxbase.h>
13 #include <exec/tasks.h>
15 #include "graphics_intern.h"
16 #include "gfxfuncsupport.h"
18 /*****************************************************************************
21 #include <proto/graphics.h>
23 AROS_LH0(void, DisownBlitter
,
29 struct GfxBase
*, GfxBase
, 77, Graphics
)
32 The blitter is returned to usage by other tasks.
51 ******************************************************************************/
55 /* Debugging disabled, this function must be callable from blitter interrupt.
56 * FIXME: better solution?
60 struct Task
*me
= FindTask(NULL
);
62 D(bug("DisownBlitter: Release by Task %p\n", me
));
64 if (GfxBase
->BlitOwner
!= me
) {
65 D(bug("DisownBlitter: Owned by Task %p, but Task %p is releasing it!\n",
66 GfxBase
->BlitOwner
, me
));
69 if (NULL
!= GfxBase
->blthd
&& NULL
!= GfxBase
->bsblthd
)
71 D(bug("DisownBlitter: OOPS! Disowning while queued enties are in play!\n"));
77 GfxBase
->BlitOwner
= NULL
;
78 /* Do we have any waiting tasks? */
79 if (!IsListEmpty(&GfxBase
->BlitWaitQ
)) {
80 /* Wake up next OwnBlitter() waiting task */
81 struct BlitWaitQNode
*node
= (struct BlitWaitQNode
*)GfxBase
->BlitWaitQ
.lh_Head
;
82 D(bug("DisownBlitter: Waking task %p\n", node
->task
));
83 Signal(node
->task
, 1 << SIGB_BLIT
);
89 D(bug("DisownBlitter: Released by Task %p\n", me
));