From 1aeaeb0efad21ea6ab921319813ea13a13944353 Mon Sep 17 00:00:00 2001 From: bjh21 Date: Sat, 28 Oct 2006 17:39:59 +0000 Subject: [PATCH] When setting the FIFO preload, chose an entirely safe value rather than using a completely bogus heuristic to guess at one. This might cause FIFO underruns in particularly exciting video modes, but it also makes more boring ones work correctly. --- sys/arch/arm/iomd/vidc20config.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/sys/arch/arm/iomd/vidc20config.c b/sys/arch/arm/iomd/vidc20config.c index 09fbd20b35d6..c5c49af291cc 100644 --- a/sys/arch/arm/iomd/vidc20config.c +++ b/sys/arch/arm/iomd/vidc20config.c @@ -1,4 +1,4 @@ -/* $NetBSD: vidc20config.c,v 1.29 2006/10/21 17:08:22 bjh21 Exp $ */ +/* $NetBSD: vidc20config.c,v 1.30 2006/10/28 17:39:59 bjh21 Exp $ */ /* * Copyright (c) 2001 Reinoud Zandijk @@ -48,7 +48,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: vidc20config.c,v 1.29 2006/10/21 17:08:22 bjh21 Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vidc20config.c,v 1.30 2006/10/28 17:39:59 bjh21 Exp $"); #include #include @@ -509,14 +509,19 @@ vidcvideo_setmode(struct vidc_mode *mode) if (vm->flags & VID_NVSYNC) ereg |= 1<<18; vidcvideo_write(VIDC_EREG, ereg); - if (dispsize > 1024*1024) { - if (vm->hdisplay >= 800) - vidcvideo_write(VIDC_CONREG, 7<<8 | bpp_mask<<5); - else - vidcvideo_write(VIDC_CONREG, 6<<8 | bpp_mask<<5); - } else { + + /* + * Set the video FIFO preload value and bit depth. Chapter 6 + * of the VIDC20 Data Sheet has full details of the FIFO + * preload, but we don't do anything clever and just use the + * largest possible value, which is 7 when the VIDC20 is in + * 32-bit mode (0MB or 1MB VRAM) and 6 when it is in 64-bit + * mode (2MB VRAM). + */ + if (dispsize > 1024*1024) + vidcvideo_write(VIDC_CONREG, 6<<8 | bpp_mask<<5); + else vidcvideo_write(VIDC_CONREG, 7<<8 | bpp_mask<<5); - } }