From owner-freebsd-hackers Mon Dec 18 15:26:11 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id PAA27952 for hackers-outgoing; Mon, 18 Dec 1995 15:26:11 -0800 (PST) Received: from plains.nodak.edu (tinguely@plains.NoDak.edu [134.129.111.64]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id PAA27947 for ; Mon, 18 Dec 1995 15:26:09 -0800 (PST) Received: (from tinguely@localhost) by plains.nodak.edu (8.7.1/8.7.1) id RAA29819; Mon, 18 Dec 1995 17:25:53 -0600 (CST) Date: Mon, 18 Dec 1995 17:25:53 -0600 (CST) From: Mark Tinguely Message-Id: <199512182325.RAA29819@plains.nodak.edu> To: james@miller.cs.uwm.edu, luigi@labinfo.iet.unipi.it Subject: Re: meteor driver bug Cc: hackers@freebsd.org Sender: owner-hackers@freebsd.org Precedence: bulk > > BUG: around line 1072 of the driver, the following code: > > > > *p++ = buf; /* even y or even RGB */ > > /* set end of buffer location */ > > *(p+36) = *(p+35) = buf + mtr->alloc_pages * PAGE_SIZE; > > > > the last line should read > > > > *(p+34) = *(p+35) = buf + mtr->alloc_pages * PAGE_SIZE; > > > > as the pointer (p) has been already incremented. Due to this > > bug, we are going to write past the end of the 7116 registers, > > with unknown effects. > > Hmmm... By my count there are 38 4 byte registers and we want to offset to > dma end (even) and dma end (odd), which would be +36 & +37. Since we > increment, then we want 35 & 36... I will count again, but I think this > code is correct. > > I think Luigi is correct, the DMA is at offset 0x8c and 0x90 (35 and 36 4 byte words), I combined the auto-increment of p and the (p+35), (p+36) from two seperate setting of buf variable and didn't look too close. The code does not let a person hit the end of the DMA buffer, but it is good to be safe. > > > > /* 01 */ 0x30, /* 7:0 Horizontal Sync Begin for 50hz */ > > /* 02 */ 0x00, /* 7:0 Horizontal Sync Stop for 50hz */ > > /* 03 */ 0xe8, /* 7:0 Horizontal Sync Clamp Start for 50hz */ > > /* 04 */ 0xb6, /* 7:0 Horizontal Sync Clamp Stop for 50hz */ > > /* 05 */ 0xf4, /* 7:0 Horizontal Sync Start after PH1 for 50hz */ Luigi has the 50 Hz video, I trust what you say works good for 50 Hz. --mark.