2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Release the bitter from private usage
10 #include <aros/debug.h>
12 #include <proto/exec.h>
13 #include <graphics/gfxbase.h>
14 #include <exec/tasks.h>
16 #include "graphics_intern.h"
17 #include "gfxfuncsupport.h"
19 /*****************************************************************************
22 #include <proto/graphics.h>
24 AROS_LH0(void, DisownBlitter
,
30 struct GfxBase
*, GfxBase
, 77, Graphics
)
33 The blitter is returned to usage by other tasks.
52 ******************************************************************************/
56 /* Debugging disabled, this function must be callable from blitter interrupt.
57 * FIXME: better solution?
61 struct Task
*me
= FindTask(NULL
);
63 D(bug("DisownBlitter: Release by Task %p\n", me
));
65 if (GfxBase
->BlitOwner
!= me
) {
66 D(bug("DisownBlitter: Owned by Task %p, but Task %p is releasing it!\n",
67 GfxBase
->BlitOwner
, me
));
70 if (NULL
!= GfxBase
->blthd
&& NULL
!= GfxBase
->bsblthd
)
72 D(bug("DisownBlitter: OOPS! Disowning while queued enties are in play!\n"));
78 GfxBase
->BlitOwner
= NULL
;
79 /* Do we have any waiting tasks? */
80 if (!IsListEmpty(&GfxBase
->BlitWaitQ
)) {
81 /* Wake up next OwnBlitter() waiting task */
82 struct BlitWaitQNode
*node
= (struct BlitWaitQNode
*)GfxBase
->BlitWaitQ
.lh_Head
;
83 D(bug("DisownBlitter: Waking task %p\n", node
->task
));
84 Signal(node
->task
, 1 << SIGB_BLIT
);
90 D(bug("DisownBlitter: Released by Task %p\n", me
));