intelfb: fixup whitespace..

repeat after me, I must not take code from X without reformatting...

Signed-off-by: Dave Airlie <airlied@linux.ie>
This commit is contained in:
Dave Airlie 2006-03-23 19:23:48 +11:00
parent 8bb91f6a2d
commit 8b91b0b4f2
2 changed files with 35 additions and 41 deletions

View File

@ -1467,7 +1467,7 @@ static int
intelfb_cursor(struct fb_info *info, struct fb_cursor *cursor) intelfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
{ {
struct intelfb_info *dinfo = GET_DINFO(info); struct intelfb_info *dinfo = GET_DINFO(info);
int ret; u32 physical;
#if VERBOSE > 0 #if VERBOSE > 0
DBG_MSG("intelfb_cursor\n"); DBG_MSG("intelfb_cursor\n");
#endif #endif
@ -1478,12 +1478,10 @@ intelfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
intelfbhw_cursor_hide(dinfo); intelfbhw_cursor_hide(dinfo);
/* If XFree killed the cursor - restore it */ /* If XFree killed the cursor - restore it */
if (dinfo->mobile || IS_I9xx(dinfo)) physical = (dinfo->mobile || IS_I9xx(dinfo)) ? dinfo->cursor.physical :
ret = (INREG(CURSOR_A_BASEADDR) != dinfo->cursor.physical); (dinfo->cursor.offset << 12);
else
ret = (INREG(CURSOR_A_BASEADDR) != dinfo->cursor.offset << 12);
if (ret) { if (INREG(CURSOR_A_BASEADDR) != physical) {
u32 fg, bg; u32 fg, bg;
DBG_MSG("the cursor was killed - restore it !!\n"); DBG_MSG("the cursor was killed - restore it !!\n");

View File

@ -759,18 +759,15 @@ splitm(int index, unsigned int m, unsigned int *retm1, unsigned int *retm2)
int m1, m2; int m1, m2;
int testm; int testm;
/* no point optimising too much - brute force m */ /* no point optimising too much - brute force m */
for (m1 = plls[index].min_m1; m1 < plls[index].max_m1+1; m1++) for (m1 = plls[index].min_m1; m1 < plls[index].max_m1+1; m1++) {
{ for (m2 = plls[index].min_m2; m2 < plls[index].max_m2+1; m2++) {
for (m2 = plls[index].min_m2; m2 < plls[index].max_m2+1; m2++) testm = ( 5 * ( m1 + 2 )) + (m2 + 2);
{ if (testm == m) {
testm = ( 5 * ( m1 + 2 )) + (m2 + 2); *retm1 = (unsigned int)m1;
if (testm == m) *retm2 = (unsigned int)m2;
{ return 0;
*retm1 = (unsigned int)m1; }
*retm2 = (unsigned int)m2; }
return 0;
}
}
} }
return 1; return 1;
} }
@ -781,8 +778,7 @@ splitp(int index, unsigned int p, unsigned int *retp1, unsigned int *retp2)
{ {
int p1, p2; int p1, p2;
if (index == PLLS_I9xx) if (index == PLLS_I9xx) {
{
switch (p) { switch (p) {
case 10: case 10:
p1 = 2; p1 = 2;
@ -803,8 +799,7 @@ splitp(int index, unsigned int p, unsigned int *retp1, unsigned int *retp2)
return 0; return 0;
} }
if (index == PLLS_I8xx) if (index == PLLS_I8xx) {
{
if (p % 4 == 0) if (p % 4 == 0)
p2 = 1; p2 = 1;
else else
@ -814,7 +809,9 @@ splitp(int index, unsigned int p, unsigned int *retp1, unsigned int *retp2)
p2 = 0; p2 = 0;
p1 = (p / (1 << (p2 + 1))) - 2; p1 = (p / (1 << (p2 + 1))) - 2;
} }
if (p1 < plls[index].min_p1 || p1 > plls[index].max_p1 || (p1 + 2) * (1 << (p2 + 1)) != p) { if (p1 < plls[index].min_p1 ||
p1 > plls[index].max_p1 ||
(p1 + 2) * (1 << (p2 + 1)) != p) {
return 1; return 1;
} else { } else {
*retp1 = (unsigned int)p1; *retp1 = (unsigned int)p1;
@ -858,14 +855,13 @@ calc_pll_params(int index, int clock, u32 *retm1, u32 *retm2, u32 *retn, u32 *re
if (p_max > plls[index].max_p) if (p_max > plls[index].max_p)
p_max = plls[index].max_p; p_max = plls[index].max_p;
if (clock < PLL_REFCLK && index==PLLS_I9xx) if (clock < PLL_REFCLK && index == PLLS_I9xx) {
{ p_min = 10;
p_min = 10; p_max = 20;
p_max = 20; /* this makes 640x480 work it really shouldn't
/* this makes 640x480 work it really shouldn't - SOMEONE WITHOUT DOCS WOZ HERE */
- SOMEONE WITHOUT DOCS WOZ HERE */ if (clock < 30000)
if (clock < 30000) clock *= 4;
clock *= 4;
} }
DBG_MSG("p range is %d-%d (%d)\n", p_min, p_max, p_inc); DBG_MSG("p range is %d-%d (%d)\n", p_min, p_max, p_inc);
@ -1030,7 +1026,8 @@ intelfbhw_mode_to_hw(struct intelfb_info *dinfo, struct intelfb_hwstate *hw,
/* Desired clock in kHz */ /* Desired clock in kHz */
clock_target = 1000000000 / var->pixclock; clock_target = 1000000000 / var->pixclock;
if (calc_pll_params(dinfo->pll_index, clock_target, &m1, &m2, &n, &p1, &p2, &clock)) { if (calc_pll_params(dinfo->pll_index, clock_target, &m1, &m2,
&n, &p1, &p2, &clock)) {
WRN_MSG("calc_pll_params failed\n"); WRN_MSG("calc_pll_params failed\n");
return 1; return 1;
} }
@ -1263,14 +1260,13 @@ intelfbhw_program_mode(struct intelfb_info *dinfo,
OUTREG(pipe_conf_reg, tmp); OUTREG(pipe_conf_reg, tmp);
count = 0; count = 0;
do{ do {
tmp_val[count%3] = INREG(0x70000); tmp_val[count%3] = INREG(0x70000);
if ((tmp_val[0] == tmp_val[1]) && (tmp_val[1]==tmp_val[2])) if ((tmp_val[0] == tmp_val[1]) && (tmp_val[1]==tmp_val[2]))
break; break;
count++; count++;
udelay(1); udelay(1);
if (count % 200 == 0) if (count % 200 == 0) {
{
tmp = INREG(pipe_conf_reg); tmp = INREG(pipe_conf_reg);
tmp &= ~PIPECONF_ENABLE; tmp &= ~PIPECONF_ENABLE;
OUTREG(pipe_conf_reg, tmp); OUTREG(pipe_conf_reg, tmp);