ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/video_x.cpp
(Generate patch)

Comparing BasiliskII/src/Unix/video_x.cpp (file contents):
Revision 1.82 by gbeauche, 2006-01-03T22:03:27Z vs.
Revision 1.83 by gbeauche, 2007-06-14T14:45:54Z

# Line 194 | Line 194 | static void *redraw_func(void *arg);
194   // From main_unix.cpp
195   extern char *x_display_name;
196   extern Display *x_display;
197 extern void *vm_acquire_mac(size_t size);
197  
198   // From sys_unix.cpp
199   extern void SysMountFirstFloppy(void);
# Line 498 | Line 497 | static int error_handler(Display *d, XEr
497  
498  
499   /*
500 + *  Framebuffer allocation routines
501 + */
502 +
503 + #ifdef ENABLE_VOSF
504 + #include "vm_alloc.h"
505 +
506 + static void *vm_acquire_framebuffer(uint32 size)
507 + {
508 +        // always try to allocate framebuffer at the same address
509 +        static void *fb = VM_MAP_FAILED;
510 +        if (fb != VM_MAP_FAILED) {
511 +                if (vm_acquire_fixed(fb, size) < 0)
512 +                        fb = VM_MAP_FAILED;
513 +        }
514 +        if (fb == VM_MAP_FAILED)
515 +                fb = vm_acquire(size, VM_MAP_DEFAULT | VM_MAP_32BIT);
516 +        return fb;
517 + }
518 +
519 + static inline void vm_release_framebuffer(void *fb, uint32 size)
520 + {
521 +        vm_release(fb, size);
522 + }
523 + #endif
524 +
525 +
526 + /*
527   *  Display "driver" classes
528   */
529  
# Line 632 | Line 658 | driver_base::~driver_base()
658                  // the_buffer shall always be mapped through vm_acquire() so that we can vm_protect() it at will
659                  if (the_buffer != VM_MAP_FAILED) {
660                          D(bug(" releasing the_buffer at %p (%d bytes)\n", the_buffer, the_buffer_size));
661 <                        vm_release(the_buffer, the_buffer_size);
661 >                        vm_release_framebuffer(the_buffer, the_buffer_size);
662                          the_buffer = NULL;
663                  }
664                  if (the_host_buffer) {
# Line 782 | Line 808 | driver_window::driver_window(X11_monitor
808          // Allocate memory for frame buffer (SIZE is extended to page-boundary)
809          the_host_buffer = the_buffer_copy;
810          the_buffer_size = page_extend((aligned_height + 2) * img->bytes_per_line);
811 <        the_buffer = (uint8 *)vm_acquire_mac(the_buffer_size);
811 >        the_buffer = (uint8 *)vm_acquire_framebuffer(the_buffer_size);
812          the_buffer_copy = (uint8 *)malloc(the_buffer_size);
813          D(bug("the_buffer = %p, the_buffer_copy = %p, the_host_buffer = %p\n", the_buffer, the_buffer_copy, the_host_buffer));
814   #else
# Line 1162 | Line 1188 | driver_fbdev::driver_fbdev(X11_monitor_d
1188            the_host_buffer = the_buffer;
1189            the_buffer_size = page_extend((height + 2) * bytes_per_row);
1190            the_buffer_copy = (uint8 *)malloc(the_buffer_size);
1191 <          the_buffer = (uint8 *)vm_acquire_mac(the_buffer_size);
1191 >          the_buffer = (uint8 *)vm_acquire_framebuffer(the_buffer_size);
1192  
1193            // Fake image for DGA/VOSF mode to know about display bounds
1194            img = new FakeXImage(width, height, depth_of_video_mode(mode));
# Line 1299 | Line 1325 | driver_xf86dga::driver_xf86dga(X11_monit
1325            the_host_buffer = the_buffer;
1326            the_buffer_size = page_extend((height + 2) * bytes_per_row);
1327            the_buffer_copy = (uint8 *)malloc(the_buffer_size);
1328 <          the_buffer = (uint8 *)vm_acquire_mac(the_buffer_size);
1328 >          the_buffer = (uint8 *)vm_acquire_framebuffer(the_buffer_size);
1329  
1330            // Fake image for DGA/VOSF mode to know about display bounds
1331            img = new FakeXImage((v_width + 7) & ~7, height, depth_of_video_mode(mode));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines