Added missing properties.
[AROS.git] / rom / graphics / disownblitter.c
blob9b53cd38ef231de4c7e762e5bd89f0bfcedb887e
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Release the bitter from private usage
6 Lang: english
7 */
9 #define DEBUG 0
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 /*****************************************************************************
21 NAME */
22 #include <proto/graphics.h>
24 AROS_LH0(void, DisownBlitter,
26 /* SYNOPSIS */
29 /* LOCATION */
30 struct GfxBase *, GfxBase, 77, Graphics)
32 /* FUNCTION
33 The blitter is returned to usage by other tasks.
35 INPUTS
37 RESULT
39 NOTES
41 EXAMPLE
43 BUGS
45 SEE ALSO
46 DisownBlitter()
48 INTERNALS
50 HISTORY
52 ******************************************************************************/
54 AROS_LIBFUNC_INIT
56 /* Debugging disabled, this function must be callable from blitter interrupt.
57 * FIXME: better solution?
60 #if 0
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"));
74 #endif
76 Disable();
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);
87 Enable();
89 #if 0
90 D(bug("DisownBlitter: Released by Task %p\n", me));
91 #endif
93 AROS_LIBFUNC_EXIT
94 } /* DisownBlitter */