summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-05-13 02:58:57 +0000
committerdiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-05-13 02:58:57 +0000
commit6e9cbdc10448203e7c8b2de41447442fcc9f7bae (patch)
tree0ed465592509105fdbeab27fc12ddbb2e3590aa5 /drivers
parenteafe5b7517bbf408ae1ffc936a3abe2313c3b334 (diff)
downloadmpv-6e9cbdc10448203e7c8b2de41447442fcc9f7bae.tar.bz2
mpv-6e9cbdc10448203e7c8b2de41447442fcc9f7bae.tar.xz
whitespace cosmetics: Remove all trailing whitespace.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'drivers')
-rw-r--r--drivers/3dfx.h6
-rw-r--r--drivers/hacking.ati4
-rw-r--r--drivers/mga_vid.c224
-rw-r--r--drivers/mga_vid_test.c34
-rw-r--r--drivers/radeon.h2
-rw-r--r--drivers/radeon_vid.c56
-rw-r--r--drivers/tdfx_vid.c60
-rw-r--r--drivers/tdfx_vid.h2
-rw-r--r--drivers/tdfx_vid_test.c14
9 files changed, 201 insertions, 201 deletions
diff --git a/drivers/3dfx.h b/drivers/3dfx.h
index 123541c865..0cabc492ce 100644
--- a/drivers/3dfx.h
+++ b/drivers/3dfx.h
@@ -346,7 +346,7 @@ typedef struct voodoo_yuv_fb_t voodoo_yuv_fb;
#define GRA_I 0x3ce
#define GRA_D 0x3cf
-#ifndef FB_ACCEL_3DFX_BANSHEE
+#ifndef FB_ACCEL_3DFX_BANSHEE
#define FB_ACCEL_3DFX_BANSHEE 31
#endif
@@ -362,12 +362,12 @@ typedef struct voodoo_yuv_fb_t voodoo_yuv_fb;
#define XYREG(x,y) (((((unsigned long)y) & 0x1FFF) << 16) | (((unsigned long)x) & 0x1FFF))
-//#define TDFXFB_DEBUG
+//#define TDFXFB_DEBUG
#ifdef TDFXFB_DEBUG
#define DPRINTK(a,b...) printk(KERN_DEBUG "fb: %s: " a, __FUNCTION__ , ## b)
#else
#define DPRINTK(a,b...)
-#endif
+#endif
/* ------------------------------------------------------------------------- */
diff --git a/drivers/hacking.ati b/drivers/hacking.ati
index 345c183608..518c3a8f90 100644
--- a/drivers/hacking.ati
+++ b/drivers/hacking.ati
@@ -27,7 +27,7 @@ MPP - Miscellaneous peripheral port. (includes macrovision's filter - copy
protection mechanism)
OV - Video overlay (YUV BES) (include subpictures, gamma correction and
adaptive deinterlacing)
-CAP0 - Video capturing
+CAP0 - Video capturing
CAP1 - Video capturing (second unit)
RT - Rage theatre: video encoding and mixing
MUX - video muxer
@@ -227,7 +227,7 @@ OUTREG(OVERLAY_Y_X_END,((drw_x+drw_w)<<16)|(drw_y+drw_h));
************************************
#define OV0_Y_X_START 0x0400
-#define OV0_Y_X_END 0x0404
+#define OV0_Y_X_END 0x0404
...
diff --git a/drivers/mga_vid.c b/drivers/mga_vid.c
index 41e2b4ba8c..fdbfe04d1b 100644
--- a/drivers/mga_vid.c
+++ b/drivers/mga_vid.c
@@ -63,7 +63,7 @@
#include "mga_vid.h"
-#ifdef CONFIG_MTRR
+#ifdef CONFIG_MTRR
#include <asm/mtrr.h>
#endif
@@ -80,19 +80,19 @@
#define DEFAULT_MGA_VID_MAJOR 178
-#ifndef PCI_DEVICE_ID_MATROX_G200_PCI
+#ifndef PCI_DEVICE_ID_MATROX_G200_PCI
#define PCI_DEVICE_ID_MATROX_G200_PCI 0x0520
#endif
-#ifndef PCI_DEVICE_ID_MATROX_G200_AGP
+#ifndef PCI_DEVICE_ID_MATROX_G200_AGP
#define PCI_DEVICE_ID_MATROX_G200_AGP 0x0521
#endif
-#ifndef PCI_DEVICE_ID_MATROX_G400
+#ifndef PCI_DEVICE_ID_MATROX_G400
#define PCI_DEVICE_ID_MATROX_G400 0x0525
#endif
-#ifndef PCI_DEVICE_ID_MATROX_G550
+#ifndef PCI_DEVICE_ID_MATROX_G550
#define PCI_DEVICE_ID_MATROX_G550 0x2527
#endif
@@ -208,12 +208,12 @@ typedef struct bes_registers_s
uint32_t beshiscal;
//BES Horizontal source start [10.14] (for scaling)
uint32_t beshsrcst;
- //BES Horizontal source ending [10.14] (for scaling)
+ //BES Horizontal source ending [10.14] (for scaling)
uint32_t beshsrcend;
- //BES Horizontal source last
+ //BES Horizontal source last
uint32_t beshsrclst;
-
+
//BES Vertical coord
uint32_t besvcoord;
//BES Vertical inverse scaling [5.14]
@@ -291,7 +291,7 @@ typedef struct crtc2_registers_s
/*CRTC2 registers*/
#define XMISCCTRL 0x1e
-#define C2CTL 0x3c10
+#define C2CTL 0x3c10
#define C2DATACTL 0x3c4c
#define C2MISC 0x3c44
#define C2HPARAM 0x3c14
@@ -323,7 +323,7 @@ typedef struct crtc2_registers_s
#define BESA1CORG 0x3d10
#define BESA1ORG 0x3d00
-#define BESA2C3ORG 0x3d64
+#define BESA2C3ORG 0x3d64
#define BESA2CORG 0x3d14
#define BESA2ORG 0x3d04
@@ -381,7 +381,7 @@ typedef struct mga_card_s {
uint32_t vid_overlay_on;
uint8_t *mmio_base;
- uint32_t mem_base;
+ uint32_t mem_base;
int src_base; // YUV buffer position in video memory
uint32_t ram_size; // how much megabytes videoram we have
uint32_t top_reserved; // reserved space for console font (matroxfb + fastfont)
@@ -391,7 +391,7 @@ typedef struct mga_card_s {
struct pci_dev *pci_dev;
- mga_vid_config_t config;
+ mga_vid_config_t config;
int configured; // set to 1 when the card is configured over ioctl
int colkey_saved;
@@ -400,7 +400,7 @@ typedef struct mga_card_s {
unsigned char colkey_mask[4];
int irq; // = -1
- int next_frame;
+ int next_frame;
} mga_card_t;
#define MGA_MAX_CARDS 16
@@ -427,7 +427,7 @@ MODULE_PARM(major, "i");
static void crtc2_frame_sel(mga_card_t * card, int frame)
{
switch(frame) {
-case 0:
+case 0:
card->cregs.c2pl2startadd0=card->regs.besa1corg;
card->cregs.c2pl3startadd0=card->regs.besa1c3org;
card->cregs.c2startadd0=card->regs.besa1org;
@@ -463,7 +463,7 @@ static void mga_vid_frame_sel(mga_card_t * card, int frame)
//we don't need the vcount protection as we're only hitting
//one register (and it doesn't seem to be double buffered)
card->regs.besctl = (card->regs.besctl & ~0x07000000) + (frame << 25);
- writel( card->regs.besctl, card->mmio_base + BESCTL );
+ writel( card->regs.besctl, card->mmio_base + BESCTL );
// writel( card->regs.besglobctl + ((readl(card->mmio_base + VCOUNT)+2)<<16),
writel( card->regs.besglobctl + (MGA_VSYNC_POS<<16),
@@ -483,7 +483,7 @@ static void mga_vid_write_regs(mga_card_t * card, int restore)
card->mmio_base + BESGLOBCTL);
// color or coordinate keying
-
+
if(restore && card->colkey_saved){
// restore it
card->colkey_saved=0;
@@ -491,12 +491,12 @@ static void mga_vid_write_regs(mga_card_t * card, int restore)
#ifdef MP_DEBUG
printk("mga_vid: Restoring colorkey (ON: %d %02X:%02X:%02X)\n",
card->colkey_on,card->colkey_color[0],card->colkey_color[1],card->colkey_color[2]);
-#endif
+#endif
// Set color key registers:
writeb( XKEYOPMODE, card->mmio_base + PALWTADD);
writeb( card->colkey_on, card->mmio_base + X_DATAREG);
-
+
writeb( XCOLKEY0RED, card->mmio_base + PALWTADD);
writeb( card->colkey_color[0], card->mmio_base + X_DATAREG);
writeb( XCOLKEY0GREEN, card->mmio_base + PALWTADD);
@@ -521,7 +521,7 @@ static void mga_vid_write_regs(mga_card_t * card, int restore)
// Get color key registers:
writeb( XKEYOPMODE, card->mmio_base + PALWTADD);
card->colkey_on=(unsigned char)readb(card->mmio_base + X_DATAREG) & 1;
-
+
writeb( XCOLKEY0RED, card->mmio_base + PALWTADD);
card->colkey_color[0]=(unsigned char)readb(card->mmio_base + X_DATAREG);
writeb( XCOLKEY0GREEN, card->mmio_base + PALWTADD);
@@ -543,19 +543,19 @@ static void mga_vid_write_regs(mga_card_t * card, int restore)
#ifdef MP_DEBUG
printk("mga_vid: Saved colorkey (ON: %d %02X:%02X:%02X)\n",
card->colkey_on, card->colkey_color[0], card->colkey_color[1], card->colkey_color[2]);
-#endif
+#endif
}
-
+
if(!restore){
writeb( XKEYOPMODE, card->mmio_base + PALWTADD);
writeb( card->config.colkey_on, card->mmio_base + X_DATAREG);
- if ( card->config.colkey_on )
+ if ( card->config.colkey_on )
{
uint32_t r=0, g=0, b=0;
writeb( XMULCTRL, card->mmio_base + PALWTADD);
- switch (readb (card->mmio_base + X_DATAREG))
+ switch (readb (card->mmio_base + X_DATAREG))
{
case BPP_8:
/* Need to look up the color index, just using color 0 for now. */
@@ -582,7 +582,7 @@ if(!restore){
break;
}
- // Disable color keying on alpha channel
+ // Disable color keying on alpha channel
writeb( XCOLMSK, card->mmio_base + PALWTADD);
writeb( 0x00, card->mmio_base + X_DATAREG);
writeb( X_COLKEY, card->mmio_base + PALWTADD);
@@ -609,10 +609,10 @@ if(!restore){
}
// Backend Scaler
- writel( card->regs.besctl, card->mmio_base + BESCTL);
+ writel( card->regs.besctl, card->mmio_base + BESCTL);
if(card->is_g400)
- writel( card->regs.beslumactl, card->mmio_base + BESLUMACTL);
- writel( card->regs.bespitch, card->mmio_base + BESPITCH);
+ writel( card->regs.beslumactl, card->mmio_base + BESLUMACTL);
+ writel( card->regs.bespitch, card->mmio_base + BESPITCH);
writel( card->regs.besa1org, card->mmio_base + BESA1ORG);
writel( card->regs.besa1corg, card->mmio_base + BESA1CORG);
@@ -622,7 +622,7 @@ if(!restore){
writel( card->regs.besb1corg, card->mmio_base + BESB1CORG);
writel( card->regs.besb2org, card->mmio_base + BESB2ORG);
writel( card->regs.besb2corg, card->mmio_base + BESB2CORG);
- if(card->is_g400)
+ if(card->is_g400)
{
writel( card->regs.besa1c3org, card->mmio_base + BESA1C3ORG);
writel( card->regs.besa2c3org, card->mmio_base + BESA2C3ORG);
@@ -635,7 +635,7 @@ if(!restore){
writel( card->regs.beshsrcst, card->mmio_base + BESHSRCST);
writel( card->regs.beshsrcend, card->mmio_base + BESHSRCEND);
writel( card->regs.beshsrclst, card->mmio_base + BESHSRCLST);
-
+
writel( card->regs.besvcoord, card->mmio_base + BESVCOORD);
writel( card->regs.besviscal, card->mmio_base + BESVISCAL);
@@ -643,7 +643,7 @@ if(!restore){
writel( card->regs.besv1wght, card->mmio_base + BESV1WGHT);
writel( card->regs.besv2srclst, card->mmio_base + BESV2SRCLST);
writel( card->regs.besv2wght, card->mmio_base + BESV2WGHT);
-
+
//update the registers somewhere between 1 and 2 frames from now.
writel( card->regs.besglobctl + ((readl(card->mmio_base + VCOUNT)+2)<<16),
card->mmio_base + BESGLOBCTL);
@@ -682,7 +682,7 @@ if(!restore){
#ifdef MP_DEBUG
printk("c2offset = %d\n",card->cregs.c2offset);
-#endif
+#endif
writel(card->cregs.c2offset, card->mmio_base + C2OFFSET);
writel(card->cregs.c2startadd0, card->mmio_base + C2STARTADD0);
@@ -699,7 +699,7 @@ if(!restore){
// writel(card->cregs.c2ctl, card->mmio_base + C2CTL);
// printk("c2ctl:0x%08x c2datactl:0x%08x\n",readl(card->mmio_base + C2CTL),readl(card->mmio_base + C2DATACTL));
// printk("c2misc:0x%08x\n", readl(card->mmio_base + C2MISC));
-#endif
+#endif
}
static int mga_vid_set_config(mga_card_t * card)
@@ -725,7 +725,7 @@ static int mga_vid_set_config(mga_card_t * card)
unsigned int vsyncstart = vdispend + lower_margin;
unsigned int vsyncend = vsyncstart + vsync_len;
unsigned int vtotal = vsyncend + upper_margin;
-#endif
+#endif
x = config->x_org;
y = config->y_org;
sw = config->src_width;
@@ -736,7 +736,7 @@ static int mga_vid_set_config(mga_card_t * card)
#ifdef MP_DEBUG
printk(KERN_DEBUG "mga_vid: Setting up a %dx%d+%d+%d video window (src %dx%d) format %X\n",
dw, dh, x, y, sw, sh, config->format);
-#endif
+#endif
if(sw<4 || sh<4 || dw<4 || dh<4){
printk(KERN_ERR "mga_vid: Invalid src/dest dimenstions\n");
@@ -744,15 +744,15 @@ static int mga_vid_set_config(mga_card_t * card)
}
//FIXME check that window is valid and inside desktop
-
- //Setup the BES registers for a three plane 4:2:0 video source
+
+ //Setup the BES registers for a three plane 4:2:0 video source
card->regs.besglobctl = 0;
switch(config->format){
- case MGA_VID_FORMAT_YV12:
- case MGA_VID_FORMAT_I420:
- case MGA_VID_FORMAT_IYUV:
+ case MGA_VID_FORMAT_YV12:
+ case MGA_VID_FORMAT_I420:
+ case MGA_VID_FORMAT_IYUV:
card->regs.besctl = 1 // BES enabled
+ (0<<6) // even start polarity
+ (1<<10) // x filtering enabled
@@ -764,7 +764,7 @@ switch(config->format){
if(card->is_g400)
{
//zoom disabled, zoom filter disabled, 420 3 plane format, proc amp
- //disabled, rgb mode disabled
+ //disabled, rgb mode disabled
card->regs.besglobctl = (1<<5);
}
else
@@ -776,7 +776,7 @@ switch(config->format){
#endif
break;
- case MGA_VID_FORMAT_YUY2:
+ case MGA_VID_FORMAT_YUY2:
card->regs.besctl = 1 // BES enabled
+ (0<<6) // even start polarity
+ (1<<10) // x filtering enabled
@@ -788,7 +788,7 @@ switch(config->format){
card->regs.besglobctl = 0; // YUY2 format selected
break;
- case MGA_VID_FORMAT_UYVY:
+ case MGA_VID_FORMAT_UYVY:
card->regs.besctl = 1 // BES enabled
+ (0<<6) // even start polarity
+ (1<<10) // x filtering enabled
@@ -805,12 +805,12 @@ switch(config->format){
return -1;
}
- // setting black&white mode
- card->regs.besctl|=(card->regs.blackie<<20);
+ // setting black&white mode
+ card->regs.besctl|=(card->regs.blackie<<20);
//Enable contrast and brightness control
card->regs.besglobctl |= (1<<5) + (1<<7);
-
+
// brightness (-128..127) && contrast (0..255)
card->regs.beslumactl = (card->brightness << 16) | ((card->contrast+0x80)&0xFFFF);
@@ -819,19 +819,19 @@ switch(config->format){
bestop = y > 0 ? y : 0;
card->regs.beshcoord = (besleft<<16) + (x + dw-1);
card->regs.besvcoord = (bestop<<16) + (y + dh-1);
-
+
//Setup source dimensions
card->regs.beshsrclst = (sw - 1) << 16;
- card->regs.bespitch = (sw + 31) & ~31 ;
-
+ card->regs.bespitch = (sw + 31) & ~31 ;
+
//Setup horizontal scaling
ifactor = ((sw-1)<<14)/(dw-1);
ofsleft = besleft - x;
-
+
card->regs.beshiscal = ifactor<<2;
card->regs.beshsrcst = (ofsleft*ifactor)<<2;
card->regs.beshsrcend = card->regs.beshsrcst + (((dw - ofsleft - 1) * ifactor) << 2);
-
+
//Setup vertical scaling
ifactor = ((sh-1)<<14)/(dh-1);
ofstop = bestop - y;
@@ -850,9 +850,9 @@ if(config->format==MGA_VID_FORMAT_YV12
||config->format==MGA_VID_FORMAT_I420
){
// planar YUV frames:
- if (card->is_g400)
+ if (card->is_g400)
baseadrofs = ( ( (ofstop * card->regs.besviscal ) / 4 ) >> 16 ) * card->regs.bespitch;
- else
+ else
baseadrofs = ( ( ( ofstop * card->regs.besviscal ) / 2 ) >> 16 ) * card->regs.bespitch;
if(config->format==MGA_VID_FORMAT_YV12 || !card->is_g400){
@@ -887,9 +887,9 @@ if(config->format==MGA_VID_FORMAT_YV12
switch(config->format){
- case MGA_VID_FORMAT_YV12:
- case MGA_VID_FORMAT_I420:
- case MGA_VID_FORMAT_IYUV:
+ case MGA_VID_FORMAT_YV12:
+ case MGA_VID_FORMAT_I420:
+ case MGA_VID_FORMAT_IYUV:
card->cregs.c2ctl = 1 // CRTC2 enabled
+ (1<<1) // external clock
+ (0<<2) // external clock
@@ -945,7 +945,7 @@ switch(config->format){
*/ ;
break;
- case MGA_VID_FORMAT_YUY2:
+ case MGA_VID_FORMAT_YUY2:
card->cregs.c2ctl = 1 // CRTC2 enabled
+ (1<<1) // external clock
+ (0<<2) // external clock
@@ -1003,7 +1003,7 @@ switch(config->format){
*/ ;
break;
- case MGA_VID_FORMAT_UYVY:
+ case MGA_VID_FORMAT_UYVY:
card->cregs.c2ctl = 1 // CRTC2 enabled
+ (1<<1) // external clock
+ (0<<2) // external clock
@@ -1066,7 +1066,7 @@ switch(config->format){
card->cregs.c2hparam = ( (hdispend - 8) << 16) | (htotal - 8);
card->cregs.c2hsync = ( (hsyncend - 8) << 16) | (hsyncstart - 8);
-
+
card->cregs.c2misc=0 // CRTCV2 656 togg f0
+(0<<1) // CRTCV2 656 togg f0
+(0<<2) // CRTCV2 656 togg f0
@@ -1083,21 +1083,21 @@ switch(config->format){
// card->cregs.c2pl2startadd1=card->regs.besa2corg;
card->cregs.c2pl3startadd0=card->regs.besa1c3org;
// card->cregs.c2pl3startadd1=card->regs.besa2c3org;
-
- card->cregs.c2preload=(vsyncstart << 16) | (hsyncstart); // from
-
+
+ card->cregs.c2preload=(vsyncstart << 16) | (hsyncstart); // from
+
card->cregs.c2spicstartadd0=0; // not used
// card->cregs.c2spicstartadd1=0; // not used
-
+
card->cregs.c2startadd0=card->regs.besa1org;
// card->cregs.c2startadd1=card->regs.besa2org;
-
+
card->cregs.c2subpiclut=0; //not used
-
+
card->cregs.c2vparam = ( (vdispend - 1) << 16) | (vtotal - 1);
card->cregs.c2vsync = ( (vsyncend - 1) << 16) | (vsyncstart - 1);
-
+
#endif
mga_vid_write_regs(card, 0);
@@ -1113,11 +1113,11 @@ static void enable_irq(mga_card_t * card){
// printk(KERN_ALERT "*** !!! IRQREG = %d\n", (int)(cc&0xff));
writeb(0x11, card->mmio_base + CRTCX);
-
+
writeb(0x20, card->mmio_base + CRTCD); /* clear 0, enable off */
writeb(0x00, card->mmio_base + CRTCD); /* enable on */
writeb(0x10, card->mmio_base + CRTCD); /* clear = 1 */
-
+
writel(card->regs.besglobctl , card->mmio_base + BESGLOBCTL);
}
@@ -1144,21 +1144,21 @@ static void mga_handle_irq(int irq, void *dev_id, struct pt_regs *pregs) {
cc = readl(card->mmio_base + STATUS);
if ( ! (cc & 0x10) ) return; /* vsyncpen */
// debug_irqcnt++;
- }
+ }
// if ( debug_irqignore ) {
// debug_irqignore = 0;
// frame=(frame+1)&1;
card->regs.besctl = (card->regs.besctl & ~0x07000000) + (card->next_frame << 25);
- writel( card->regs.besctl, card->mmio_base + BESCTL );
+ writel( card->regs.besctl, card->mmio_base + BESCTL );
#ifdef CRTC2
-// sem pridat vyber obrazku !!!!
+// sem pridat vyber obrazku !!!!
// i han echt kei ahnig was das obe heisse söll
crtc2_frame_sel(card->next_frame);
#endif
-
+
#if 0
++counter;
if(!(counter&63)){
@@ -1191,7 +1191,7 @@ static int mga_vid_ioctl(struct inode *inode, struct file *file, unsigned int cm
uint32_t tmp;
mga_card_t * card = (mga_card_t *) file->private_data;
- switch(cmd)
+ switch(cmd)
{
case MGA_VID_GET_VERSION:
tmp = MGA_VID_VERSION;
@@ -1210,7 +1210,7 @@ static int mga_vid_ioctl(struct inode *inode, struct file *file, unsigned int cm
//FIXME remove
printk(KERN_DEBUG "mga_vid: Received configuration\n");
-#endif
+#endif
if(copy_from_user(&card->config,(mga_vid_config_t*) arg,sizeof(mga_vid_config_t)))
{
@@ -1231,7 +1231,7 @@ static int mga_vid_ioctl(struct inode *inode, struct file *file, unsigned int cm
printk(KERN_ERR "mga_vid: illegal num_frames: %d\n",card->config.num_frames);
return -EFAULT;
}
-
+
card->src_base = (card->ram_size * 0x100000 - card->config.num_frames * card->config.frame_size - card->top_reserved);
if(card->src_base<0){
printk(KERN_ERR "mga_vid: not enough memory for frames!\n");
@@ -1240,13 +1240,13 @@ static int mga_vid_ioctl(struct inode *inode, struct file *file, unsigned int cm
card->src_base &= (~0xFFFF); // 64k boundary
#ifdef MP_DEBUG
printk(KERN_DEBUG "mga YUV buffer base: 0x%X\n", card->src_base);
-#endif
-
- if (card->is_g400)
+#endif
+
+ if (card->is_g400)
card->config.card_type = MGA_G400;
else
card->config.card_type = MGA_G200;
-
+
card->config.ram_size = card->ram_size;
if (copy_to_user((mga_vid_config_t *) arg, &card->config, sizeof(mga_vid_config_t)))
@@ -1255,7 +1255,7 @@ static int mga_vid_ioctl(struct inode *inode, struct file *file, unsigned int cm
return -EFAULT;
}
- result = mga_vid_set_config(card);
+ result = mga_vid_set_config(card);
if(!result) card->configured=1;
return result;
break;
@@ -1263,7 +1263,7 @@ static int mga_vid_ioctl(struct inode *inode, struct file *file, unsigned int cm
case MGA_VID_ON:
#ifdef MP_DEBUG
printk(KERN_DEBUG "mga_vid: Video ON\n");
-#endif
+#endif
card->vid_src_ready = 1;
if(card->vid_overlay_on)
{
@@ -1279,8 +1279,8 @@ static int mga_vid_ioctl(struct inode *inode, struct file *file, unsigned int cm
case MGA_VID_OFF:
#ifdef MP_DEBUG
printk(KERN_DEBUG "mga_vid: Video OFF (ioctl)\n");
-#endif
- card->vid_src_ready = 0;
+#endif
+ card->vid_src_ready = 0;
#ifdef MGA_ALLOW_IRQ
if ( card->irq != -1 ) disable_irq(card);
#endif
@@ -1288,7 +1288,7 @@ static int mga_vid_ioctl(struct inode *inode, struct file *file, unsigned int cm
card->regs.besglobctl &= ~(1<<6); // UYVY format selected
mga_vid_write_regs(card, 0);
break;
-
+
case MGA_VID_FSEL:
if(copy_from_user(&frame,(int *) arg,sizeof(int)))
{
@@ -1311,7 +1311,7 @@ static int mga_vid_ioctl(struct inode *inode, struct file *file, unsigned int cm
return -EFAULT;
}
break;
-
+
case MGA_VID_SET_LUMA:
tmp = arg;
card->brightness=tmp>>16; card->contrast=tmp&0xFFFF;
@@ -1319,12 +1319,12 @@ static int mga_vid_ioctl(struct inode *inode, struct file *file, unsigned int cm
card->regs.beslumactl = (card->brightness << 16) | ((card->contrast+0x80)&0xFFFF);
mga_vid_write_regs(card, 0);
break;
-
+
default:
printk(KERN_ERR "mga_vid: Invalid ioctl\n");
return -EINVAL;
}
-
+
return 0;
}
@@ -1349,15 +1349,15 @@ static int mga_vid_find_card(void)
}
card = kmalloc(sizeof(mga_card_t), GFP_KERNEL);
- if(!card)
- {
+ if(!card)
+ {
printk(KERN_ERR "mga_vid: memory allocation failed\n");
mga_cards_num--;
break;
}
-
+
mga_cards[mga_cards_num - 1] = card;
-
+
switch(dev->device) {
case PCI_DEVICE_ID_MATROX_G550:
mga_dev_name = "MGA G550";
@@ -1385,14 +1385,14 @@ static int mga_vid_find_card(void)
break;
}
}
-
+
if(!mga_cards_num)
{
printk(KERN_ERR "mga_vid: No supported cards found\n");
} else {
printk(KERN_INFO "mga_vid: %d supported cards found\n", mga_cards_num);
}
-
+
return mga_cards_num;
}
@@ -1419,7 +1419,7 @@ static ssize_t mga_vid_read(struct file *file, char *buf, size_t count, loff_t *
{
uint32_t size;
mga_card_t * card = (mga_card_t *) file->private_data;
-
+
if(!card->param_buff) return -ESPIPE;
if(!(*ppos)) mga_param_buff_fill(card);
if(*ppos >= card->param_buff_len) return 0;
@@ -1437,18 +1437,18 @@ static ssize_t mga_vid_write(struct file *file, const char *buf, size_t count, l
{
short brightness;
brightness=simple_strtol(&buf[strlen(PARAM_BRIGHTNESS)],NULL,10);
- if (brightness>127 || brightness<-128) { brightness=0;}
+ if (brightness>127 || brightness<-128) { brightness=0;}
// printk(KERN_DEBUG "mga_vid: brightness modified ( %d ) \n",brightness);
card->brightness=brightness;
- } else
+ } else
if(memcmp(buf,PARAM_CONTRAST,min(count,strlen(PARAM_CONTRAST))) == 0)
{
short contrast;
contrast=simple_strtol(&buf[strlen(PARAM_CONTRAST)],NULL,10);
- if (contrast>127 || contrast<-128) { contrast=0;}
+ if (contrast>127 || contrast<-128) { contrast=0;}
// printk(KERN_DEBUG "mga_vid: contrast modified ( %d ) \n",contrast);
card->contrast=contrast;
- } else
+ } else
if(memcmp(buf,PARAM_BLACKIE,min(count,strlen(PARAM_BLACKIE))) == 0)
{
@@ -1467,7 +1467,7 @@ static int mga_vid_mmap(struct file *file, struct vm_area_struct *vma)
#ifdef MP_DEBUG
printk(KERN_DEBUG "mga_vid: mapping video memory into userspace\n");
-#endif
+#endif
if(!card->configured)
{
@@ -1476,7 +1476,7 @@ static int mga_vid_mmap(struct file *file, struct vm_area_struct *vma)
}
if(remap_page_range(vma->vm_start, card->mem_base + card->src_base,
- vma->vm_end - vma->vm_start, vma->vm_page_prot))
+ vma->vm_end - vma->vm_start, vma->vm_page_prot))
{
printk(KERN_ERR "mga_vid: error mapping video memory\n");
return -EAGAIN;
@@ -1492,11 +1492,11 @@ static int mga_vid_release(struct inode *inode, struct file *file)
//Close the window just in case
#ifdef MP_DEBUG
printk(KERN_DEBUG "mga_vid: Video OFF (release)\n");
-#endif
+#endif
card = (mga_card_t *) file->private_data;
- card->vid_src_ready = 0;
+ card->vid_src_ready = 0;
card->regs.besctl &= ~1;
card->regs.besglobctl &= ~(1<<6); // UYVY format selected
// card->config.colkey_on=0; //!!!
@@ -1510,12 +1510,12 @@ static int mga_vid_release(struct inode *inode, struct file *file)
static long long mga_vid_lseek(struct file *file, long long offset, int origin)
{
return -ESPIPE;
-}
+}
static int mga_vid_open(struct inode *inode, struct file *file)
{
mga_card_t * card;
-
+
int minor = MINOR(inode->i_rdev);
if(!file->private_data)
@@ -1530,17 +1530,17 @@ static int mga_vid_open(struct inode *inode, struct file *file)
file->private_data = mga_cards[minor];
#ifdef MP_DEBUG
printk(KERN_DEBUG "mga_vid: Not using devfs\n");
-#endif
+#endif
}
#ifdef MP_DEBUG
else {
printk(KERN_DEBUG "mga_vid: Using devfs\n");
}
-#endif
+#endif
card = (mga_card_t *) file->private_data;
- if(card->vid_in_use == 1)
+ if(card->vid_in_use == 1)
return -EBUSY;
card->vid_in_use = 1;
@@ -1596,7 +1596,7 @@ static void cards_init(mga_card_t * card, struct pci_dev * dev, int card_number,
card->brightness = mga_brightness[card_number];
card->contrast = mga_contrast[card_number];
card->top_reserved = mga_top_reserved[card_number];
-
+
#if LINUX_VERSION_CODE >= 0x020300
card->mmio_base = ioremap_nocache(dev->resource[1].start,0x4000);
card->mem_base = dev->resource[0].start;
@@ -1626,7 +1626,7 @@ static void cards_init(mga_card_t * card, struct pci_dev * dev, int card_number,
// SDRAM:
case 0x00:
case 0x04: card->ram_size = 16; break;
- case 0x03:
+ case 0x03:
case 0x05: card->ram_size = 32; break;
// SGRAM:
case 0x10:
@@ -1652,7 +1652,7 @@ static void cards_init(mga_card_t * card, struct pci_dev * dev, int card_number,
// case 0x13: card->ram_size = 8; break;
default: card->ram_size = 8;
}
- }
+ }
#if 0
// printk("List resources -----------\n");
for(temp=0;temp<DEVICE_COUNT_RESOURCE;temp++){
@@ -1700,8 +1700,8 @@ static void cards_init(mga_card_t * card, struct pci_dev * dev, int card_number,
}
-/*
- * Main Initialization Function
+/*
+ * Main Initialization Function
*/
static int mga_vid_initialize(void)
@@ -1720,7 +1720,7 @@ static int mga_vid_initialize(void)
}
}
}
-
+
if(register_chrdev(major, "mga_vid", &mga_vid_fops))
{
printk(KERN_ERR "mga_vid: unable to get major: %d\n", major);
diff --git a/drivers/mga_vid_test.c b/drivers/mga_vid_test.c
index 05ae2739bd..05f41dbdf2 100644
--- a/drivers/mga_vid_test.c
+++ b/drivers/mga_vid_test.c
@@ -50,16 +50,16 @@ write_frame_g200(uint8_t *y,uint8_t *cr, uint8_t *cb)
dest = mga_vid_base;
bespitch = (config.src_width + 31) & ~31;
- for(h=0; h < config.src_height; h++)
+ for(h=0; h < config.src_height; h++)
{
memcpy(dest, y, config.src_width);
y += config.src_width;
dest += bespitch;
}
- for(h=0; h < config.src_height/2; h++)
+ for(h=0; h < config.src_height/2; h++)
{
- for(w=0; w < config.src_width/2; w++)
+ for(w=0; w < config.src_width/2; w++)
{
*dest++ = *cb++;
*dest++ = *cr++;
@@ -77,21 +77,21 @@ write_frame_g400(uint8_t *y,uint8_t *cr, uint8_t *cb)
dest = mga_vid_base;
bespitch = (config.src_width + 31) & ~31;
- for(h=0; h < config.src_height; h++)
+ for(h=0; h < config.src_height; h++)
{
memcpy(dest, y, config.src_width);
y += config.src_width;
dest += bespitch;
}
- for(h=0; h < config.src_height/2; h++)
+ for(h=0; h < config.src_height/2; h++)
{
memcpy(dest, cb, config.src_width/2);
cb += config.src_width/2;
dest += bespitch/2;
}
- for(h=0; h < config.src_height/2; h++)
+ for(h=0; h < config.src_height/2; h++)
{
memcpy(dest, cr, config.src_width/2);
cr += config.src_width/2;
@@ -120,15 +120,15 @@ draw_cool_pattern(void)
}
i = 0;
- for (y=0; y<config.src_height/2; y++)
- for (x=0; x<config.src_width/2; x++)
+ for (y=0; y<config.src_height/2; y++)
+ for (x=0; x<config.src_width/2; x++)
{
cr_image[i++] = x - 128;
}
i = 0;
- for (y=0; y<config.src_height/2; y++)
- for (x=0; x<config.src_width/2; x++)
+ for (y=0; y<config.src_height/2; y++)
+ for (x=0; x<config.src_width/2; x++)
{
cb_image[i++] = y - 128;
}
@@ -147,22 +147,22 @@ draw_color_blend(void)
}
i = 0;
- for (y=0; y<config.src_height/2; y++)
- for (x=0; x<config.src_width/2; x++)
+ for (y=0; y<config.src_height/2; y++)
+ for (x=0; x<config.src_width/2; x++)
{
cr_image[i++] = x - 128;
}
i = 0;
- for (y=0; y<config.src_height/2; y++)
- for (x=0; x<config.src_width/2; x++)
+ for (y=0; y<config.src_height/2; y++)
+ for (x=0; x<config.src_width/2; x++)
{
cb_image[i++] = y - 128;
}
}
-int
+int
main(void)
{
int f;
@@ -192,7 +192,7 @@ main(void)
perror("Error in config ioctl");
}
- if (config.card_type == MGA_G200)
+ if (config.card_type == MGA_G200)
{
printf("Testing MGA G200 Backend Scaler with %d MB of RAM\n", config.ram_size);
is_g400 = 0;
@@ -202,7 +202,7 @@ main(void)
printf("Testing MGA G400 Backend Scaler with %d MB of RAM\n", config.ram_size);
is_g400 = 1;
}
-
+
ioctl(f,MGA_VID_ON,0);
mga_vid_base = (uint8_t*)mmap(0,256 * 4096,PROT_WRITE,MAP_SHARED,f,0);
printf("mga_vid_base = %8p\n",mga_vid_base);
diff --git a/drivers/radeon.h b/drivers/radeon.h
index 0293981e6f..de04b54270 100644
--- a/drivers/radeon.h
+++ b/drivers/radeon.h
@@ -1240,7 +1240,7 @@
#define SOFT_RESET_PCLK 0x00000200
#define SOFT_RESET_ECP 0x00000400
#define SOFT_RESET_DISPENG_XCLK 0x00000800
-
+
/* RAGE THEATER REGISTERS */
#define DMA_VIPH0_COMMAND 0x0A00
diff --git a/drivers/radeon_vid.c b/drivers/radeon_vid.c
index 5514f1cb6c..222f03b375 100644
--- a/drivers/radeon_vid.c
+++ b/drivers/radeon_vid.c
@@ -67,7 +67,7 @@
#include "radeon_vid.h"
#include "radeon.h"
-#ifdef CONFIG_MTRR
+#ifdef CONFIG_MTRR
#include <asm/mtrr.h>
#endif
@@ -90,7 +90,7 @@ MODULE_DESCRIPTION("Accelerated YUV BES driver for Radeons. Version: "RADEON_VID
#ifdef MODULE_LICENSE
MODULE_LICENSE("GPL");
#endif
-#ifdef CONFIG_MTRR
+#ifdef CONFIG_MTRR
MODULE_PARM(mtrr, "i");
MODULE_PARM_DESC(mtrr, "Tune MTRR (touch=1(default))");
static int mtrr __initdata = 1;
@@ -193,17 +193,17 @@ typedef struct bes_registers_s
uint32_t test;
/* Configurable stuff */
int double_buff;
-
+
int brightness;
int saturation;
-
+
int ckey_on;
uint32_t graphics_key_clr;
uint32_t graphics_key_msk;
-
+
int deinterlace_on;
uint32_t deinterlace_pattern;
-
+
} bes_registers_t;
typedef struct video_registers_s
@@ -225,7 +225,7 @@ static int IsR200=0;
#define DECLARE_VREG(name) { name, 0 }
#endif
#ifdef DEBUG
-static video_registers_t vregs[] =
+static video_registers_t vregs[] =
{
DECLARE_VREG(VIDEOMUX_CNTL),
DECLARE_VREG(VIPPAD_MASK),
@@ -323,14 +323,14 @@ static video_registers_t vregs[] =
static uint32_t radeon_vid_in_use = 0;
static uint8_t *radeon_mmio_base = 0;
-static uint32_t radeon_mem_base = 0;
+static uint32_t radeon_mem_base = 0;
static int32_t radeon_overlay_off = 0;
static uint32_t radeon_ram_size = 0;
#define PARAM_BUFF_SIZE 4096
static uint8_t *radeon_param_buff = NULL;
static uint32_t radeon_param_buff_size=0;
static uint32_t radeon_param_buff_len=0; /* real length of buffer */
-static mga_vid_config_t radeon_config;
+static mga_vid_config_t radeon_config;
static char *fourcc_format_name(int format)
{
@@ -562,7 +562,7 @@ static void radeon_set_transform(float bright, float cont, float sat,
CAdjGCr = sat * (OvHueSin * trans[ref].RefGCb + OvHueCos * trans[ref].RefGCr);
CAdjBCb = sat * OvHueCos * trans[ref].RefBCb;
CAdjBCr = sat * OvHueSin * trans[ref].RefBCb;
-
+
#if 0 /* default constants */
CAdjLuma = 1.16455078125;
@@ -582,16 +582,16 @@ static void radeon_set_transform(float bright, float cont, float sat,
OvBCr = CAdjBCr;
OvROff = CAdjOff -
OvLuma * Loff - (OvRCb + OvRCr) * Coff;
- OvGOff = CAdjOff -
+ OvGOff = CAdjOff -
OvLuma * Loff - (OvGCb + OvGCr) * Coff;
- OvBOff = CAdjOff -
+ OvBOff = CAdjOff -
OvLuma * Loff - (OvBCb + OvBCr) * Coff;
#if 0 /* default constants */
OvROff = -888.5;
OvGOff = 545;
OvBOff = -1104;
-#endif
-
+#endif
+
dwOvROff = ((int)(OvROff * 2.0)) & 0x1fff;
dwOvGOff = (int)(OvGOff * 2.0) & 0x1fff;
dwOvBOff = (int)(OvBOff * 2.0) & 0x1fff;
@@ -627,7 +627,7 @@ static void radeon_set_transform(float bright, float cont, float sat,
#ifndef RAGE128
/* Gamma curve definition */
-typedef struct
+typedef struct
{
unsigned int gammaReg;
unsigned int gammaSlope;
@@ -635,7 +635,7 @@ typedef struct
}GAMMA_SETTINGS;
/* Recommended gamma curve parameters */
-GAMMA_SETTINGS r200_def_gamma[18] =
+GAMMA_SETTINGS r200_def_gamma[18] =
{
{OV0_GAMMA_0_F, 0x100, 0x0000},
{OV0_GAMMA_10_1F, 0x100, 0x0020},
@@ -657,7 +657,7 @@ GAMMA_SETTINGS r200_def_gamma[18] =
{OV0_GAMMA_3C0_3FF, 0x100, 0x0700}
};
-GAMMA_SETTINGS r100_def_gamma[6] =
+GAMMA_SETTINGS r100_def_gamma[6] =
{
{OV0_GAMMA_0_F, 0x100, 0x0000},
{OV0_GAMMA_10_1F, 0x100, 0x0020},
@@ -864,7 +864,7 @@ RTRACE(RVID_MSG"usr_config: version = %x format=%x card=%x ram=%u src(%ux%u) des
/* 4:1:0 */
case IMGFMT_IF09:
case IMGFMT_YVU9:
- /* 4:2:0 */
+ /* 4:2:0 */
case IMGFMT_IYUV:
case IMGFMT_YV12:
case IMGFMT_I420:
@@ -1089,7 +1089,7 @@ static int radeon_vid_ioctl(struct inode *inode, struct file *file, unsigned int
radeon_config.colkey_red,
radeon_config.colkey_green,
radeon_config.colkey_blue);
- if(swap_fourcc) radeon_config.format = swab32(radeon_config.format);
+ if(swap_fourcc) radeon_config.format = swab32(radeon_config.format);
printk(RVID_MSG"configuring for '%s' fourcc\n",fourcc_format_name(radeon_config.format));
return radeon_vid_init_video(&radeon_config);
break;
@@ -1235,9 +1235,9 @@ static int __init radeon_vid_config_card(void)
radeon_ram_size /= 0x100000;
detected_chip = i;
printk(RVID_MSG"Found %s (%uMb memory)\n",ati_card_ids[i].name,radeon_ram_size);
-#ifndef RAGE128
- if(ati_card_ids[i].id == PCI_DEVICE_ID_R200_QL ||
- ati_card_ids[i].id == PCI_DEVICE_ID_R200_BB ||
+#ifndef RAGE128
+ if(ati_card_ids[i].id == PCI_DEVICE_ID_R200_QL ||
+ ati_card_ids[i].id == PCI_DEVICE_ID_R200_BB ||
ati_card_ids[i].id == PCI_DEVICE_ID_RV200_QW) IsR200 = 1;
#endif
return TRUE;
@@ -1323,7 +1323,7 @@ static ssize_t radeon_vid_write(struct file *file, const char *buf, size_t count
{
long brightness;
brightness=simple_strtol(&buf[strlen(PARAM_BRIGHTNESS)],NULL,10);
- if(brightness >= -64 && brightness <= 63)
+ if(brightness >= -64 && brightness <= 63)
{
besr.brightness = brightness;
OUTREG(OV0_COLOUR_CNTL, (brightness & 0x7f) |
@@ -1402,7 +1402,7 @@ static int radeon_vid_mmap(struct file *file, struct vm_area_struct *vma)
RTRACE(RVID_MSG"mapping video memory into userspace\n");
if(remap_page_range(vma->vm_start, radeon_mem_base + radeon_overlay_off,
- vma->vm_end - vma->vm_start, vma->vm_page_prot))
+ vma->vm_end - vma->vm_start, vma->vm_page_prot))
{
printk(RVID_MSG"error mapping video memory\n");
return -EAGAIN;
@@ -1423,7 +1423,7 @@ static int radeon_vid_release(struct inode *inode, struct file *file)
static long long radeon_vid_lseek(struct file *file, long long offset, int origin)
{
return -ESPIPE;
-}
+}
static int radeon_vid_open(struct inode *inode, struct file *file)
{
@@ -1432,7 +1432,7 @@ static int radeon_vid_open(struct inode *inode, struct file *file)
if(minor != 0)
return -ENXIO;
- if(radeon_vid_in_use == 1)
+ if(radeon_vid_in_use == 1)
return -EBUSY;
radeon_vid_in_use = 1;
@@ -1483,8 +1483,8 @@ static struct file_operations radeon_vid_fops =
};
#endif
-/*
- * Main Initialization Function
+/*
+ * Main Initialization Function
*/
static int __init radeon_vid_initialize(void)
diff --git a/drivers/tdfx_vid.c b/drivers/tdfx_vid.c
index 6c38d2cf11..501f5fc603 100644
--- a/drivers/tdfx_vid.c
+++ b/drivers/tdfx_vid.c
@@ -96,7 +96,7 @@ static inline void tdfx_outl(unsigned int reg, u32 val) {
static inline void banshee_make_room(int size) {
while((tdfx_inl(STATUS) & 0x1f) < size);
}
-
+
static inline void banshee_wait_idle(void) {
int i = 0;
@@ -116,15 +116,15 @@ static unsigned long get_lfb_size(void) {
u32 lfbsize = 0;
int sgram_p = 0;
- draminit0 = tdfx_inl(DRAMINIT0);
+ draminit0 = tdfx_inl(DRAMINIT0);
draminit1 = tdfx_inl(DRAMINIT1);
if ((pci_dev->device == PCI_DEVICE_ID_3DFX_BANSHEE) ||
(pci_dev->device == PCI_DEVICE_ID_3DFX_VOODOO3)) {
sgram_p = (draminit1 & DRAMINIT1_MEM_SDRAM) ? 0 : 1;
-
+
lfbsize = sgram_p ?
- (((draminit0 & DRAMINIT0_SGRAM_NUM) ? 2 : 1) *
+ (((draminit0 & DRAMINIT0_SGRAM_NUM) ? 2 : 1) *
((draminit0 & DRAMINIT0_SGRAM_TYPE) ? 8 : 4) * 1024 * 1024) :
16 * 1024 * 1024;
} else {
@@ -144,7 +144,7 @@ static unsigned long get_lfb_size(void) {
miscinit1 |= sgram_p ? 0 : MISCINIT1_2DBLOCK_DIS;
miscinit1 |= MISCINIT1_CLUT_INV;
- banshee_make_room(1);
+ banshee_make_room(1);
tdfx_outl(MISCINIT1, miscinit1);
#endif
@@ -163,7 +163,7 @@ static int tdfx_vid_find_card(void)
else
return 0;
-
+
pci_dev = dev;
#if LINUX_VERSION_CODE >= 0x020300
@@ -181,7 +181,7 @@ static int tdfx_vid_find_card(void)
printk(KERN_INFO "tdfx_vid: Found %d MB (%d bytes) of memory\n",
tdfx_ram_size / 1024 / 1024,tdfx_ram_size);
-
+
#if 0
{
int temp;
@@ -232,12 +232,12 @@ static int agp_init(void) {
#endif
drm_agp->enable(agp_info.mode);
-
+
printk(KERN_INFO "AGP Enabled\n");
return 1;
}
-
+
static void agp_close(void) {
if(!drm_agp) return;
@@ -247,7 +247,7 @@ static void agp_close(void) {
drm_agp->free_memory(agp_mem);
agp_mem = NULL;
}
-
+
drm_agp->release();
inter_module_put("drm_agp");
@@ -306,7 +306,7 @@ static void setup_fifo(u32 offset,ssize_t pages) {
tdfx_outl(CMDBASESIZE0,size);
banshee_wait_idle();
-
+
}
#endif
@@ -407,7 +407,7 @@ static int tdfx_vid_blit(tdfx_vid_blit_t* blit) {
u32 cmin,cmax,srcbase,srcxy,srcfmt,srcsize;
u32 dstbase,dstxy,dstfmt,dstsize = 0;
u32 cmd_extra = 0,src_ck[2],dst_ck[2],rop123=0;
-
+
//printk(KERN_INFO "tdfx_vid: Make src fmt 0x%x\n",blit->src_format);
src_fmt = tdfx_vid_make_format(1,blit->src_stride,blit->src_format);
if(!src_fmt)
@@ -423,10 +423,10 @@ static int tdfx_vid_blit(tdfx_vid_blit_t* blit) {
// No stretch : fix me the cmd should be 1 but it
// doesn't work. Maybe some other regs need to be set
// as non-stretch blit have more options
- if(((!blit->dst_w) && (!blit->dst_h)) ||
+ if(((!blit->dst_w) && (!blit->dst_h)) ||
((blit->dst_w == blit->src_w) && (blit->dst_h == blit->src_h)))
cmd = 2;
-
+
// Save the regs otherwise fb get crazy
// we can perhaps avoid some ...
banshee_wait_idle();
@@ -451,14 +451,14 @@ static int tdfx_vid_blit(tdfx_vid_blit_t* blit) {
dst_ck[0] = tdfx_inl(DSTCOLORKEYMIN);
dst_ck[1] = tdfx_inl(DSTCOLORKEYMAX);
tdfx_outl(SRCCOLORKEYMIN,blit->dst_colorkey[0]);
- tdfx_outl(SRCCOLORKEYMAX,blit->dst_colorkey[1]);
+ tdfx_outl(SRCCOLORKEYMAX,blit->dst_colorkey[1]);
}
if(blit->colorkey) {
cmd_extra = tdfx_inl(COMMANDEXTRA_2D);
rop123 = tdfx_inl(ROP123);
tdfx_outl(COMMANDEXTRA_2D, blit->colorkey);
tdfx_outl(ROP123,(blit->rop[1] | (blit->rop[2] << 8) | blit->rop[3] << 16));
-
+
}
// Get rid of the clipping at the moment
tdfx_outl(CLIP0MIN,0);
@@ -499,7 +499,7 @@ static int tdfx_vid_blit(tdfx_vid_blit_t* blit) {
}
if(blit->colorkey & TDFX_VID_DST_COLORKEY) {
tdfx_outl(SRCCOLORKEYMIN,dst_ck[0]);
- tdfx_outl(SRCCOLORKEYMAX,dst_ck[1]);
+ tdfx_outl(SRCCOLORKEYMAX,dst_ck[1]);
}
if(blit->colorkey) {
tdfx_outl(COMMANDEXTRA_2D,cmd_extra);
@@ -518,9 +518,9 @@ static int tdfx_vid_set_yuv(unsigned long arg) {
banshee_make_room(2);
tdfx_outl(YUVBASEADDRESS,yuv.base & 0x01FFFFFF);
tdfx_outl(YUVSTRIDE, yuv.stride & 0x3FFF);
-
+
banshee_wait_idle();
-
+
return 0;
}
@@ -779,7 +779,7 @@ static int tdfx_vid_ioctl(struct inode *inode, struct file *file, unsigned int c
default:
printk(KERN_ERR "tdfx_vid: Invalid ioctl %d\n",cmd);
return -EINVAL;
- }
+ }
return 0;
}
@@ -802,7 +802,7 @@ static void tdfx_vid_mopen(struct vm_area_struct *vma) {
unsigned long phys;
printk(KERN_DEBUG "tdfx_vid: mopen\n");
-
+
for(i = 0 ; i < agp_mem->page_count ; i++) {
phys = agp_mem->memory[i] & ~(0x00000fff);
page = virt_to_page(phys_to_virt(phys));
@@ -836,7 +836,7 @@ static void tdfx_vid_mclose(struct vm_area_struct *vma) {
}
static struct page *tdfx_vid_nopage(struct vm_area_struct *vma,
- unsigned long address,
+ unsigned long address,
int write_access) {
unsigned long off;
uint32_t n;
@@ -883,10 +883,10 @@ static int tdfx_vid_mmap(struct file *file, struct vm_area_struct *vma)
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,3)
if(remap_page_range(vma, vma->vm_start,map_start,
- vma->vm_end - vma->vm_start, vma->vm_page_prot))
+ vma->vm_end - vma->vm_start, vma->vm_page_prot))
#else
if(remap_page_range(vma->vm_start, (unsigned long)map_start,
- vma->vm_end - vma->vm_start, vma->vm_page_prot))
+ vma->vm_end - vma->vm_start, vma->vm_page_prot))
#endif
{
printk(KERN_ERR "tdfx_vid: error mapping video memory\n");
@@ -919,10 +919,10 @@ static int tdfx_vid_mmap(struct file *file, struct vm_area_struct *vma)
if(tdfx_map_io) {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,3)
if(remap_page_range(vma, vma->vm_start,agp_info.aper_base,
- vma->vm_end - vma->vm_start, vma->vm_page_prot))
+ vma->vm_end - vma->vm_start, vma->vm_page_prot))
#else
if(remap_page_range(vma->vm_start, (unsigned long)agp_info.aper_base,
- vma->vm_end - vma->vm_start, vma->vm_page_prot))
+ vma->vm_end - vma->vm_start, vma->vm_page_prot))
#endif
{
printk(KERN_ERR "tdfx_vid: error mapping video memory\n");
@@ -952,7 +952,7 @@ static int tdfx_vid_release(struct inode *inode, struct file *file)
drm_agp->free_memory(agp_mem);
agp_mem = NULL;
}
-
+
tdfx_vid_in_use = 0;
MOD_DEC_USE_COUNT;
@@ -962,7 +962,7 @@ static int tdfx_vid_release(struct inode *inode, struct file *file)
static long long tdfx_vid_lseek(struct file *file, long long offset, int origin)
{
return -ESPIPE;
-}
+}
static int tdfx_vid_open(struct inode *inode, struct file *file)
{
@@ -975,7 +975,7 @@ static int tdfx_vid_open(struct inode *inode, struct file *file)
if(minor != 0)
return -ENXIO;
- if(tdfx_vid_in_use == 1)
+ if(tdfx_vid_in_use == 1)
return -EBUSY;
tdfx_vid_in_use = 1;
@@ -1033,7 +1033,7 @@ int init_module(void)
return -EINVAL;
}
-
+
return 0;
diff --git a/drivers/tdfx_vid.h b/drivers/tdfx_vid.h
index 4860431193..434e734e46 100644
--- a/drivers/tdfx_vid.h
+++ b/drivers/tdfx_vid.h
@@ -52,7 +52,7 @@
#define TDFX_VID_YUV_STRIDE (1024)
#define TDFX_VID_YUV_PLANE_SIZE (0x0100000)
-
+
typedef struct tdfx_vid_blit_s {
uint32_t src;
diff --git a/drivers/tdfx_vid_test.c b/drivers/tdfx_vid_test.c
index af9c86adcf..39a14f5437 100644
--- a/drivers/tdfx_vid_test.c
+++ b/drivers/tdfx_vid_test.c
@@ -38,9 +38,9 @@ static void print_tdfd_vid_cfg(tdfx_vid_config_t* cfg) {
" Screen: %d x %d\n",
cfg->version,
cfg->ram_size,
- cfg->screen_width, cfg->screen_height);
+ cfg->screen_width, cfg->screen_height);
}
-
+
int main(void) {
int fd;
@@ -63,7 +63,7 @@ int main(void) {
close(fd);
return 1;
}
-
+
print_tdfd_vid_cfg(&cfg);
mem = mmap( NULL, 640*480*2, PROT_READ | PROT_WRITE, MAP_SHARED,
@@ -79,9 +79,9 @@ int main(void) {
/* ptr[1] = (i & 0xFF); */
/* ptr += 2; */
/* } */
-
+
memset(mem,0xFF,640*480*2);
-
+
memset(&move, 0, sizeof(tdfx_vid_agp_move_t));
move.width = 640;
move.height = 240;
@@ -92,7 +92,7 @@ int main(void) {
printf("AGP Move failed !!!!\n");
return 0;
}
-
+
printf("AGP Move ????\n");
sleep(1);
@@ -114,7 +114,7 @@ int main(void) {
printf("Blit failed !!!!\n");
return 0;
}
-
+
close(fd);
return 1;
}