Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F173710941
D2397.id5080.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D2397.id5080.diff
View Options
Index: head/sys/dev/vt/hw/vga/vt_vga.c
===================================================================
--- head/sys/dev/vt/hw/vga/vt_vga.c
+++ head/sys/dev/vt/hw/vga/vt_vga.c
@@ -1035,11 +1035,12 @@
REG_WRITE1(sc, VGA_GC_DATA, 0xff);
}
-static void
+static int
vga_initialize(struct vt_device *vd, int textmode)
{
struct vga_softc *sc = vd->vd_softc;
uint8_t x;
+ int timeout;
/* Make sure the VGA adapter is not in monochrome emulation mode. */
x = REG_READ1(sc, VGA_GEN_MISC_OUTPUT_R);
@@ -1060,10 +1061,16 @@
* code therefore also removes that guarantee and appropriate measures
* need to be taken.
*/
+ timeout = 10000;
do {
+ DELAY(10);
x = REG_READ1(sc, VGA_GEN_INPUT_STAT_1);
x &= VGA_GEN_IS1_VR | VGA_GEN_IS1_DE;
- } while (x != (VGA_GEN_IS1_VR | VGA_GEN_IS1_DE));
+ } while (x != (VGA_GEN_IS1_VR | VGA_GEN_IS1_DE) && --timeout != 0);
+ if (timeout == 0) {
+ printf("Timeout initializing vt_vga\n");
+ return (ENXIO);
+ }
/* Now, disable the sync. signals. */
REG_WRITE1(sc, VGA_CRTC_ADDRESS, VGA_CRTC_MODE_CONTROL);
@@ -1194,6 +1201,8 @@
*/
sc->vga_curfg = sc->vga_curbg = 0xff;
}
+
+ return (0);
}
static int
@@ -1235,7 +1244,8 @@
vd->vd_width = VT_VGA_WIDTH;
vd->vd_height = VT_VGA_HEIGHT;
}
- vga_initialize(vd, textmode);
+ if (vga_initialize(vd, textmode) != 0)
+ return (CN_DEAD);
sc->vga_enabled = true;
return (CN_INTERNAL);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Sep 28, 9:26 PM (8 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39835047
Default Alt Text
D2397.id5080.diff (1 KB)
Attached To
Mode
D2397: vt_vga: add a timeout while waiting for vertical retrace
Attached
Detach File
Event Timeline
Log In to Comment