2d and overlay restrictions update, 'comments doc' update

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8526 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rudolf Cornelissen 2004-08-02 11:58:12 +00:00
parent c60b4ca002
commit 630b1126bb
4 changed files with 39 additions and 50 deletions

View File

@ -3,7 +3,7 @@
This file may be used under the terms of the Be Sample Code License.
Other authors:
Rudolf Cornelissen 4/2003-4/2004
Rudolf Cornelissen 4/2003-8/2004
*/
#ifndef DRIVERINTERFACE_H
@ -245,12 +245,9 @@ typedef struct {
uint32 viscalv;
uint32 hsrcstv;
uint32 hsrcendv;
uint32 hsrclstv;
uint32 a1orgv;
uint32 globctlv;
uint32 v1wghtv;
uint32 weight;
uint32 v1srclstv;
uint8 colkey_r;
uint8 colkey_g;
uint8 colkey_b;

View File

@ -130,16 +130,16 @@
/* NeoMagic BES registers: (> NM2070) (accessible via mapped I/O: >= NM2097) */
#define NMSEQX_BESCTRL2 0x08
#define NMSEQX_0x09 0x09 //??
#define NMSEQX_0x0a 0x0a //??
#define NMSEQX_ZVCAP_DSCAL 0x0a
#define NMSEQX_BUF2ORGL 0x0c
#define NMSEQX_BUF2ORGM 0x0d
#define NMSEQX_BUF2ORGH 0x0e
#define NMSEQX_VSCOORD1L 0x14 /* >= NM2200(?), so clipping done via buffer startadress instead */
#define NMSEQX_VSCOORD2L 0x15 /* >= NM2200(?), so clipping done via buffer startadress instead */
#define NMSEQX_VSCOORD21H 0x16 /* >= NM2200(?), so clipping done via buffer startadress instead */
#define NMSEQX_HSCOORD1L 0x17 /* >= NM2200(?), so clipping done via buffer startadress instead */
#define NMSEQX_HSCOORD2L 0x18 /* >= NM2200(?), so clipping done via buffer startadress instead */
#define NMSEQX_HSCOORD21H 0x19 /* >= NM2200(?), so clipping done via buffer startadress instead */
#define NMSEQX_VD2COORD1L 0x14 /* >= NM2200(?) */
#define NMSEQX_VD2COORD2L 0x15 /* >= NM2200(?) */
#define NMSEQX_VD2COORD21H 0x16 /* >= NM2200(?) */
#define NMSEQX_HD2COORD1L 0x17 /* >= NM2200(?) */
#define NMSEQX_HD2COORD2L 0x18 /* >= NM2200(?) */
#define NMSEQX_HD2COORD21H 0x19 /* >= NM2200(?) */
#define NMSEQX_BUF2PITCHL 0x1a
#define NMSEQX_BUF2PITCHH 0x1b
#define NMSEQX_0x1c 0x1c //??
@ -196,12 +196,12 @@
#define NMGRPHX_PLLC_M 0x9f
/* NeoMagic BES registers: (> NM2070) (accessible via mapped I/O: >= NM2097) */
#define NMGRPHX_BESCTRL1 0xb0
#define NMGRPHX_HDCOORD21H 0xb1
#define NMGRPHX_HDCOORD1L 0xb2
#define NMGRPHX_HDCOORD2L 0xb3
#define NMGRPHX_VDCOORD21H 0xb4
#define NMGRPHX_VDCOORD1L 0xb5
#define NMGRPHX_VDCOORD2L 0xb6
#define NMGRPHX_HD1COORD21H 0xb1
#define NMGRPHX_HD1COORD1L 0xb2
#define NMGRPHX_HD1COORD2L 0xb3
#define NMGRPHX_VD1COORD21H 0xb4
#define NMGRPHX_VD1COORD1L 0xb5
#define NMGRPHX_VD1COORD2L 0xb6
#define NMGRPHX_BUF1ORGH 0xb7
#define NMGRPHX_BUF1ORGM 0xb8
#define NMGRPHX_BUF1ORGL 0xb9
@ -240,7 +240,7 @@
#define NMACC_STATUS 0x0000
#define NMACC_CONTROL 0x0004
#define NMACC_FGCOLOR 0x000c
#define NMACC_2200_PITCH 0x0014
#define NMACC_2200_SRC_PITCH 0x0014
#define NMACC_2090_CLIPLT 0x0018
#define NMACC_2090_CLIPRB 0x001c
#define NMACC_SRCSTARTOFF 0x0024

View File

@ -8,6 +8,8 @@
<ul>
<li>Added full 2D acceleration for all remaining cards that did not have that yet with this driver (still largely untested);
<li>Fixed a long standing problem with MagicMedia (all NM2200 and later) cards with overlay: buffer width is programmed correctly now. Can't believe I didn't see that before!
<li>Updated NM2200 and later cards workspace virtualsize restrictions for accelerated modes: it turns out these cards engines have the same restrictions as most older ones, being 1600x1024 resolution;
<li>Updated overlay scaling restrictions: officially the cards support upto and including 8x upscaling.
</ul>
<p><h1>nm_driver 0.06 (Rudolf)</h1></p>
<ul>

View File

@ -5,7 +5,7 @@
Other authors:
Mark Watson;
Apsed;
Rudolf Cornelissen 5/2002-7/2004.
Rudolf Cornelissen 5/2002-8/2004.
*/
/* standard kernel driver stuff */
@ -926,13 +926,13 @@ void drv_program_bes_ISA(nm_bes_data *bes)
/* we need to wait a bit or the card will mess-up it's register values.. (NM2160) */
snooze(10);
KISAGRPHW(GENLOCK, temp);
/* destination rectangle */
KISAGRPHW(HDCOORD1L, ((bes->hcoordv >> 16) & 0xff));
KISAGRPHW(HDCOORD2L, (bes->hcoordv & 0xff));
KISAGRPHW(HDCOORD21H, (((bes->hcoordv >> 4) & 0xf0) | ((bes->hcoordv >> 24) & 0x0f)));
KISAGRPHW(VDCOORD1L, ((bes->vcoordv >> 16) & 0xff));
KISAGRPHW(VDCOORD2L, (bes->vcoordv & 0xff));
KISAGRPHW(VDCOORD21H, (((bes->vcoordv >> 4) & 0xf0) | ((bes->vcoordv >> 24) & 0x0f)));
/* destination rectangle #1 (output window position and size) */
KISAGRPHW(HD1COORD1L, ((bes->hcoordv >> 16) & 0xff));
KISAGRPHW(HD1COORD2L, (bes->hcoordv & 0xff));
KISAGRPHW(HD1COORD21H, (((bes->hcoordv >> 4) & 0xf0) | ((bes->hcoordv >> 24) & 0x0f)));
KISAGRPHW(VD1COORD1L, ((bes->vcoordv >> 16) & 0xff));
KISAGRPHW(VD1COORD2L, (bes->vcoordv & 0xff));
KISAGRPHW(VD1COORD21H, (((bes->vcoordv >> 4) & 0xf0) | ((bes->vcoordv >> 24) & 0x0f)));
/* scaling */
KISAGRPHW(XSCALEL, (bes->hiscalv & 0xff));
KISAGRPHW(XSCALEH, ((bes->hiscalv >> 8) & 0xff));
@ -940,16 +940,11 @@ void drv_program_bes_ISA(nm_bes_data *bes)
KISAGRPHW(YSCALEH, ((bes->viscalv >> 8) & 0xff));
/* inputbuffer #1 origin */
/* (we don't program buffer #2 as it's unused.) */
/* first include 'pixel precise' left clipping...
* (subpixel precision is not supported by NeoMagic cards) */
bes->a1orgv += ((bes->hsrcstv >> 16) * 2);
/* we need to step in 4-byte (2 pixel) granularity due to the nature of yuy2 */
bes->a1orgv &= ~0x03;
/* now setup buffer startadress and horizontal source end (minimizes used bandwidth) */
if (bes->card_type < NM2200)
{
bes->a1orgv >>= 1;
/* horizontal source end does not use subpixelprecision: granularity is 8 pixels */
/* (horizontal source end minimizes used bandwidth) */
KISAGRPHW(0xbc, (((((bes->hsrcendv >> 16) + 7) & ~8) / 8) - 1));
}
else
@ -957,6 +952,7 @@ void drv_program_bes_ISA(nm_bes_data *bes)
/* NM2200 and later cards use bytes to define buffer pitch */
buf_pitch <<= 1;
/* horizontal source end does not use subpixelprecision: granularity is 16 pixels */
/* (horizontal source end minimizes used bandwidth) */
//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!
KISAGRPHW(0xbc, (((((bes->hsrcendv >> 16) + 15) & ~16) / 16) - 1));
@ -970,11 +966,8 @@ void drv_program_bes_ISA(nm_bes_data *bes)
/* b2 = 0: don't use horizontal mirroring (NM2160) */
/* other bits do ??? */
KISAGRPHW(0xbf, 0x02);
/* (subpixel precise) source rect clipping is not supported on NeoMagic cards;
* so we do 'pixel precise' left clipping via modification of buffer
* startadress above instead.
* (pixel precise top clipping is also done this way..) */
//fixme: checkout real pixel precise clipping on NM2200 and later cards!!!
/* destination rectangle #2 (output window position and size) */
/*
{
uint16 left = 0;
@ -982,17 +975,12 @@ void drv_program_bes_ISA(nm_bes_data *bes)
uint16 top = 0;
uint16 bottom = 128;
left = (bes->hsrcstv >> 16);
right = (bes->hsrclstv >> 16);
top = (bes->weight >> 16);
bottom = (bes->v1srclstv >> 16);
KISASEQW(HSCOORD1L, (left & 0xff));
KISASEQW(HSCOORD2L, (right & 0xff));
KISASEQW(HSCOORD21H, (((right >> 4) & 0xf0) | ((left >> 8) & 0x0f)));
KISASEQW(VSCOORD1L, (top & 0xff));
KISASEQW(VSCOORD2L, (bottom & 0xff));
KISASEQW(VSCOORD21H, (((bottom >> 4) & 0xf0) | ((top >> 8) & 0x0f)));
KISASEQW(HD2COORD1L, (left & 0xff));
KISASEQW(HD2COORD2L, (right & 0xff));
KISASEQW(HD2COORD21H, (((right >> 4) & 0xf0) | ((left >> 8) & 0x0f)));
KISASEQW(VD2COORD1L, (top & 0xff));
KISASEQW(VD2COORD2L, (bottom & 0xff));
KISASEQW(VD2COORD21H, (((bottom >> 4) & 0xf0) | ((top >> 8) & 0x0f)));
}
*/
/* ??? */
@ -1003,8 +991,10 @@ void drv_program_bes_ISA(nm_bes_data *bes)
/* b1 = 0: disable alternating hardware buffers (NM2160) */
/* other bits do ??? */
KISASEQW(0x09, 0x11);
/* ??? */
KISASEQW(0x0a, 0x00);
/* we don't use PCMCIA Zoomed Video port capturing, set 1:1 scale just in case */
/* (b6-4 = Y downscale = 100%, b2-0 = X downscale = 100%;
* downscaling selectable in 12.5% steps on increasing setting by 1) */
KISASEQW(ZVCAP_DSCAL, 0x00);
/* global BES control */
KISAGRPHW(BESCTRL1, (bes->globctlv & 0xff));
KISASEQW(BESCTRL2, ((bes->globctlv >> 8) & 0xff));