Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0058b4b authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Florian Tobias Schandinat
Browse files

fbdev/amifb: Correct whitespace



  - indentation
  - spacing around binary operators

No functional changes

Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
parent 64cebcb5
Loading
Loading
Loading
Loading
+606 −580
Original line number Diff line number Diff line
@@ -212,14 +212,14 @@
   display parameters. Here's what I found out:

      - ddfstrt and ddfstop are best aligned to 64 pixels.
      - the chipset needs 64+4 horizontal pixels after the DMA start before the
        first pixel is output, so diwstrt_h = ddfstrt+64+4 if you want to
        display the first pixel on the line too. Increase diwstrt_h for virtual
        screen panning.
      - the chipset needs 64 + 4 horizontal pixels after the DMA start before
	the first pixel is output, so diwstrt_h = ddfstrt + 64 + 4 if you want
	to display the first pixel on the line too. Increase diwstrt_h for
	virtual screen panning.
      - the display DMA always fetches 64 pixels at a time (fmode = 3).
      - ddfstop is ddfstrt+#pixels - 64.
      - diwstop_h = diwstrt_h+xres+1. Because of the additional 1 this can be 1
        more than htotal.
      - diwstop_h = diwstrt_h + xres + 1. Because of the additional 1 this can
	be 1 more than htotal.
      - hscroll simply adds a delay to the display output. Smooth horizontal
	panning needs an extra 64 pixels on the left to prefetch the pixels that
	`fall off' on the left.
@@ -345,12 +345,13 @@
      - make sure upper_margin + yres + lower_margin + vsync_len = 625 for an
	interlaced, 312 for a non-interlaced and 156 for a doublescanned
	display.
      - make sure left_margin+xres+right_margin+hsync_len = 1816 for a SHRES,
        908 for a HIRES and 454 for a LORES display.
      - make sure left_margin + xres + right_margin + hsync_len = 1816 for a
	SHRES, 908 for a HIRES and 454 for a LORES display.
      - the left visible part begins at 360 (SHRES; HIRES:180, LORES:90),
	left_margin + 2 * hsync_len must be greater or equal.
      - the upper visible part begins at 48 (interlaced; non-interlaced:24,
        doublescanned:12), upper_margin+2*vsync_len must be greater or equal.
	doublescanned:12), upper_margin + 2 * vsync_len must be greater or
	equal.
      - ami_encode_var() calculates margins with a hsync of 5320 ns and a vsync
	of 4 scanlines

@@ -848,7 +849,8 @@ static struct fb_videomode ami_modedb[] __initdata = {
		0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP
	}, {
		/* 640x960, 29 kHz, 57 Hz interlaced */
	"multiscan-lace", 57, 640, 960, TAG_SHRES, 96, 112, 58, 16, 72, 16,
		"multiscan-lace", 57, 640, 960, TAG_SHRES, 96, 112, 58, 16, 72,
		16,
		0, FB_VMODE_INTERLACED | FB_VMODE_YWRAP
	}, {
		/* 640x200, 15 kHz, 72 Hz */
@@ -856,7 +858,8 @@ static struct fb_videomode ami_modedb[] __initdata = {
		0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP
	}, {
		/* 640x400, 15 kHz, 72 Hz interlaced */
	"euro36-lace", 72, 640, 400, TAG_HIRES, 92, 124, 12, 12, 52, 10,
		"euro36-lace", 72, 640, 400, TAG_HIRES, 92, 124, 12, 12, 52,
		10,
		0, FB_VMODE_INTERLACED | FB_VMODE_YWRAP
	}, {
		/* 640x400, 29 kHz, 68 Hz */
@@ -864,7 +867,8 @@ static struct fb_videomode ami_modedb[] __initdata = {
		0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP
	}, {
		/* 640x800, 29 kHz, 68 Hz interlaced */
	"euro72-lace", 68, 640, 800, TAG_SHRES, 164, 92, 18, 18, 80, 16,
		"euro72-lace", 68, 640, 800, TAG_SHRES, 164, 92, 18, 18, 80,
		16,
		0, FB_VMODE_INTERLACED | FB_VMODE_YWRAP
	}, {
		/* 800x300, 23 kHz, 70 Hz */
@@ -872,7 +876,8 @@ static struct fb_videomode ami_modedb[] __initdata = {
		0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP
	}, {
		/* 800x600, 23 kHz, 70 Hz interlaced */
	"super72-lace", 70, 800, 600, TAG_SHRES, 212, 140, 20, 22, 80, 14,
		"super72-lace", 70, 800, 600, TAG_SHRES, 212, 140, 20, 22, 80,
		14,
		0, FB_VMODE_INTERLACED | FB_VMODE_YWRAP
	}, {
		/* 640x200, 27 kHz, 57 Hz doublescan */
@@ -884,7 +889,8 @@ static struct fb_videomode ami_modedb[] __initdata = {
		0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP
	}, {
		/* 640x800, 27 kHz, 57 Hz interlaced */
	"dblntsc-lace", 57, 640, 800, TAG_SHRES, 196, 124, 72, 70, 80, 14,
		"dblntsc-lace", 57, 640, 800, TAG_SHRES, 196, 124, 72, 70, 80,
		14,
		0, FB_VMODE_INTERLACED | FB_VMODE_YWRAP
	}, {
		/* 640x256, 27 kHz, 47 Hz doublescan */
@@ -896,7 +902,8 @@ static struct fb_videomode ami_modedb[] __initdata = {
		0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP
	}, {
		/* 640x1024, 27 kHz, 47 Hz interlaced */
	"dblpal-lace", 47, 640, 1024, TAG_SHRES, 196, 124, 56, 54, 80, 14,
		"dblpal-lace", 47, 640, 1024, TAG_SHRES, 196, 124, 56, 54, 80,
		14,
		0, FB_VMODE_INTERLACED | FB_VMODE_YWRAP
	},

@@ -911,7 +918,8 @@ static struct fb_videomode ami_modedb[] __initdata = {
	}, {
		/* 640x400, 31 kHz, 70 Hz (VGA) */
		"vga70", 70, 640, 400, TAG_SHRES, 64, 96, 35, 12, 112, 2,
	FB_SYNC_VERT_HIGH_ACT | FB_SYNC_COMP_HIGH_ACT, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP
		FB_SYNC_VERT_HIGH_ACT | FB_SYNC_COMP_HIGH_ACT,
		FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP
	},

#if 0
@@ -993,7 +1001,8 @@ static int amifb_inverse = 0;

#define hscroll2hw(hscroll) \
	(((hscroll) << 12 & 0x3000) | ((hscroll) << 8 & 0xc300) | \
	 ((hscroll)<<4 & 0x0c00) | ((hscroll)<<2 & 0x00f0) | ((hscroll)>>2 & 0x000f))
	 ((hscroll) << 4 & 0x0c00) | ((hscroll) << 2 & 0x00f0) | \
	 ((hscroll)>>2 & 0x000f))

/* diwstrt/diwstop/diwhigh (visible display window) */

@@ -1044,8 +1053,9 @@ static int amifb_inverse = 0;
#define spr2hw_pos(start_v, start_h) \
	(((start_v) << 7 & 0xff00) | ((start_h)>>3 & 0x00ff))
#define spr2hw_ctl(start_v, start_h, stop_v) \
	(((stop_v)<<7&0xff00) | ((start_v)>>4&0x0040) | ((stop_v)>>5&0x0020) | \
	 ((start_h)<<3&0x0018) | ((start_v)>>7&0x0004) | ((stop_v)>>8&0x0002) | \
	(((stop_v) << 7 & 0xff00) | ((start_v)>>4 & 0x0040) | \
	 ((stop_v)>>5 & 0x0020) | ((start_h) << 3 & 0x0018) | \
	 ((start_v)>>7 & 0x0004) | ((stop_v)>>8 & 0x0002) | \
	 ((start_h)>>2 & 0x0001))

/* get current vertical position of beam */
@@ -1334,7 +1344,8 @@ static int amifb_pan_display(struct fb_var_screeninfo *var,
		 * TODO: There will be problems when xpan!=1, so some columns
		 * on the right side will never be seen
		 */
		if (var->xoffset+info->var.xres > upx(16<<maxfmode, info->var.xres_virtual) ||
		if (var->xoffset + info->var.xres >
		    upx(16 << maxfmode, info->var.xres_virtual) ||
		    var->yoffset + info->var.yres > info->var.yres_virtual)
			return -EINVAL;
	}
@@ -2102,7 +2113,8 @@ static inline void expand_one_line(int bpp, unsigned long next_plane,
		dst += dst_idx >> SHIFT_PER_LONG;
		dst_idx &= (BITS_PER_LONG - 1);
		if ((bgcolor ^ fgcolor) & 1) {
	    src = (unsigned long *)((unsigned long)data & ~(BYTES_PER_LONG-1));
			src = (unsigned long *)
				((unsigned long)data & ~(BYTES_PER_LONG - 1));
			src_idx = ((unsigned long)data & (BYTES_PER_LONG - 1)) * 8;
			if (fgcolor & 1)
				bitcpy(dst, dst_idx, src, src_idx, n);
@@ -2211,8 +2223,7 @@ static int amifb_ioctl(struct fb_info *info,
				    sizeof(crsr.state)) ? -EFAULT : 0;

	case FBIOPUT_CURSORSTATE:
			if (copy_from_user(&crsr.state, argp,
					   sizeof(crsr.state)))
		if (copy_from_user(&crsr.state, argp, sizeof(crsr.state)))
			return -EFAULT;
		return ami_set_cursorstate(&crsr.state);
	}
@@ -2275,8 +2286,7 @@ static int __init amifb_probe(struct platform_device *pdev)
		maxdepth[TAG_HIRES] = 4;
		maxdepth[TAG_LORES] = 6;
		maxfmode = TAG_FMODE_1;
			defmode = amiga_vblank == 50 ? DEFMODE_PAL
						     : DEFMODE_NTSC;
		defmode = amiga_vblank == 50 ? DEFMODE_PAL : DEFMODE_NTSC;
		fb_info.fix.smem_len = VIDEOMEMSIZE_OCS;
		break;
#endif /* CONFIG_FB_AMIGA_OCS */
@@ -2381,10 +2391,8 @@ static int __init amifb_probe(struct platform_device *pdev)
				 &fb_info.modelist);

	round_down_bpp = 0;
	chipptr = chipalloc(fb_info.fix.smem_len+
	                    SPRITEMEMSIZE+
	                    DUMMYSPRITEMEMSIZE+
	                    COPINITSIZE+
	chipptr = chipalloc(fb_info.fix.smem_len + SPRITEMEMSIZE +
			    DUMMYSPRITEMEMSIZE + COPINITSIZE +
			    4 * COPLISTSIZE);
	if (!chipptr) {
		err = -ENOMEM;
@@ -2632,22 +2640,27 @@ static int ami_decode_var(struct fb_var_screeninfo *var,

	xres_n = par->xres << clk_shift;
	yres_n = par->yres << line_shift;
	par->htotal = down8((var->left_margin+par->xres+var->right_margin+var->hsync_len)<<clk_shift);
	par->vtotal = down2(((var->upper_margin+par->yres+var->lower_margin+var->vsync_len)<<line_shift)+1);
	par->htotal = down8((var->left_margin + par->xres + var->right_margin +
			     var->hsync_len) << clk_shift);
	par->vtotal =
		down2(((var->upper_margin + par->yres + var->lower_margin +
			var->vsync_len) << line_shift) + 1);

	if (IS_AGA)
		par->bplcon3 = sprpixmode[clk_shift];
	else
		par->bplcon3 = 0;
	if (var->sync & FB_SYNC_BROADCAST) {
		par->diwstop_h = par->htotal-((var->right_margin-var->hsync_len)<<clk_shift);
		par->diwstop_h = par->htotal -
			((var->right_margin - var->hsync_len) << clk_shift);
		if (IS_AGA)
			par->diwstop_h += mod4(var->hsync_len);
		else
			par->diwstop_h = down4(par->diwstop_h);

		par->diwstrt_h = par->diwstop_h - xres_n;
		par->diwstop_v = par->vtotal-((var->lower_margin-var->vsync_len)<<line_shift);
		par->diwstop_v = par->vtotal -
			((var->lower_margin - var->vsync_len) << line_shift);
		par->diwstrt_v = par->diwstop_v - yres_n;
		if (par->diwstop_h >= par->htotal + 8) {
			DPRINTK("invalid diwstop_h\n");
@@ -2804,14 +2817,16 @@ static int ami_decode_var(struct fb_var_screeninfo *var,
	 * smallest window start value where smooth scrolling is possible
	 */

	fstrt = downx(fconst, par->diwstrt_h-fconst+(1<<clk_shift)-4) - fsize;
	fstrt = downx(fconst, par->diwstrt_h - fconst + (1 << clk_shift) - 4) -
		fsize;
	if (fstrt < min_fstrt)
		par->vmode &= ~FB_VMODE_SMOOTH_XPAN;

	maxfetchstop = down16(par->htotal - 80);

	fstrt = downx(fconst, par->diwstrt_h - 4) - 64 - fconst;
	fsize = upx(fconst, xres_n + modx(fconst, downx(1<<clk_shift, par->diwstrt_h-4)));
	fsize = upx(fconst, xres_n +
		    modx(fconst, downx(1 << clk_shift, par->diwstrt_h - 4)));
	if (fstrt + fsize > maxfetchstop)
		par->vmode &= ~FB_VMODE_SMOOTH_XPAN;

@@ -2896,10 +2911,12 @@ static int ami_decode_var(struct fb_var_screeninfo *var,
		par->xoffset = var->xoffset;
		par->yoffset = var->yoffset;
		if (par->vmode & FB_VMODE_YWRAP) {
			if (par->xoffset || par->yoffset < 0 || par->yoffset >= par->vyres)
			if (par->xoffset || par->yoffset < 0 ||
			    par->yoffset >= par->vyres)
				par->xoffset = par->yoffset = 0;
		} else {
			if (par->xoffset < 0 || par->xoffset > upx(16<<maxfmode, par->vxres-par->xres) ||
			if (par->xoffset < 0 ||
			    par->xoffset > upx(16 << maxfmode, par->vxres - par->xres) ||
			    par->yoffset < 0 || par->yoffset > par->vyres - par->yres)
				par->xoffset = par->yoffset = 0;
		}
@@ -3071,11 +3088,14 @@ static int ami_update_par(void)
		par->bpl1mod = par->bpl2mod;

	if (par->yoffset) {
		par->bplpt0 = fb_info.fix.smem_start + par->next_line*par->yoffset + move;
		par->bplpt0 = fb_info.fix.smem_start +
			      par->next_line * par->yoffset + move;
		if (par->vmode & FB_VMODE_YWRAP) {
			if (par->yoffset > par->vyres - par->yres) {
				par->bplpt0wrap = fb_info.fix.smem_start + move;
				if (par->bplcon0 & BPC0_LACE && mod2(par->diwstrt_v+par->vyres-par->yoffset))
				if (par->bplcon0 & BPC0_LACE &&
				    mod2(par->diwstrt_v + par->vyres -
					 par->yoffset))
					par->bplpt0wrap += par->next_line;
			}
		}
@@ -3131,9 +3151,12 @@ static int amifb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
			u_short bplcon3 = currentpar.bplcon3;
			VBlankOff();
			custom.bplcon3 = bplcon3 | (regno << 8 & 0xe000);
			custom.color[regno&31] = rgb2hw8_high(red, green, blue);
			custom.bplcon3 = bplcon3 | (regno<<8 & 0xe000) | BPC3_LOCT;
			custom.color[regno&31] = rgb2hw8_low(red, green, blue);
			custom.color[regno & 31] = rgb2hw8_high(red, green,
								blue);
			custom.bplcon3 = bplcon3 | (regno << 8 & 0xe000) |
					 BPC3_LOCT;
			custom.color[regno & 31] = rgb2hw8_low(red, green,
							       blue);
			custom.bplcon3 = bplcon3;
			VBlankOn();
		} else
@@ -3744,7 +3767,8 @@ static void ami_rebuild_copper(void)
					(copl++)->l = CWAIT(h_end2, line);
				p = par->bplpt0wrap;
			}
		} else p = par->bplpt0wrap;
		} else
			p = par->bplpt0wrap;
	}
	for (i = 0; i < (short)par->bpp; i++, p += par->next_plane) {
		(copl++)->l = CMOVE(highw(p), bplpt[i]);
@@ -3776,12 +3800,14 @@ static void ami_rebuild_copper(void)
					else
						(cops++)->l = CWAIT(h_end2, line);
					p = par->bplpt0wrap;
					if (mod2(par->diwstrt_v+par->vyres-par->yoffset))
					if (mod2(par->diwstrt_v + par->vyres -
					    par->yoffset))
						p -= par->next_line;
					else
						p += par->next_line;
				}
			} else p = par->bplpt0wrap - par->next_line;
			} else
				p = par->bplpt0wrap - par->next_line;
		}
		for (i = 0; i < (short)par->bpp; i++, p += par->next_plane) {
			(cops++)->l = CMOVE(highw(p), bplpt[i]);