633 |
|
return true; |
634 |
|
} |
635 |
|
|
636 |
< |
// Open FBDev display |
637 |
< |
static bool open_fbdev(int width, int height) |
636 |
> |
// Open FBDev DGA display |
637 |
> |
static bool open_fbdev_dga(int width, int height) |
638 |
|
{ |
639 |
|
#ifdef ENABLE_FBDEV_DGA |
640 |
+ |
#ifdef ENABLE_XF86_VIDMODE |
641 |
+ |
// Switch to best mode |
642 |
+ |
if (has_vidmode) { |
643 |
+ |
int best = -1; |
644 |
+ |
for (int i = 0; i < num_x_video_modes; i++) { |
645 |
+ |
if (x_video_modes[i]->hdisplay == width && x_video_modes[i]->vdisplay == height) { |
646 |
+ |
best = i; |
647 |
+ |
break; |
648 |
+ |
} |
649 |
+ |
}; |
650 |
+ |
assert(best != -1); |
651 |
+ |
XF86VidModeSwitchToMode(x_display, screen, x_video_modes[best]); |
652 |
+ |
XF86VidModeSetViewPort(x_display, screen, 0, 0); |
653 |
+ |
D(bug("[fbdev] VideoMode %d: %d x %d @ %d\n", best, |
654 |
+ |
x_video_modes[best]->hdisplay, x_video_modes[best]->vdisplay, |
655 |
+ |
1000 * x_video_modes[best]->dotclock / (x_video_modes[best]->htotal * x_video_modes[best]->vtotal))); |
656 |
+ |
} |
657 |
+ |
#endif |
658 |
+ |
|
659 |
|
if (ioctl(fb_dev_fd, FBIOGET_FSCREENINFO, &fb_finfo) != 0) { |
660 |
|
D(bug("[fbdev] Can't get FSCREENINFO: %s\n", strerror(errno))); |
661 |
|
return false; |
662 |
|
} |
663 |
|
D(bug("[fbdev] Device ID: %s\n", fb_finfo.id)); |
664 |
|
D(bug("[fbdev] smem_start: %p [%d bytes]\n", fb_finfo.smem_start, fb_finfo.smem_len)); |
665 |
+ |
|
666 |
|
int fb_type = fb_finfo.type; |
667 |
|
const char *fb_type_str = NULL; |
668 |
|
switch (fb_type) { |
674 |
|
default: fb_type_str = "<unknown>"; break; |
675 |
|
} |
676 |
|
D(bug("[fbdev] type: %s\n", fb_type_str)); |
677 |
+ |
|
678 |
+ |
if (fb_type != FB_TYPE_PACKED_PIXELS) { |
679 |
+ |
D(bug("[fbdev] type '%s' not supported\n", fb_type_str)); |
680 |
+ |
return false; |
681 |
+ |
} |
682 |
+ |
|
683 |
|
int fb_visual = fb_finfo.visual; |
684 |
|
const char *fb_visual_str; |
685 |
|
switch (fb_visual) { |
693 |
|
} |
694 |
|
D(bug("[fbdev] visual: %s\n", fb_visual_str)); |
695 |
|
|
696 |
< |
if (fb_type != FB_TYPE_PACKED_PIXELS) { |
697 |
< |
D(bug("[fbdev] type %s not supported\n", fb_type_str)); |
696 |
> |
if (fb_visual != FB_VISUAL_TRUECOLOR) { |
697 |
> |
D(bug("[fbdev] visual '%s' not supported\n", fb_visual_str)); |
698 |
|
return false; |
699 |
|
} |
700 |
|
|
712 |
|
XSetWindowAttributes wattr; |
713 |
|
wattr.event_mask = eventmask = dga_eventmask; |
714 |
|
wattr.override_redirect = True; |
689 |
– |
wattr.colormap = (depth == 1 ? DefaultColormap(x_display, screen) : cmap[0]); |
715 |
|
the_win = XCreateWindow(x_display, rootwin, 0, 0, width, height, 0, xdepth, |
716 |
< |
InputOutput, vis, CWEventMask | CWOverrideRedirect | |
717 |
< |
(color_class == DirectColor ? CWColormap : 0), &wattr); |
716 |
> |
InputOutput, DefaultVisual(x_display, screen), |
717 |
> |
CWEventMask | CWOverrideRedirect, &wattr); |
718 |
|
|
719 |
|
// Show window |
720 |
|
XMapRaised(x_display, the_win); |
725 |
|
GrabModeAsync, GrabModeAsync, CurrentTime); |
726 |
|
XGrabPointer(x_display, the_win, True, |
727 |
|
PointerMotionMask | ButtonPressMask | ButtonReleaseMask, |
728 |
< |
GrabModeAsync, GrabModeAsync, None, None, CurrentTime); |
728 |
> |
GrabModeAsync, GrabModeAsync, the_win, None, CurrentTime); |
729 |
|
disable_mouse_accel(); |
730 |
|
|
731 |
|
// Create no_cursor |
738 |
|
// Init blitting routines |
739 |
|
int bytes_per_row = TrivialBytesPerRow((width + 7) & ~7, DepthModeForPixelDepth(depth)); |
740 |
|
#if ENABLE_VOSF |
741 |
< |
bool native_byte_order; |
742 |
< |
#ifdef WORDS_BIGENDIAN |
743 |
< |
native_byte_order = (XImageByteOrder(x_display) == MSBFirst); |
744 |
< |
#else |
745 |
< |
native_byte_order = (XImageByteOrder(x_display) == LSBFirst); |
746 |
< |
#endif |
747 |
< |
#if REAL_ADDRESSING || DIRECT_ADDRESSING |
741 |
> |
// Extract current screen color masks (we are in True Color mode) |
742 |
> |
VisualFormat visualFormat; |
743 |
> |
visualFormat.depth = xdepth = DefaultDepth(x_display, screen); |
744 |
> |
XMatchVisualInfo(x_display, screen, xdepth, TrueColor, &visualInfo); |
745 |
> |
assert(visualFormat.depth == visualInfo.depth); |
746 |
> |
visualFormat.Rmask = visualInfo.red_mask; |
747 |
> |
visualFormat.Gmask = visualInfo.green_mask; |
748 |
> |
visualFormat.Bmask = visualInfo.blue_mask; |
749 |
> |
D(bug("[fbdev] %d bpp, (%08x,%08x,%08x)\n", |
750 |
> |
visualFormat.depth, |
751 |
> |
visualFormat.Rmask, visualFormat.Gmask, visualFormat.Bmask)); |
752 |
> |
D(bug("[fbdev] Mac depth %d bpp\n", depth)); |
753 |
> |
|
754 |
|
// Screen_blitter_init() returns TRUE if VOSF is mandatory |
755 |
|
// i.e. the framebuffer update function is not Blit_Copy_Raw |
756 |
< |
use_vosf = Screen_blitter_init(visualFormat, native_byte_order, depth); |
757 |
< |
|
727 |
< |
if (use_vosf) { |
728 |
< |
// Allocate memory for frame buffer (SIZE is extended to page-boundary) |
729 |
< |
the_host_buffer = the_buffer; |
730 |
< |
the_buffer_size = page_extend((height + 2) * bytes_per_row); |
731 |
< |
the_buffer_copy = (uint8 *)malloc(the_buffer_size); |
732 |
< |
the_buffer = (uint8 *)vm_acquire(the_buffer_size); |
733 |
< |
D(bug("the_buffer = %p, the_buffer_copy = %p, the_host_buffer = %p\n", the_buffer, the_buffer_copy, the_host_buffer)); |
734 |
< |
} |
756 |
> |
#ifdef WORDS_BIGENDIAN |
757 |
> |
const bool native_byte_order = (XImageByteOrder(x_display) == MSBFirst); |
758 |
|
#else |
759 |
< |
use_vosf = false; |
759 |
> |
const bool native_byte_order = (XImageByteOrder(x_display) == LSBFirst); |
760 |
|
#endif |
761 |
+ |
Screen_blitter_init(visualFormat, native_byte_order, depth); |
762 |
+ |
|
763 |
+ |
// Allocate memory for frame buffer (SIZE is extended to page-boundary) |
764 |
+ |
use_vosf = true; |
765 |
+ |
the_host_buffer = the_buffer; |
766 |
+ |
the_buffer_size = page_extend((height + 2) * bytes_per_row); |
767 |
+ |
the_buffer_copy = (uint8 *)malloc(the_buffer_size); |
768 |
+ |
the_buffer = (uint8 *)vm_acquire(the_buffer_size); |
769 |
+ |
D(bug("the_buffer = %p, the_buffer_copy = %p, the_host_buffer = %p\n", the_buffer, the_buffer_copy, the_host_buffer)); |
770 |
|
#endif |
771 |
|
|
772 |
|
// Set frame buffer base |
780 |
|
#endif |
781 |
|
} |
782 |
|
|
783 |
< |
// Open DGA display (!! should use X11 VidMode extensions to set mode) |
784 |
< |
static bool open_dga(int width, int height) |
783 |
> |
// Open XF86 DGA display (!! should use X11 VidMode extensions to set mode) |
784 |
> |
static bool open_xf86_dga(int width, int height) |
785 |
|
{ |
786 |
|
if (is_fbdev_dga_mode) |
787 |
|
return false; |
875 |
|
#endif |
876 |
|
} |
877 |
|
|
878 |
+ |
// Open DGA display |
879 |
+ |
static bool open_dga(int width, int height) |
880 |
+ |
{ |
881 |
+ |
bool display_open; |
882 |
+ |
|
883 |
+ |
display_open = open_xf86_dga(width, height); |
884 |
+ |
#ifdef ENABLE_FBDEV_DGA |
885 |
+ |
// Try to fallback to FBDev DGA mode |
886 |
+ |
if (!display_open) { |
887 |
+ |
is_fbdev_dga_mode = true; |
888 |
+ |
display_open = open_fbdev_dga(width, height); |
889 |
+ |
} |
890 |
+ |
#endif |
891 |
+ |
|
892 |
+ |
// Common DGA display initialization |
893 |
+ |
if (display_open) { |
894 |
+ |
|
895 |
+ |
// Fake image to get display bounds in the refresh function |
896 |
+ |
if ((img = (XImage *)malloc(sizeof(*img))) == NULL) |
897 |
+ |
return false; |
898 |
+ |
img->width = DisplayWidth(x_display, screen); |
899 |
+ |
img->height = DisplayHeight(x_display, screen); |
900 |
+ |
img->depth = is_fbdev_dga_mode ? xdepth : depth; |
901 |
+ |
img->bytes_per_line = TrivialBytesPerRow(img->width, DepthModeForPixelDepth(img->depth)); |
902 |
+ |
} |
903 |
+ |
|
904 |
+ |
return display_open; |
905 |
+ |
} |
906 |
+ |
|
907 |
|
static bool open_display(void) |
908 |
|
{ |
909 |
|
D(bug("open_display()\n")); |
919 |
|
} |
920 |
|
|
921 |
|
// Build up visualFormat structure |
922 |
+ |
visualFormat.fullscreen = (display_type == DIS_SCREEN); |
923 |
|
visualFormat.depth = visualInfo.depth; |
924 |
|
visualFormat.Rmask = visualInfo.red_mask; |
925 |
|
visualFormat.Gmask = visualInfo.green_mask; |
992 |
|
display_type = mode.viType; |
993 |
|
depth = depth_of_video_mode(mode.viAppleMode); |
994 |
|
|
995 |
< |
bool display_open = false; |
996 |
< |
if (display_type == DIS_SCREEN) { |
995 |
> |
bool display_open; |
996 |
> |
switch (display_type) { |
997 |
> |
case DIS_SCREEN: |
998 |
|
display_open = open_dga(VModes[cur_mode].viXsize, VModes[cur_mode].viYsize); |
999 |
< |
#ifdef ENABLE_FBDEV_DGA |
1000 |
< |
// Try to fallback to FBDev DGA mode |
938 |
< |
if (!display_open) { |
939 |
< |
is_fbdev_dga_mode = true; |
940 |
< |
display_open = open_fbdev(VModes[cur_mode].viXsize, VModes[cur_mode].viYsize); |
941 |
< |
} |
942 |
< |
#endif |
943 |
< |
|
944 |
< |
} |
945 |
< |
else if (display_type == DIS_WINDOW) |
999 |
> |
break; |
1000 |
> |
case DIS_WINDOW: |
1001 |
|
display_open = open_window(VModes[cur_mode].viXsize, VModes[cur_mode].viYsize); |
1002 |
+ |
break; |
1003 |
+ |
default: |
1004 |
+ |
display_open = false; |
1005 |
+ |
break; |
1006 |
+ |
} |
1007 |
|
|
1008 |
|
#ifdef ENABLE_VOSF |
1009 |
|
if (use_vosf) { |
1010 |
|
// Initialize the VOSF system |
1011 |
+ |
LOCK_VOSF; |
1012 |
|
if (!video_vosf_init()) { |
1013 |
|
ErrorAlert(GetString(STR_VOSF_INIT_ERR)); |
1014 |
+ |
UNLOCK_VOSF; |
1015 |
|
return false; |
1016 |
|
} |
1017 |
+ |
UNLOCK_VOSF; |
1018 |
|
} |
1019 |
|
#endif |
1020 |
< |
|
1020 |
> |
|
1021 |
> |
// Zero screen buffers, viRowBytes is initialized at this stage |
1022 |
> |
memset(the_buffer, 0, VModes[cur_mode].viRowBytes * VModes[cur_mode].viYsize); |
1023 |
> |
memset(the_buffer_copy, 0, VModes[cur_mode].viRowBytes * VModes[cur_mode].viYsize); |
1024 |
|
return display_open; |
1025 |
|
} |
1026 |
|
|
1057 |
|
} |
1058 |
|
|
1059 |
|
// Close FBDev mode |
1060 |
< |
static void close_fbdev(void) |
1060 |
> |
static void close_fbdev_dga(void) |
1061 |
|
{ |
1062 |
|
#ifdef ENABLE_FBDEV_DGA |
997 |
– |
XUngrabPointer(x_display, CurrentTime); |
998 |
– |
XUngrabKeyboard(x_display, CurrentTime); |
999 |
– |
|
1063 |
|
uint8 *fb_base; |
1064 |
< |
if (!use_vosf) { |
1002 |
< |
// don't free() the screen buffer in driver_base dtor |
1064 |
> |
if (!use_vosf) |
1065 |
|
fb_base = the_buffer; |
1004 |
– |
the_buffer = NULL; |
1005 |
– |
} |
1066 |
|
#ifdef ENABLE_VOSF |
1067 |
< |
else { |
1008 |
< |
// don't free() the screen buffer in driver_base dtor |
1067 |
> |
else |
1068 |
|
fb_base = the_host_buffer; |
1010 |
– |
the_host_buffer = NULL; |
1011 |
– |
} |
1069 |
|
#endif |
1070 |
|
munmap(fb_base, fb_finfo.smem_len); |
1071 |
|
#endif |
1072 |
|
} |
1073 |
|
|
1074 |
+ |
// Close XF86 DGA mode |
1075 |
+ |
static void close_xf86_dga(void) |
1076 |
+ |
{ |
1077 |
+ |
#ifdef ENABLE_XF86_DGA |
1078 |
+ |
XF86DGADirectVideo(x_display, screen, 0); |
1079 |
+ |
#endif |
1080 |
+ |
} |
1081 |
+ |
|
1082 |
|
// Close DGA mode |
1083 |
|
static void close_dga(void) |
1084 |
|
{ |
1085 |
|
if (is_fbdev_dga_mode) |
1086 |
< |
return; |
1086 |
> |
close_fbdev_dga(); |
1087 |
> |
else |
1088 |
> |
close_xf86_dga(); |
1089 |
|
|
1023 |
– |
#ifdef ENABLE_XF86_DGA |
1024 |
– |
XF86DGADirectVideo(x_display, screen, 0); |
1090 |
|
XUngrabPointer(x_display, CurrentTime); |
1091 |
|
XUngrabKeyboard(x_display, CurrentTime); |
1027 |
– |
#endif |
1092 |
|
|
1093 |
|
#ifdef ENABLE_XF86_VIDMODE |
1094 |
|
if (has_vidmode) |
1095 |
|
XF86VidModeSwitchToMode(x_display, screen, x_video_modes[0]); |
1096 |
|
#endif |
1097 |
|
|
1098 |
+ |
// Release fake image (it's not a normal XImage!) |
1099 |
+ |
free(img); |
1100 |
+ |
img = NULL; |
1101 |
+ |
|
1102 |
|
if (!use_vosf) { |
1103 |
|
// don't free() the screen buffer in driver_base dtor |
1104 |
|
the_buffer = NULL; |
1113 |
|
|
1114 |
|
static void close_display(void) |
1115 |
|
{ |
1116 |
< |
if (display_type == DIS_SCREEN) { |
1117 |
< |
if (is_fbdev_dga_mode) |
1050 |
< |
close_fbdev(); |
1051 |
< |
else |
1052 |
< |
close_dga(); |
1053 |
< |
} |
1116 |
> |
if (display_type == DIS_SCREEN) |
1117 |
> |
close_dga(); |
1118 |
|
else if (display_type == DIS_WINDOW) |
1119 |
|
close_window(); |
1120 |
|
|
1344 |
|
static bool has_mode(int x, int y) |
1345 |
|
{ |
1346 |
|
#ifdef ENABLE_XF86_VIDMODE |
1347 |
< |
for (int i=0; i<num_x_video_modes; i++) |
1348 |
< |
if (x_video_modes[i]->hdisplay >= x && x_video_modes[i]->vdisplay >= y) |
1349 |
< |
return true; |
1350 |
< |
return false; |
1351 |
< |
#else |
1352 |
< |
return DisplayWidth(x_display, screen) >= x && DisplayHeight(x_display, screen) >= y; |
1347 |
> |
if (has_vidmode) { |
1348 |
> |
for (int i=0; i<num_x_video_modes; i++) |
1349 |
> |
if (x_video_modes[i]->hdisplay == x && x_video_modes[i]->vdisplay == y) |
1350 |
> |
return true; |
1351 |
> |
return false; |
1352 |
> |
} |
1353 |
|
#endif |
1354 |
+ |
return DisplayWidth(x_display, screen) >= x && DisplayHeight(x_display, screen) >= y; |
1355 |
|
} |
1356 |
|
|
1357 |
|
bool VideoInit(void) |
1418 |
|
// VidMode available? |
1419 |
|
int vm_event_base, vm_error_base; |
1420 |
|
has_vidmode = XF86VidModeQueryExtension(x_display, &vm_event_base, &vm_error_base); |
1421 |
< |
if (has_vidmode) |
1421 |
> |
if (has_vidmode) { |
1422 |
> |
int vm_major_version, vm_minor_version; |
1423 |
> |
XF86VidModeQueryVersion(x_display, &vm_major_version, &vm_minor_version); |
1424 |
> |
D(bug("VidMode extension %d.%d available\n", vm_major_version, vm_minor_version)); |
1425 |
|
XF86VidModeGetAllModeLines(x_display, screen, &num_x_video_modes, &x_video_modes); |
1426 |
+ |
} |
1427 |
|
#endif |
1428 |
|
|
1429 |
|
#ifdef ENABLE_FBDEV_DGA |
1430 |
|
// FBDev available? |
1431 |
< |
if (!has_dga && local_X11) { |
1431 |
> |
bool has_fbdev_dga = false; |
1432 |
> |
if (local_X11) { |
1433 |
|
if ((fb_dev_fd = open("/dev/fb0", O_RDWR)) > 0) { |
1434 |
|
if (ioctl(fb_dev_fd, FBIOGET_VSCREENINFO, &fb_vinfo) != 0) |
1435 |
|
close(fb_dev_fd); |
1436 |
|
else { |
1437 |
< |
has_dga = true; |
1438 |
< |
is_fbdev_dga_mode = true; |
1437 |
> |
has_fbdev_dga = true; |
1438 |
> |
if (!has_dga) { |
1439 |
> |
// Fallback to FBDev DGA mode if XF86 DGA is not possible |
1440 |
> |
has_dga = true; |
1441 |
> |
is_fbdev_dga_mode = true; |
1442 |
> |
} |
1443 |
|
fb_orig_vinfo = fb_vinfo; |
1444 |
|
D(bug("Frame buffer device initial resolution: %dx%dx%d\n", fb_vinfo.xres, fb_vinfo.yres, fb_vinfo.bits_per_pixel)); |
1445 |
|
} |
1483 |
|
else if (has_dga && sscanf(mode_str, "dga/%d/%d", &default_width, &default_height) == 2) |
1484 |
|
display_type = DIS_SCREEN; |
1485 |
|
#endif |
1486 |
+ |
#ifdef ENABLE_FBDEV_DGA |
1487 |
+ |
else if (has_fbdev_dga && sscanf(mode_str, "fbdev/%d/%d", &default_width, &default_height) == 2) { |
1488 |
+ |
is_fbdev_dga_mode = true; |
1489 |
+ |
display_type = DIS_SCREEN; |
1490 |
+ |
} |
1491 |
+ |
#endif |
1492 |
|
if (display_type == DIS_INVALID) { |
1493 |
|
D(bug("Invalid screen mode specified, defaulting to old modes selection\n")); |
1494 |
|
mode_str = NULL; |
1527 |
|
add_custom_mode(p, display_type, default_width, default_height, d, APPLE_CUSTOM); |
1528 |
|
} |
1529 |
|
} |
1530 |
+ |
#ifdef ENABLE_VOSF |
1531 |
+ |
} else if (display_type == DIS_SCREEN && is_fbdev_dga_mode) { |
1532 |
+ |
for (unsigned int d = APPLE_1_BIT; d <= default_mode; d++) |
1533 |
+ |
if (find_visual_for_depth(d)) |
1534 |
+ |
add_custom_mode(p, display_type, default_width, default_height, d, APPLE_CUSTOM); |
1535 |
+ |
#endif |
1536 |
|
} else |
1537 |
|
add_custom_mode(p, display_type, default_width, default_height, default_mode, APPLE_CUSTOM); |
1538 |
+ |
|
1539 |
+ |
// Add extra VidMode capable modes |
1540 |
+ |
if (display_type == DIS_SCREEN) { |
1541 |
+ |
struct { |
1542 |
+ |
int w; |
1543 |
+ |
int h; |
1544 |
+ |
int apple_id; |
1545 |
+ |
} |
1546 |
+ |
video_modes[] = { |
1547 |
+ |
{ 640, 480, APPLE_640x480 }, |
1548 |
+ |
{ 800, 600, APPLE_800x600 }, |
1549 |
+ |
{ 1024, 768, APPLE_1024x768 }, |
1550 |
+ |
{ 1152, 768, APPLE_1152x768 }, |
1551 |
+ |
{ 1152, 900, APPLE_1152x900 }, |
1552 |
+ |
{ 1280, 1024, APPLE_1280x1024 }, |
1553 |
+ |
{ 1600, 1200, APPLE_1600x1200 }, |
1554 |
+ |
{ 0, } |
1555 |
+ |
}; |
1556 |
+ |
|
1557 |
+ |
for (int i = 0; video_modes[i].w != 0; i++) { |
1558 |
+ |
const int w = video_modes[i].w; |
1559 |
+ |
const int h = video_modes[i].h; |
1560 |
+ |
if (w >= default_width || h >= default_height) |
1561 |
+ |
continue; |
1562 |
+ |
if (has_mode(w, h)) { |
1563 |
+ |
#ifdef ENABLE_VOSF |
1564 |
+ |
if (is_fbdev_dga_mode) { |
1565 |
+ |
for (unsigned int d = APPLE_1_BIT; d <= default_mode; d++) |
1566 |
+ |
if (find_visual_for_depth(d)) |
1567 |
+ |
add_custom_mode(p, display_type, w, h, d, video_modes[i].apple_id); |
1568 |
+ |
} else |
1569 |
+ |
#endif |
1570 |
+ |
add_custom_mode(p, display_type, w, h, default_mode, video_modes[i].apple_id); |
1571 |
+ |
} |
1572 |
+ |
} |
1573 |
+ |
} |
1574 |
|
} else if (window_modes) { |
1575 |
|
for (unsigned int d = APPLE_1_BIT; d <= APPLE_32_BIT; d++) |
1576 |
|
if (find_visual_for_depth(d)) |
1766 |
|
XWarpPointer(x_display, None, rootwin, 0, 0, 0, 0, 0, 0); |
1767 |
|
Window w = is_fbdev_dga_mode ? the_win : rootwin; |
1768 |
|
XGrabKeyboard(x_display, w, True, GrabModeAsync, GrabModeAsync, CurrentTime); |
1769 |
< |
XGrabPointer(x_display, w, True, PointerMotionMask | ButtonPressMask | ButtonReleaseMask, GrabModeAsync, GrabModeAsync, None, None, CurrentTime); |
1769 |
> |
XGrabPointer(x_display, w, True, PointerMotionMask | ButtonPressMask | ButtonReleaseMask, GrabModeAsync, GrabModeAsync, is_fbdev_dga_mode ? w : None, None, CurrentTime); |
1770 |
|
disable_mouse_accel(); |
1771 |
|
#ifdef ENABLE_XF86_DGA |
1772 |
|
if (!is_fbdev_dga_mode) { |
1783 |
|
if (use_vosf) { |
1784 |
|
LOCK_VOSF; |
1785 |
|
PFLAG_SET_ALL; |
1664 |
– |
UNLOCK_VOSF; |
1786 |
|
memset(the_buffer_copy, 0, VModes[cur_mode].viRowBytes * VModes[cur_mode].viYsize); |
1787 |
+ |
UNLOCK_VOSF; |
1788 |
|
} |
1789 |
|
#endif |
1790 |
|
|
1798 |
|
free(fb_save); |
1799 |
|
fb_save = NULL; |
1800 |
|
} |
1679 |
– |
if (depth == 8) |
1680 |
– |
palette_changed = true; |
1801 |
|
|
1802 |
|
// Unlock frame buffer (and continue MacOS thread) |
1803 |
|
UNLOCK_FRAME_BUFFER; |
2098 |
|
if (use_vosf) { // VOSF refresh |
2099 |
|
LOCK_VOSF; |
2100 |
|
PFLAG_SET_ALL; |
2101 |
+ |
memset(the_buffer_copy, 0, VModes[cur_mode].viRowBytes * VModes[cur_mode].viYsize); |
2102 |
|
UNLOCK_VOSF; |
2103 |
|
} |
2104 |
+ |
else |
2105 |
|
#endif |
2106 |
< |
memset(the_buffer_copy, 0, VModes[cur_mode].viRowBytes * VModes[cur_mode].viYsize); |
2106 |
> |
memset(the_buffer_copy, 0, VModes[cur_mode].viRowBytes * VModes[cur_mode].viYsize); |
2107 |
|
break; |
2108 |
|
} |
2109 |
|
} |
2220 |
|
// We have to redraw everything because the interpretation of pixel values changed |
2221 |
|
LOCK_VOSF; |
2222 |
|
PFLAG_SET_ALL; |
2223 |
+ |
if (display_type == DIS_SCREEN) |
2224 |
+ |
PFLAG_SET_VERY_DIRTY; |
2225 |
|
UNLOCK_VOSF; |
2102 |
– |
memset(the_buffer_copy, 0, VModes[cur_mode].viRowBytes * VModes[cur_mode].viYsize); |
2226 |
|
} |
2227 |
|
#endif |
2228 |
|
|
2451 |
|
XDisplayLock(); |
2452 |
|
#if defined(ENABLE_XF86_DGA) || defined(ENABLE_FBDEV_DGA) |
2453 |
|
#ifdef ENABLE_XF86_DGA |
2454 |
< |
if (is_fbdev_dga_mode) |
2454 |
> |
if (!is_fbdev_dga_mode) |
2455 |
|
XF86DGADirectVideo(x_display, screen, 0); |
2456 |
|
#endif |
2457 |
|
XUngrabPointer(x_display, CurrentTime); |