From 499683d565c47c000a74b8f637d9697f80d86845 Mon Sep 17 00:00:00 2001 From: Rudolf Cornelissen Date: Mon, 31 May 2004 20:27:36 +0000 Subject: [PATCH] sync update for panning: fixes at least NM2160 glitches git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7694 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/accelerants/neomagic/engine/nm_crtc.c | 11 +++++++++-- src/add-ons/accelerants/neomagic/engine/nm_general.c | 5 +++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/add-ons/accelerants/neomagic/engine/nm_crtc.c b/src/add-ons/accelerants/neomagic/engine/nm_crtc.c index da2e9df318..c1341904bc 100644 --- a/src/add-ons/accelerants/neomagic/engine/nm_crtc.c +++ b/src/add-ons/accelerants/neomagic/engine/nm_crtc.c @@ -469,8 +469,8 @@ status_t nm_crtc_set_display_start(uint32 startadd,uint8 bpp) LOG(2,("CRTC: frameRAM: $%08x\n",si->framebuffer)); LOG(2,("CRTC: framebuffer: $%08x\n",si->fbc.frame_buffer)); - /* make sure we are in retrace, because otherwise distortions might occur - * during our reprogramming them (no double buffering) (verified on NM2160) */ + /* make sure we _just_ left retrace, because otherwise distortions might occur + * during our reprogramming (no double buffering) (verified on NM2160) */ /* we might have no retraces during setmode! So: * wait 25mS max. for retrace to occur (refresh > 40Hz) */ @@ -480,6 +480,13 @@ status_t nm_crtc_set_display_start(uint32 startadd,uint8 bpp) snooze(4); timeout++; } + /* now wait until retrace ends (with timeout) */ + timeout = 0; + while ((ISARB(INSTAT1) & 0x08) && (timeout < (25000/4))) + { + snooze(4); + timeout++; + } /* set standard VGA registers */ /* (startadress in 32bit words (b2 - b17) */ diff --git a/src/add-ons/accelerants/neomagic/engine/nm_general.c b/src/add-ons/accelerants/neomagic/engine/nm_general.c index 2f9e02e382..4d091b5eb5 100644 --- a/src/add-ons/accelerants/neomagic/engine/nm_general.c +++ b/src/add-ons/accelerants/neomagic/engine/nm_general.c @@ -419,7 +419,7 @@ status_t nm_general_validate_pic_size (display_mode *target, uint32 *bytes_per_r /* Note for NM2070 only: * The following depths have bandwidth trouble (pixel noise) with the * 'official' crtc_masks (used as defaults below). Masks of 0x1f are - * needed (confirmed 15 and 16 bit spaces) to prevent this from occuring. */ + * needed (confirmed 15 and 16 bit spaces) to minimize this. */ //fixme: doublecheck for NM2090 and NM2093: correct code if needed! case B_RGB15: crtc_mask = 0x1f; depth = 16; break; case B_RGB16: crtc_mask = 0x1f; depth = 16; break; @@ -525,7 +525,8 @@ status_t nm_general_validate_pic_size (display_mode *target, uint32 *bytes_per_r case B_CMAP8: acc_mask = 0x07; break; /* Note: * The following depths have actual acc_masks of 0x03. 0x1f is used - * because on lower acc_masks bandwidth trouble arises (pixel noise). */ + * because on lower acc_masks more bandwidth trouble arises. + * (pixel noise) */ //fixme: doublecheck for NM2090 and NM2093: correct code if needed! case B_RGB15: acc_mask = 0x1f; break; case B_RGB16: acc_mask = 0x1f; break;