Trident TGUI9680 linear framebuffer PCI BAR is now correctly 4 MB aligned.

This commit is contained in:
Miran Grča
2021-07-06 19:40:16 +02:00
committed by GitHub
parent 202c31d7be
commit 0297243a50

View File

@@ -895,14 +895,20 @@ void tgui_pci_write(int func, int addr, uint8_t val, void *p)
break; break;
case 0x12: case 0x12:
tgui->linear_base = (tgui->linear_base & 0xff000000) | ((val & 0xe0) << 16); if (tgui->type == TGUI_9680)
tgui->linear_base = (tgui->linear_base & 0xff000000) | ((val & 0xc0) << 16);
else
tgui->linear_base = (tgui->linear_base & 0xff000000) | ((val & 0xe0) << 16);
tgui->linear_size = tgui->vram_size; tgui->linear_size = tgui->vram_size;
svga->decode_mask = tgui->vram_mask; svga->decode_mask = tgui->vram_mask;
svga->crtc[0x21] = (svga->crtc[0x21] & ~0xf) | (val >> 4); svga->crtc[0x21] = (svga->crtc[0x21] & ~0xf) | (val >> 4);
tgui_recalcmapping(tgui); tgui_recalcmapping(tgui);
break; break;
case 0x13: case 0x13:
tgui->linear_base = (tgui->linear_base & 0xe00000) | (val << 24); if (tgui->type == TGUI_9680)
tgui->linear_base = (tgui->linear_base & 0xc00000) | (val << 24);
else
tgui->linear_base = (tgui->linear_base & 0xe00000) | (val << 24);
tgui->linear_size = tgui->vram_size; tgui->linear_size = tgui->vram_size;
svga->decode_mask = tgui->vram_mask; svga->decode_mask = tgui->vram_mask;
svga->crtc[0x21] = (svga->crtc[0x21] & ~0xc0) | (val >> 6); svga->crtc[0x21] = (svga->crtc[0x21] & ~0xc0) | (val >> 6);
@@ -2947,4 +2953,4 @@ const device_t tgui9680_pci_device =
tgui_speed_changed, tgui_speed_changed,
tgui_force_redraw, tgui_force_redraw,
tgui96xx_config tgui96xx_config
}; };