Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 55943
b: refs/heads/master
c: 03b9ae4
h: refs/heads/master
i:
  55941: 5b1a343
  55939: 050e6c4
  55935: a0b3bc3
v: v3
  • Loading branch information
Antonino A. Daplas authored and Linus Torvalds committed May 11, 2007
1 parent a541b1e commit 63010f4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 647f2e7aeef833272c17a5366680321c3def3f23
refs/heads/master: 03b9ae4b80dd5b20d7bf7e15902592d50c66780d
38 changes: 21 additions & 17 deletions trunk/drivers/video/pm2fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,17 +204,6 @@ static inline void WAIT_FIFO(struct pm2fb_par* p, u32 a)
}
#endif

static void wait_pm2(struct pm2fb_par* par) {

WAIT_FIFO(par, 1);
pm2_WR(par, PM2R_SYNC, 0);
mb();
do {
while (pm2_RD(par, PM2R_OUT_FIFO_WORDS) == 0);
rmb();
} while (pm2_RD(par, PM2R_OUT_FIFO) != PM2TAG(PM2R_SYNC));
}

/*
* partial products for the supported horizontal resolutions.
*/
Expand Down Expand Up @@ -1050,13 +1039,30 @@ static int pm2fb_blank(int blank_mode, struct fb_info *info)
return 0;
}

static int pm2fb_sync(struct fb_info *info)
{
struct pm2fb_par *par = info->par;

WAIT_FIFO(par, 1);
pm2_WR(par, PM2R_SYNC, 0);
mb();
do {
while (pm2_RD(par, PM2R_OUT_FIFO_WORDS) == 0)
udelay(10);
rmb();
} while (pm2_RD(par, PM2R_OUT_FIFO) != PM2TAG(PM2R_SYNC));

return 0;
}

/*
* block operation. copy=0: rectangle fill, copy=1: rectangle copy.
*/
static void pm2fb_block_op(struct pm2fb_par* par, int copy,
static void pm2fb_block_op(struct fb_info* info, int copy,
s32 xsrc, s32 ysrc,
s32 x, s32 y, s32 w, s32 h,
u32 color) {
struct pm2fb_par *par = info->par;

if (!w || !h)
return;
Expand All @@ -1076,13 +1082,11 @@ static void pm2fb_block_op(struct pm2fb_par* par, int copy,
(x<xsrc ? PM2F_INCREASE_X : 0) |
(y<ysrc ? PM2F_INCREASE_Y : 0) |
(copy ? 0 : PM2F_RENDER_FASTFILL));
wait_pm2(par);
}

static void pm2fb_fillrect (struct fb_info *info,
const struct fb_fillrect *region)
{
struct pm2fb_par *par = info->par;
struct fb_fillrect modded;
int vxres, vyres;
u32 color = (info->fix.visual == FB_VISUAL_TRUECOLOR) ?
Expand Down Expand Up @@ -1116,7 +1120,7 @@ static void pm2fb_fillrect (struct fb_info *info,
color |= color << 16;

if(info->var.bits_per_pixel != 24)
pm2fb_block_op(par, 0, 0, 0,
pm2fb_block_op(info, 0, 0, 0,
modded.dx, modded.dy,
modded.width, modded.height, color);
else
Expand All @@ -1126,7 +1130,6 @@ static void pm2fb_fillrect (struct fb_info *info,
static void pm2fb_copyarea(struct fb_info *info,
const struct fb_copyarea *area)
{
struct pm2fb_par *par = info->par;
struct fb_copyarea modded;
u32 vxres, vyres;

Expand Down Expand Up @@ -1156,7 +1159,7 @@ static void pm2fb_copyarea(struct fb_info *info,
if(modded.dy + modded.height > vyres)
modded.height = vyres - modded.dy;

pm2fb_block_op(par, 1, modded.sx, modded.sy,
pm2fb_block_op(info, 1, modded.sx, modded.sy,
modded.dx, modded.dy,
modded.width, modded.height, 0);
}
Expand All @@ -1177,6 +1180,7 @@ static struct fb_ops pm2fb_ops = {
.fb_fillrect = pm2fb_fillrect,
.fb_copyarea = pm2fb_copyarea,
.fb_imageblit = cfb_imageblit,
.fb_sync = pm2fb_sync,
};

/*
Expand Down

0 comments on commit 63010f4

Please sign in to comment.