~ubuntu-branches/debian/stretch/spice/stretch

« back to all changes in this revision

Viewing changes to server/red_worker.h

  • Committer: Package Import Robot
  • Author(s): Liang Guo, Liang Guo, Michael Tokarev
  • Date: 2011-11-29 14:37:08 UTC
  • mfrom: (0.6.1) (0.4.2) (2.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20111129143708-jptkxyjl3a4rds2r
Tags: 0.10.0-1
[ Liang Guo ]
* New upstream release (Closes: #651262)
* Refresh debian/copyright
* Remove fix-typo-in-cmd_line_parser-cpp.patch, applied upstream
* Remove fix-typo-in-record-cpp.patch, applied upstream
* Remove use-requires-private-for-libspice-pkgconfig.patch, applied upstream
* Change Build-Depends on libspice-protocol-dev to (>= 0.9.1~)
* Refresh libspice-server1.symbols
* Update debian/rules clean target
* Ignore common/win/my_getopt-1.5/Makefile change when building package
* debian/control: set DMUA

[ Michael Tokarev ]
* use `rm -f' instead of `-rm' in debian/rules clean targets
* remove python_modules/*.pyc in clean target

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#ifndef _H_REDWORKER
19
19
#define _H_REDWORKER
20
20
 
 
21
#include <unistd.h>
 
22
#include <errno.h>
21
23
#include "red_common.h"
22
24
 
23
25
 
24
26
static inline void set_bit(int index, uint32_t *addr)
25
27
{
26
 
    __asm__ __volatile__ ("lock btsl %1, %0": : "m" (*addr), "r" (index));
 
28
    uint32_t mask = 1 << index;
 
29
    __sync_or_and_fetch(addr, mask);
27
30
}
28
31
 
29
32
static inline void clear_bit(int index, uint32_t *addr)
30
33
{
31
 
    __asm__ __volatile__ ("lock btrl %1, %0": : "m" (*addr), "r" (index));
 
34
    uint32_t mask = ~(1 << index);
 
35
    __sync_and_and_fetch(addr, mask);
32
36
}
33
37
 
34
38
static inline int test_bit(int index, uint32_t val)
77
81
    RED_WORKER_MESSAGE_DESTROY_SURFACE_WAIT_ASYNC,
78
82
    /* suspend/windows resolution change command */
79
83
    RED_WORKER_MESSAGE_FLUSH_SURFACES_ASYNC,
 
84
 
 
85
    RED_WORKER_MESSAGE_DISPLAY_CHANNEL_CREATE,
 
86
    RED_WORKER_MESSAGE_CURSOR_CHANNEL_CREATE,
 
87
 
 
88
    RED_WORKER_MESSAGE_COUNT // LAST
80
89
};
81
90
 
82
91
typedef uint32_t RedWorkerMessage;
95
104
typedef struct WorkerInitData {
96
105
    struct QXLInstance *qxl;
97
106
    int id;
98
 
    int channel;
99
107
    uint32_t *pending;
100
108
    uint32_t num_renderers;
101
109
    uint32_t renderers[RED_MAX_RENDERERS];
109
117
    uint8_t memslot_id_bits;
110
118
    uint8_t internal_groupslot_id;
111
119
    uint32_t n_surfaces;
112
 
    RedDispatcher *dispatcher;
 
120
    RedDispatcher *red_dispatcher;
113
121
} WorkerInitData;
114
122
 
115
123
void *red_worker_main(void *arg);