| .. | .. |
|---|
| 108 | 108 | static int g364fb_setcolreg(u_int regno, u_int red, u_int green, |
|---|
| 109 | 109 | u_int blue, u_int transp, |
|---|
| 110 | 110 | struct fb_info *info); |
|---|
| 111 | | -static int g364fb_cursor(struct fb_info *info, struct fb_cursor *cursor); |
|---|
| 112 | 111 | static int g364fb_blank(int blank, struct fb_info *info); |
|---|
| 113 | 112 | |
|---|
| 114 | | -static struct fb_ops g364fb_ops = { |
|---|
| 113 | +static const struct fb_ops g364fb_ops = { |
|---|
| 115 | 114 | .owner = THIS_MODULE, |
|---|
| 116 | 115 | .fb_setcolreg = g364fb_setcolreg, |
|---|
| 117 | 116 | .fb_pan_display = g364fb_pan_display, |
|---|
| .. | .. |
|---|
| 119 | 118 | .fb_fillrect = cfb_fillrect, |
|---|
| 120 | 119 | .fb_copyarea = cfb_copyarea, |
|---|
| 121 | 120 | .fb_imageblit = cfb_imageblit, |
|---|
| 122 | | - .fb_cursor = g364fb_cursor, |
|---|
| 123 | 121 | }; |
|---|
| 124 | | - |
|---|
| 125 | | -int g364fb_cursor(struct fb_info *info, struct fb_cursor *cursor) |
|---|
| 126 | | -{ |
|---|
| 127 | | - |
|---|
| 128 | | - switch (cursor->enable) { |
|---|
| 129 | | - case CM_ERASE: |
|---|
| 130 | | - *(unsigned int *) CTLA_REG |= CURS_TOGGLE; |
|---|
| 131 | | - break; |
|---|
| 132 | | - |
|---|
| 133 | | - case CM_MOVE: |
|---|
| 134 | | - case CM_DRAW: |
|---|
| 135 | | - *(unsigned int *) CTLA_REG &= ~CURS_TOGGLE; |
|---|
| 136 | | - *(unsigned int *) CURS_POS_REG = |
|---|
| 137 | | - ((x * fontwidth(p)) << 12) | ((y * fontheight(p)) - |
|---|
| 138 | | - info->var.yoffset); |
|---|
| 139 | | - break; |
|---|
| 140 | | - } |
|---|
| 141 | | - return 0; |
|---|
| 142 | | -} |
|---|
| 143 | 122 | |
|---|
| 144 | 123 | /* |
|---|
| 145 | 124 | * Pan or Wrap the Display |
|---|
| .. | .. |
|---|
| 194 | 173 | */ |
|---|
| 195 | 174 | int __init g364fb_init(void) |
|---|
| 196 | 175 | { |
|---|
| 197 | | - volatile unsigned int *pal_ptr = |
|---|
| 198 | | - (volatile unsigned int *) CLR_PAL_REG; |
|---|
| 199 | 176 | volatile unsigned int *curs_pal_ptr = |
|---|
| 200 | 177 | (volatile unsigned int *) CURS_PAL_REG; |
|---|
| 201 | | - int mem, i, j; |
|---|
| 178 | + int mem, i; |
|---|
| 202 | 179 | |
|---|
| 203 | 180 | if (fb_get_options("g364fb", NULL)) |
|---|
| 204 | 181 | return -ENODEV; |
|---|
| .. | .. |
|---|
| 230 | 207 | */ |
|---|
| 231 | 208 | *(unsigned short *) (CURS_PAT_REG + 14 * 64) = 0xffff; |
|---|
| 232 | 209 | *(unsigned short *) (CURS_PAT_REG + 15 * 64) = 0xffff; |
|---|
| 233 | | - fb_var.xres_virtual = fbvar.xres; |
|---|
| 234 | | - fb_fix.line_length = (xres / 8) * fb_var.bits_per_pixel; |
|---|
| 210 | + fb_var.xres_virtual = fb_var.xres; |
|---|
| 211 | + fb_fix.line_length = fb_var.xres_virtual * fb_var.bits_per_pixel / 8; |
|---|
| 235 | 212 | fb_fix.smem_start = 0x40000000; /* physical address */ |
|---|
| 236 | 213 | /* get size of video memory; this is special for the JAZZ hardware */ |
|---|
| 237 | 214 | mem = (r4030_read_reg32(JAZZ_R4030_CONFIG) >> 8) & 3; |
|---|