added patches from Brian J. Johnson (better VOSF performance and responsiveness)

This commit is contained in:
cebix 2001-03-06 18:41:12 +00:00
parent 8c39ddb2a2
commit 4d5028655f
4 changed files with 50 additions and 66 deletions

View File

@ -1,3 +1,7 @@
V0.9 - <date>
- Unix: some performance improvements to VOSF screen update code
[Brian J. Johnson]
V0.9 (snapshot) - 17.Feb.2001 V0.9 (snapshot) - 17.Feb.2001
- adapted for mon V3.0 which is now the required minimum - adapted for mon V3.0 which is now the required minimum
- UAE cpu: fixed a bug in the memory handlers preventing from - UAE cpu: fixed a bug in the memory handlers preventing from

View File

@ -370,3 +370,40 @@ int main ()
rm -f conf.esdtest rm -f conf.esdtest
]) ])
dnl AM_ESD_SUPPORTS_MULTIPLE_RECORD([ACTION-IF-SUPPORTS [, ACTION-IF-NOT-SUPPORTS]])
dnl Test, whether esd supports multiple recording clients (version >=0.2.21)
dnl
AC_DEFUN(AM_ESD_SUPPORTS_MULTIPLE_RECORD,
[dnl
AC_MSG_NOTICE([whether installed esd version supports multiple recording clients])
ac_save_ESD_CFLAGS="$ESD_CFLAGS"
ac_save_ESD_LIBS="$ESD_LIBS"
AM_PATH_ESD(0.2.21,
ifelse([$1], , [
AM_CONDITIONAL(ESD_SUPPORTS_MULTIPLE_RECORD, true)
AC_DEFINE(ESD_SUPPORTS_MULTIPLE_RECORD, 1,
[Define if you have esound with support of multiple recording clients.])],
[$1]),
ifelse([$2], , [AM_CONDITIONAL(ESD_SUPPORTS_MULTIPLE_RECORD, false)], [$2])
if test "x$ac_save_ESD_CFLAGS" != x ; then
ESD_CFLAGS="$ac_save_ESD_CFLAGS"
fi
if test "x$ac_save_ESD_LIBS" != x ; then
ESD_LIBS="$ac_save_ESD_LIBS"
fi
)
])
# Define a conditional.
AC_DEFUN(AM_CONDITIONAL,
[AC_SUBST($1_TRUE)
AC_SUBST($1_FALSE)
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi])

View File

@ -227,89 +227,31 @@ static inline void update_display_window_vosf(void)
const int bytes_per_row = VideoMonitor.bytes_per_row; const int bytes_per_row = VideoMonitor.bytes_per_row;
const int bytes_per_pixel = VideoMonitor.bytes_per_row / VideoMonitor.x; const int bytes_per_pixel = VideoMonitor.bytes_per_row / VideoMonitor.x;
int i, j; int i = y1 * bytes_per_row, j;
// Check for first column from left and first column
// from right that have changed
int x1, x2, width;
if (depth == 1) { if (depth == 1) {
x1 = VideoMonitor.x - 1;
for (j = y1; j <= y2; j++) {
uint8 * const p1 = &the_buffer[j * bytes_per_row];
uint8 * const p2 = &the_buffer_copy[j * bytes_per_row];
for (i = 0; i < (x1>>3); i++) {
if (p1[i] != p2[i]) {
x1 = i << 3;
break;
}
}
}
x2 = x1;
for (j = y2; j >= y1; j--) {
uint8 * const p1 = &the_buffer[j * bytes_per_row];
uint8 * const p2 = &the_buffer_copy[j * bytes_per_row];
for (i = (VideoMonitor.x>>3) - 1; i > (x2>>3); i--) {
if (p1[i] != p2[i]) {
x2 = (i << 3) + 7;
break;
}
}
}
width = x2 - x1 + 1;
// Update the_host_buffer and copy of the_buffer // Update the_host_buffer and copy of the_buffer
i = y1 * bytes_per_row + (x1 >> 3);
for (j = y1; j <= y2; j++) { for (j = y1; j <= y2; j++) {
Screen_blit(the_host_buffer + i, the_buffer + i, width >> 3); Screen_blit(the_host_buffer + i, the_buffer + i, VideoMonitor.x >> 3);
memcpy(the_buffer_copy + i, the_buffer + i, width >> 3);
i += bytes_per_row; i += bytes_per_row;
} }
} else { } else {
x1 = VideoMonitor.x * bytes_per_pixel - 1;
for (j = y1; j <= y2; j++) {
uint8 * const p1 = &the_buffer[j * bytes_per_row];
uint8 * const p2 = &the_buffer_copy[j * bytes_per_row];
for (i = 0; i < x1; i++) {
if (p1[i] != p2[i]) {
x1 = i;
break;
}
}
}
x1 /= bytes_per_pixel;
x2 = x1 * bytes_per_pixel;
for (j = y2; j >= y1; j--) {
uint8 * const p1 = &the_buffer[j * bytes_per_row];
uint8 * const p2 = &the_buffer_copy[j * bytes_per_row];
for (i = VideoMonitor.x * bytes_per_pixel - 1; i > x2; i--) {
if (p1[i] != p2[i]) {
x2 = i;
break;
}
}
}
x2 /= bytes_per_pixel;
width = x2 - x1 + 1;
// Update the_host_buffer and copy of the_buffer // Update the_host_buffer and copy of the_buffer
i = y1 * bytes_per_row + x1 * bytes_per_pixel;
for (j = y1; j <= y2; j++) { for (j = y1; j <= y2; j++) {
Screen_blit(the_host_buffer + i, the_buffer + i, bytes_per_pixel * width); Screen_blit(the_host_buffer + i, the_buffer + i, bytes_per_pixel * VideoMonitor.x);
memcpy(the_buffer_copy + i, the_buffer + i, bytes_per_pixel * width);
i += bytes_per_row; i += bytes_per_row;
} }
} }
if (have_shm) if (have_shm)
XShmPutImage(x_display, the_win, the_gc, img, x1, y1, x1, y1, width, height, 0); XShmPutImage(x_display, the_win, the_gc, img, 0, y1, 0, y1, VideoMonitor.x, height, 0);
else else
XPutImage(x_display, the_win, the_gc, img, x1, y1, x1, y1, width, height); XPutImage(x_display, the_win, the_gc, img, 0, y1, 0, y1, VideoMonitor.x, height);
} }
mainBuffer.dirty = false; mainBuffer.dirty = false;
} }

View File

@ -2053,6 +2053,7 @@ static void video_refresh_window_vosf(void)
LOCK_VOSF; LOCK_VOSF;
update_display_window_vosf(); update_display_window_vosf();
UNLOCK_VOSF; UNLOCK_VOSF;
XSync(x_display, false); // Let the server catch up
} }
} }
} }
@ -2140,7 +2141,7 @@ static void *redraw_func(void *arg)
ticks++; ticks++;
} }
uint64 end = GetTicks_usec(); uint64 end = GetTicks_usec();
printf("%Ld ticks in %Ld usec = %Ld ticks/sec\n", ticks, end - start, ticks * 1000000 / (end - start)); // printf("%Ld ticks in %Ld usec = %Ld ticks/sec\n", ticks, end - start, ticks * 1000000 / (end - start));
return NULL; return NULL;
} }
#endif #endif