}
}
-
- if ( brightness_off ) {
-
- dst_sub = s->ds->surface->data + addr;
- dst = (uint32_t*) ( s->ds->surface->data + addr );
-
- for ( i = 0; i < disp_width; i++, dst_sub += 4, dst++ ) {
- *dst = 0xFF000000; // black
- }
-
- } else {
-
- if ( brightness_level < BRIGHTNESS_MAX ) {
-
- alpha = brightness_tbl[brightness_level];
-
- dst_sub = s->ds->surface->data + addr;
- dst = (uint32_t*) ( s->ds->surface->data + addr );
-
- for ( i = 0; i < disp_width; i++, dst_sub += 4, dst++ ) {
- *dst = ( ( alpha * dst_sub[0] ) >> 8 )
- | ( ( alpha * dst_sub[1] ) & 0xFF00 )
- | ( ( ( alpha * dst_sub[2] ) & 0xFF00 ) << 8 );
- }
+ if (brightness_level < BRIGHTNESS_MAX) {
+ alpha = brightness_tbl[brightness_level];
+ dst_sub = ds_get_data(s->ds) + addr;
+ dst = (uint32_t *)(ds_get_data(s->ds) + addr);
+ for (i = 0; i < disp_width; i++, dst_sub += 4, dst++) {
+ *dst = ((alpha * dst_sub[0])>> 8)
+ | ((alpha * dst_sub[1]) & 0xFF00)
+ | (((alpha * dst_sub[2]) & 0xFF00) << 8);
}
-
}
-
#endif /* MARU_VGA */
} else {
s->cursor_blink_time = qemu_get_clock_ms(vm_clock);
full_update = 1;
}
+ if (brightness_off) {
+ full_update = 1;
+ vga_draw_blank(s, full_update);
+ return;
+ }
switch(graphic_mode) {
case GMODE_TEXT:
vga_draw_text(s, full_update);
void qemu_ds_sdl_refresh(DisplayState *ds)
{
SDL_Event ev1, *ev = &ev1;
+ static uint32_t sdl_skip_count = 0;
// surface may be NULL in init func.
qemu_display_surface = ds->surface;
maruskin_sdl_init(0, get_emul_lcd_width(), get_emul_lcd_height(), true);
pthread_mutex_unlock(&sdl_mutex);
- vga_hw_invalidate();
sdl_skip_update = 0;
+ sdl_skip_count = 0;
break;
}
/* Usually, continuously updated.
When the LCD is turned off,
- once updates the screen for a black screen. */
+ ten more updates the screen for a black screen. */
vga_hw_update();
if (brightness_off) {
- sdl_skip_update = 1;
+ if (++sdl_skip_count > 10) {
+ sdl_skip_update = 1;
+ } else {
+ sdl_skip_update = 0;
+ }
} else {
+ sdl_skip_count = 0;
sdl_skip_update = 0;
}
static int skin_shmid;
static int shm_skip_update;
+static int shm_skip_count;
extern pthread_mutex_t mutex_draw_display;
extern int draw_display_state;
TRACE("qemu_ds_shm_resize\n");
shm_skip_update = 0;
+ shm_skip_count = 0;
}
void qemu_ds_shm_refresh(DisplayState *ds)
/* Usually, continuously updated.
But when the display is turned off,
- just once updates the surface for a black screen. */
+ ten more updates the surface for a black screen. */
if (brightness_off) {
- shm_skip_update = 1;
+ if (++shm_skip_count > 10) {
+ shm_skip_update = 1;
+ } else {
+ shm_skip_update = 0;
+ }
} else {
+ shm_skip_count = 0;
shm_skip_update = 0;
}
}