168 |
|
#endif |
169 |
|
|
170 |
|
// Mutex to protect palette |
171 |
< |
#ifdef HAVE_SPINLOCKS |
172 |
< |
static spinlock_t x_palette_lock = SPIN_LOCK_UNLOCKED; |
173 |
< |
#define LOCK_PALETTE spin_lock(&x_palette_lock) |
174 |
< |
#define UNLOCK_PALETTE spin_unlock(&x_palette_lock) |
175 |
< |
#elif defined(HAVE_PTHREADS) |
171 |
> |
#if defined(HAVE_PTHREADS) |
172 |
|
static pthread_mutex_t x_palette_lock = PTHREAD_MUTEX_INITIALIZER; |
173 |
|
#define LOCK_PALETTE pthread_mutex_lock(&x_palette_lock) |
174 |
|
#define UNLOCK_PALETTE pthread_mutex_unlock(&x_palette_lock) |
175 |
+ |
#elif defined(HAVE_SPINLOCKS) |
176 |
+ |
static spinlock_t x_palette_lock = SPIN_LOCK_UNLOCKED; |
177 |
+ |
#define LOCK_PALETTE spin_lock(&x_palette_lock) |
178 |
+ |
#define UNLOCK_PALETTE spin_unlock(&x_palette_lock) |
179 |
|
#else |
180 |
|
#define LOCK_PALETTE |
181 |
|
#define UNLOCK_PALETTE |
182 |
|
#endif |
183 |
|
|
184 |
|
// Mutex to protect frame buffer |
185 |
< |
#ifdef HAVE_SPINLOCKS |
186 |
< |
static spinlock_t frame_buffer_lock = SPIN_LOCK_UNLOCKED; |
187 |
< |
#define LOCK_FRAME_BUFFER spin_lock(&frame_buffer_lock) |
188 |
< |
#define UNLOCK_FRAME_BUFFER spin_unlock(&frame_buffer_lock) |
189 |
< |
#elif defined(HAVE_PTHREADS) |
185 |
> |
#if defined(HAVE_PTHREADS) |
186 |
|
static pthread_mutex_t frame_buffer_lock = PTHREAD_MUTEX_INITIALIZER; |
187 |
|
#define LOCK_FRAME_BUFFER pthread_mutex_lock(&frame_buffer_lock); |
188 |
|
#define UNLOCK_FRAME_BUFFER pthread_mutex_unlock(&frame_buffer_lock); |
189 |
+ |
#elif defined(HAVE_SPINLOCKS) |
190 |
+ |
static spinlock_t frame_buffer_lock = SPIN_LOCK_UNLOCKED; |
191 |
+ |
#define LOCK_FRAME_BUFFER spin_lock(&frame_buffer_lock) |
192 |
+ |
#define UNLOCK_FRAME_BUFFER spin_unlock(&frame_buffer_lock) |
193 |
|
#else |
194 |
|
#define LOCK_FRAME_BUFFER |
195 |
|
#define UNLOCK_FRAME_BUFFER |
2549 |
|
} |
2550 |
|
return NULL; |
2551 |
|
} |
2552 |
+ |
|
2553 |
+ |
|
2554 |
+ |
/* |
2555 |
+ |
* Record dirty area from NQD |
2556 |
+ |
*/ |
2557 |
+ |
|
2558 |
+ |
void video_set_dirty_area(int x, int y, int w, int h) |
2559 |
+ |
{ |
2560 |
+ |
VideoInfo const & mode = VModes[cur_mode]; |
2561 |
+ |
const int screen_width = VIDEO_MODE_X; |
2562 |
+ |
const int screen_height = VIDEO_MODE_Y; |
2563 |
+ |
const int bytes_per_row = VIDEO_MODE_ROW_BYTES; |
2564 |
+ |
|
2565 |
+ |
#ifdef ENABLE_VOSF |
2566 |
+ |
if (use_vosf) { |
2567 |
+ |
vosf_set_dirty_area(x, y, w, h, screen_width, screen_height, bytes_per_row); |
2568 |
+ |
return; |
2569 |
+ |
} |
2570 |
+ |
#endif |
2571 |
+ |
|
2572 |
+ |
// XXX handle dirty bounding boxes for non-VOSF modes |
2573 |
+ |
} |