| .. | .. |
|---|
| 999 | 999 | case S9000_ID_HCRX: |
|---|
| 1000 | 1000 | HYPER_ENABLE_DISABLE_DISPLAY(fb, enable); |
|---|
| 1001 | 1001 | break; |
|---|
| 1002 | | - case S9000_ID_A1659A: /* fall through */ |
|---|
| 1002 | + case S9000_ID_A1659A: |
|---|
| 1003 | 1003 | case S9000_ID_TIMBER: |
|---|
| 1004 | 1004 | case CRX24_OVERLAY_PLANES: |
|---|
| 1005 | 1005 | default: |
|---|
| .. | .. |
|---|
| 1037 | 1037 | WRITE_WORD(((area->sx << 16) | area->sy), fb, REG_24); |
|---|
| 1038 | 1038 | WRITE_WORD(((area->width << 16) | area->height), fb, REG_7); |
|---|
| 1039 | 1039 | WRITE_WORD(((area->dx << 16) | area->dy), fb, REG_25); |
|---|
| 1040 | + |
|---|
| 1041 | + SETUP_FB(fb); |
|---|
| 1042 | +} |
|---|
| 1043 | + |
|---|
| 1044 | +#define ARTIST_VRAM_SIZE 0x000804 |
|---|
| 1045 | +#define ARTIST_VRAM_SRC 0x000808 |
|---|
| 1046 | +#define ARTIST_VRAM_SIZE_TRIGGER_WINFILL 0x000a04 |
|---|
| 1047 | +#define ARTIST_VRAM_DEST_TRIGGER_BLOCKMOVE 0x000b00 |
|---|
| 1048 | +#define ARTIST_SRC_BM_ACCESS 0x018008 |
|---|
| 1049 | +#define ARTIST_FGCOLOR 0x018010 |
|---|
| 1050 | +#define ARTIST_BGCOLOR 0x018014 |
|---|
| 1051 | +#define ARTIST_BITMAP_OP 0x01801c |
|---|
| 1052 | + |
|---|
| 1053 | +static void |
|---|
| 1054 | +stifb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) |
|---|
| 1055 | +{ |
|---|
| 1056 | + struct stifb_info *fb = container_of(info, struct stifb_info, info); |
|---|
| 1057 | + |
|---|
| 1058 | + if (rect->rop != ROP_COPY || |
|---|
| 1059 | + (fb->id == S9000_ID_HCRX && fb->info.var.bits_per_pixel == 32)) |
|---|
| 1060 | + return cfb_fillrect(info, rect); |
|---|
| 1061 | + |
|---|
| 1062 | + SETUP_HW(fb); |
|---|
| 1063 | + |
|---|
| 1064 | + if (fb->info.var.bits_per_pixel == 32) { |
|---|
| 1065 | + WRITE_WORD(0xBBA0A000, fb, REG_10); |
|---|
| 1066 | + |
|---|
| 1067 | + NGLE_REALLY_SET_IMAGE_PLANEMASK(fb, 0xffffffff); |
|---|
| 1068 | + } else { |
|---|
| 1069 | + WRITE_WORD(fb->id == S9000_ID_HCRX ? 0x13a02000 : 0x13a01000, fb, REG_10); |
|---|
| 1070 | + |
|---|
| 1071 | + NGLE_REALLY_SET_IMAGE_PLANEMASK(fb, 0xff); |
|---|
| 1072 | + } |
|---|
| 1073 | + |
|---|
| 1074 | + WRITE_WORD(0x03000300, fb, ARTIST_BITMAP_OP); |
|---|
| 1075 | + WRITE_WORD(0x2ea01000, fb, ARTIST_SRC_BM_ACCESS); |
|---|
| 1076 | + NGLE_QUICK_SET_DST_BM_ACCESS(fb, 0x2ea01000); |
|---|
| 1077 | + NGLE_REALLY_SET_IMAGE_FG_COLOR(fb, rect->color); |
|---|
| 1078 | + WRITE_WORD(0, fb, ARTIST_BGCOLOR); |
|---|
| 1079 | + |
|---|
| 1080 | + NGLE_SET_DSTXY(fb, (rect->dx << 16) | (rect->dy)); |
|---|
| 1081 | + SET_LENXY_START_RECFILL(fb, (rect->width << 16) | (rect->height)); |
|---|
| 1040 | 1082 | |
|---|
| 1041 | 1083 | SETUP_FB(fb); |
|---|
| 1042 | 1084 | } |
|---|
| .. | .. |
|---|
| 1101 | 1143 | |
|---|
| 1102 | 1144 | /* ------------ Interfaces to hardware functions ------------ */ |
|---|
| 1103 | 1145 | |
|---|
| 1104 | | -static struct fb_ops stifb_ops = { |
|---|
| 1146 | +static const struct fb_ops stifb_ops = { |
|---|
| 1105 | 1147 | .owner = THIS_MODULE, |
|---|
| 1106 | 1148 | .fb_setcolreg = stifb_setcolreg, |
|---|
| 1107 | 1149 | .fb_blank = stifb_blank, |
|---|
| 1108 | | - .fb_fillrect = cfb_fillrect, |
|---|
| 1150 | + .fb_fillrect = stifb_fillrect, |
|---|
| 1109 | 1151 | .fb_copyarea = stifb_copyarea, |
|---|
| 1110 | 1152 | .fb_imageblit = cfb_imageblit, |
|---|
| 1111 | 1153 | }; |
|---|
| .. | .. |
|---|
| 1157 | 1199 | dev_name); |
|---|
| 1158 | 1200 | goto out_err0; |
|---|
| 1159 | 1201 | } |
|---|
| 1160 | | - /* fall through */ |
|---|
| 1202 | + fallthrough; |
|---|
| 1161 | 1203 | case S9000_ID_ARTIST: |
|---|
| 1162 | 1204 | case S9000_ID_HCRX: |
|---|
| 1163 | 1205 | case S9000_ID_TIMBER: |
|---|
| .. | .. |
|---|
| 1198 | 1240 | case S9000_ID_TOMCAT: /* Dual CRX, behaves else like a CRX */ |
|---|
| 1199 | 1241 | /* FIXME: TomCat supports two heads: |
|---|
| 1200 | 1242 | * fb.iobase = REGION_BASE(fb_info,3); |
|---|
| 1201 | | - * fb.screen_base = ioremap_nocache(REGION_BASE(fb_info,2),xxx); |
|---|
| 1243 | + * fb.screen_base = ioremap(REGION_BASE(fb_info,2),xxx); |
|---|
| 1202 | 1244 | * for now we only support the left one ! */ |
|---|
| 1203 | 1245 | xres = fb->ngle_rom.x_size_visible; |
|---|
| 1204 | 1246 | yres = fb->ngle_rom.y_size_visible; |
|---|
| .. | .. |
|---|
| 1257 | 1299 | |
|---|
| 1258 | 1300 | /* limit fbsize to max visible screen size */ |
|---|
| 1259 | 1301 | if (fix->smem_len > yres*fix->line_length) |
|---|
| 1260 | | - fix->smem_len = yres*fix->line_length; |
|---|
| 1302 | + fix->smem_len = ALIGN(yres*fix->line_length, 4*1024*1024); |
|---|
| 1261 | 1303 | |
|---|
| 1262 | 1304 | fix->accel = FB_ACCEL_NONE; |
|---|
| 1263 | 1305 | |
|---|
| .. | .. |
|---|
| 1291 | 1333 | |
|---|
| 1292 | 1334 | strcpy(fix->id, "stifb"); |
|---|
| 1293 | 1335 | info->fbops = &stifb_ops; |
|---|
| 1294 | | - info->screen_base = ioremap_nocache(REGION_BASE(fb,1), fix->smem_len); |
|---|
| 1336 | + info->screen_base = ioremap(REGION_BASE(fb,1), fix->smem_len); |
|---|
| 1295 | 1337 | if (!info->screen_base) { |
|---|
| 1296 | 1338 | printk(KERN_ERR "stifb: failed to map memory\n"); |
|---|
| 1297 | 1339 | goto out_err0; |
|---|
| 1298 | 1340 | } |
|---|
| 1299 | 1341 | info->screen_size = fix->smem_len; |
|---|
| 1300 | | - info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_COPYAREA; |
|---|
| 1342 | + info->flags = FBINFO_HWACCEL_COPYAREA | FBINFO_HWACCEL_FILLRECT; |
|---|
| 1301 | 1343 | info->pseudo_palette = &fb->pseudo_palette; |
|---|
| 1302 | 1344 | |
|---|
| 1303 | 1345 | /* This has to be done !!! */ |
|---|
| .. | .. |
|---|
| 1317 | 1359 | goto out_err3; |
|---|
| 1318 | 1360 | } |
|---|
| 1319 | 1361 | |
|---|
| 1362 | + /* save for primary gfx device detection & unregister_framebuffer() */ |
|---|
| 1363 | + sti->info = info; |
|---|
| 1320 | 1364 | if (register_framebuffer(&fb->info) < 0) |
|---|
| 1321 | 1365 | goto out_err4; |
|---|
| 1322 | | - |
|---|
| 1323 | | - sti->info = info; /* save for unregister_framebuffer() */ |
|---|
| 1324 | 1366 | |
|---|
| 1325 | 1367 | fb_info(&fb->info, "%s %dx%d-%d frame buffer device, %s, id: %04x, mmio: 0x%04lx\n", |
|---|
| 1326 | 1368 | fix->id, |
|---|