From e49a28cd50fe997c636eaacf2187af8c3daec50c Mon Sep 17 00:00:00 2001 From: Rudolf Cornelissen Date: Thu, 29 Jul 2004 18:55:54 +0000 Subject: [PATCH] fixed NM2200 and later cards overlay bug, fixed kernel driver not always putting away the PCI busmanager. Note that overlay may still not work OK, but we are now one step closer to finding the solution! git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8513 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../accelerants/neomagic/engine/nm_bes.c | 13 +++++++++---- .../drivers/graphics/neomagic/UPDATE.html | 3 ++- .../kernel/drivers/graphics/neomagic/driver.c | 19 +++++++++++++++---- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/add-ons/accelerants/neomagic/engine/nm_bes.c b/src/add-ons/accelerants/neomagic/engine/nm_bes.c index 49c2b0ba5b..f4f06cc67d 100644 --- a/src/add-ons/accelerants/neomagic/engine/nm_bes.c +++ b/src/add-ons/accelerants/neomagic/engine/nm_bes.c @@ -1,5 +1,5 @@ /* NeoMagic Back End Scaler functions */ -/* Written by Rudolf Cornelissen 05/2002-06/2004 */ +/* Written by Rudolf Cornelissen 05/2002-07/2004 */ #define MODULE_BIT 0x00000200 @@ -453,6 +453,9 @@ status_t nm_configure_bes if (si->ps.card_type >= NM2097) { + /* helper: some cards use pixels to define buffer pitch, others use bytes */ + uint16 buf_pitch = ob->width; + /* PCI card */ LOG(4,("Overlay: accelerant is programming BES\n")); /* unlock card overlay sequencer registers (b5 = 1) */ @@ -485,6 +488,8 @@ status_t nm_configure_bes } else { + /* NM2200 and later cards use bytes to define buffer pitch */ + buf_pitch <<= 1; /* horizontal source end does not use subpixelprecision: granularity is 16 pixels */ //fixme? divide by 16 instead of 8 (if >= NM2200 owners report trouble then use 8!) //fixme? check if overlaybuffer width should also have granularity of 16 now! @@ -555,10 +560,10 @@ status_t nm_configure_bes /* setup brightness to be 'neutral' (two's complement number) */ PCIGRPHW(BRIGHTNESS, 0x00); - /* setup inputbuffer #1 pitch including slopspace (in pixels) */ + /* setup inputbuffer #1 pitch including slopspace */ /* (we don't program the pitch for inputbuffer #2 as it's unused.) */ - PCIGRPHW(BUF1PITCHL, (ob->width & 0xff)); - PCIGRPHW(BUF1PITCHH, ((ob->width >> 8) & 0xff)); + PCIGRPHW(BUF1PITCHL, (buf_pitch & 0xff)); + PCIGRPHW(BUF1PITCHH, ((buf_pitch >> 8) & 0xff)); } else { diff --git a/src/add-ons/kernel/drivers/graphics/neomagic/UPDATE.html b/src/add-ons/kernel/drivers/graphics/neomagic/UPDATE.html index 83e75cece7..6469cad508 100644 --- a/src/add-ons/kernel/drivers/graphics/neomagic/UPDATE.html +++ b/src/add-ons/kernel/drivers/graphics/neomagic/UPDATE.html @@ -6,7 +6,8 @@

Changes done for each driverversion:

head 0.08 (Rudolf)

nm_driver 0.06 (Rudolf)