summaryrefslogtreecommitdiff
path: root/sys/src/9/pc/screen.c
AgeCommit message (Collapse)Author
2016-12-15pc64: implement simple write combining for framebuffers with the PATcinap_lenrek
on some modern machines like the x250, the bios arranges the mtrr's and the framebuffer membar in a way that doesnt allow us to mark the framebuffer pages as write combining, leading to slow graphics. since the pentium III, the processor interprets the page table bit combinations of the WT, CD and bit7 bits as an index into the page attribute table (PAT). to not change the semantics of the WT and CD bits, we preserve the bit patterns 0-3 and use the last entry 7 for write combining. (done in mmuinit() for each core). the new patwc() function takes virtual address range and changes the page table marking the range as write combining. no attempt is made on invalidating tlb's. doesnt matter in our case as the following mtrr() call in screen.c does it for us.
2015-11-30kernel: cleanup exit()/shutdown()/reboot() codecinap_lenrek
introduce cpushutdown() function that does the common operation of initiating shutdown, returning once all cpu's got the message and are about to shutdown. this avoids duplicated code which isnt really machine specific. automatic reboot on panic only when *debug= is not set and the machine is a cpu server or has no display, otherwise just hang.
2015-08-02pc, pc64: set *bootscreen= when framebuffer changescinap_lenrek
add bootscreenconf(VGAscr *) function, that is called whenever the framebuffer configuration is changed by devvga. that way, we can pass the current setting of the framebuffer to the new kernel when using /dev/reboot.
2015-04-07kernel: move arrow cursor definition to port/devmouse.ccinap_lenrek
2015-01-03devvga: disable hardware blanking when switching drivers, check softscreencinap_lenrek
we have to reset hwblank when switching drivers to prevent the generic vgablank() to be called by blankscreen(). remove code setting hwblank from vga drivers as devvga will always force hwblank to be 1 or 0 depending on if the driver provides a native blanking routine. set hwaccel to 1 when the driver provides native fill and scroll routines independent of softscreen being disabled. this allows hw acceleration to be used when softscreen gets switched off.
2014-10-21pc, pc64: make mtrr() callable from interrupt context and before mpinitcinap_lenrek
to make it possible to mark the bootscreen framebuffer as write combining in early initialization, mtrr() is changed not not to error() but to return an error string. as bootscreen() is used before multiprocessor initialization, we have to synchronize the mtrr's for every processor as it comes online. for this, a new mtrrsync() function is provided that is called from cpuidentify() if mtrr support is indicated. the boot processor runs mtrrsync() which snarfs the registers. later, mtrrsync() is run again from the application processors which apply the values from the boot processor. checkmtrr() from mp.c was removed as its task is also done by mtrrsync() now.
2014-10-19pc, pc64: lookup pci device for bootscreen() and maximize framebuffer ↵cinap_lenrek
aperture so can change screen resolution
2014-10-13pc: add *bootscreen= variable to pass pre-initialized framebuffer info to kernelcinap_lenrek
EFI system has no cga or vesa anymore, so it becomes neccesary to pass GOP framebuffer info to the kernel to get some output on the screen.
2014-06-09pc: clip rectangles before sending them to the hardware in flushmemscreenmischief
the vmware svga video card emulated by qemu (qemu -vga vmware) complains and eventually causes a panic if the rectangles aren't clipped. messages like the following can be observed from qemu before the kernel panics: vmsvga_update_rect: update h was < 0 (-20000) vmsvga_update_rect: update height too large y: 10000, h: 0 vmsvga_update_rect: update w was < 0 (-20000) vmsvga_update_rect: update width too large x: 10000, w: 0 i could only reproduce this in qemu 2.0.50 on the master branch, when using the ui and had selected 'Zoom To Fit' from the View menu.
2014-01-19kernel: replace BY2WD in scanline width calculation to sizeof(ulong) like ↵cinap_lenrek
libmemdraw
2013-11-12kernel: handle memimageinit() errorcinap_lenrek
2013-04-14reduce software cursor flickeringcinap_lenrek
the software cursor starts flickering and reacts bumby if a process spends most of its time with drawlock acquired because the timer interrupt thats supposed to redraw the cursor fails to acquire the lock at the time the timer fires. instead of trying to draw the cursor on the screen from a timer interrupt 30 times per second, devmouse now creates a process calling cursoron() and cursoroff() when the cursor needs to be redrawn. this allows the swcursor to schedule a redraw while holding the drawlock in swcursoravoid() and cursoron()/cursoroff() are now able to wait for a qlock (drawlock) because they get called from process context. the overall responsiveness is also improved with this change as the cursor redraw rate isnt limited to 30 times a second anymore.
2013-01-02vga: make kernel vga drivers more stupidcinap_lenrek
previously, we had to maintain 3 sets of pci vid/did's: 1) in /lib/vgadb for detection 2) in the userspace driver in aux/vga 3) in the kernel mode driver this change makes the kernel mode driver more dumb in the cases where possible. we let userspace do the pci enumeration and if needed, it can set the pci address of the vga card. kernel mode drivers can assume to get the right pci device passed in scr->pci for enable() and linear() functions and just do very basic sanity checking before mapping framebuffer and mmio regions. vgalinearpciid() was removed as userspace is responsible to pick pci device. theres a new vgactl message "pcidev" where userspace can set the bus address. we initialize scr->pci in vgareset() to the first pci graphics card found. this should cover cases when an old aux/vga binary is used that doesnt use the new pcidev message. userspace drivers will now use the pci device that got a match from /lib/vgadb and skip ther own enumeration. this way, vga cards can be made to work by simply adding an entry in vgadb with no need to modify userspace or kernelspace drivers. this is not always possible if the driver derives information from the specific card model.
2012-07-18screen: cleanupcinap_lenrek
2012-07-18vga: softscreencinap_lenrek
allow the shadow framebuffer (softscreen) to be used with any vga driver, not just vesa. this removes the ugly scr->paddr = 0 hack employed by vesa driver to force softscreen and adds a softscreen vgactl message that can switch the feature on and off at runtime. softscreen can greatly improve graphics performance when bus reads are slow even tho it disables hardware acceleration.
2011-04-11vesa-changescinap_lenrek
2011-03-30Import sources from 2011-03-30 iso image - libTaru Karttunen
2011-03-30Import sources from 2011-03-30 iso imageTaru Karttunen