summaryrefslogtreecommitdiff
path: root/display/res.c
diff options
context:
space:
mode:
Diffstat (limited to 'display/res.c')
-rw-r--r--display/res.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/display/res.c b/display/res.c
index 7515424..5dc72c5 100644
--- a/display/res.c
+++ b/display/res.c
@@ -78,12 +78,12 @@ static BOOL SetClip(PDev *pdev, CLIPOBJ *clip, QXLDrawable *drawable);
#define PUSH_CMD(pdev) do { \
int notify; \
- EngAcquireSemaphore(pdev->cmd_sem); \
+ EngAcquireSemaphore(pdev->Res->cmd_sem); \
SPICE_RING_PUSH(pdev->cmd_ring, notify); \
if (notify) { \
WRITE_PORT_UCHAR(pdev->notify_cmd_port, 0); \
} \
- EngReleaseSemaphore(pdev->cmd_sem); \
+ EngReleaseSemaphore(pdev->Res->cmd_sem); \
} while (0);
#define PUSH_CURSOR_CMD(pdev) do { \
@@ -391,6 +391,14 @@ void CleanGlobalRes()
EngDeleteSemaphore(res->malloc_sem);
res->malloc_sem = NULL;
}
+ if (res->cmd_sem) {
+ EngDeleteSemaphore(res->cmd_sem);
+ res->cmd_sem = NULL;
+ }
+ if (res->print_sem) {
+ EngDeleteSemaphore(res->print_sem);
+ res->print_sem = NULL;
+ }
EngFreeMem(res);
}
}
@@ -440,6 +448,14 @@ static void InitRes(PDev *pdev)
if (!pdev->Res->malloc_sem) {
PANIC(pdev, "Res malloc sem creation failed\n");
}
+ pdev->Res->cmd_sem = EngCreateSemaphore();
+ if (!pdev->Res->cmd_sem) {
+ PANIC(pdev, "Res cmd sem creation failed\n");
+ }
+ pdev->Res->print_sem = EngCreateSemaphore();
+ if (!pdev->Res->print_sem) {
+ PANIC(pdev, "Res print sem creation failed\n");
+ }
InitMspace(pdev->Res, MSPACE_TYPE_DEVRAM, pdev->io_pages_virt, pdev->num_io_pages * PAGE_SIZE);
InitMspace(pdev->Res, MSPACE_TYPE_VRAM, pdev->fb, pdev->fb_size);