.. | .. |
---|
922 | 922 | /* ------------------- driver specific functions --------------------------- */ |
---|
923 | 923 | |
---|
924 | 924 | static int |
---|
| 925 | +stifb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) |
---|
| 926 | +{ |
---|
| 927 | + struct stifb_info *fb = container_of(info, struct stifb_info, info); |
---|
| 928 | + |
---|
| 929 | + if (var->xres != fb->info.var.xres || |
---|
| 930 | + var->yres != fb->info.var.yres || |
---|
| 931 | + var->bits_per_pixel != fb->info.var.bits_per_pixel) |
---|
| 932 | + return -EINVAL; |
---|
| 933 | + |
---|
| 934 | + var->xres_virtual = var->xres; |
---|
| 935 | + var->yres_virtual = var->yres; |
---|
| 936 | + var->xoffset = 0; |
---|
| 937 | + var->yoffset = 0; |
---|
| 938 | + var->grayscale = fb->info.var.grayscale; |
---|
| 939 | + var->red.length = fb->info.var.red.length; |
---|
| 940 | + var->green.length = fb->info.var.green.length; |
---|
| 941 | + var->blue.length = fb->info.var.blue.length; |
---|
| 942 | + |
---|
| 943 | + return 0; |
---|
| 944 | +} |
---|
| 945 | + |
---|
| 946 | +static int |
---|
925 | 947 | stifb_setcolreg(u_int regno, u_int red, u_int green, |
---|
926 | 948 | u_int blue, u_int transp, struct fb_info *info) |
---|
927 | 949 | { |
---|
.. | .. |
---|
1145 | 1167 | |
---|
1146 | 1168 | static const struct fb_ops stifb_ops = { |
---|
1147 | 1169 | .owner = THIS_MODULE, |
---|
| 1170 | + .fb_check_var = stifb_check_var, |
---|
1148 | 1171 | .fb_setcolreg = stifb_setcolreg, |
---|
1149 | 1172 | .fb_blank = stifb_blank, |
---|
1150 | 1173 | .fb_fillrect = stifb_fillrect, |
---|
.. | .. |
---|
1164 | 1187 | struct stifb_info *fb; |
---|
1165 | 1188 | struct fb_info *info; |
---|
1166 | 1189 | unsigned long sti_rom_address; |
---|
| 1190 | + char modestr[32]; |
---|
1167 | 1191 | char *dev_name; |
---|
1168 | 1192 | int bpp, xres, yres; |
---|
1169 | 1193 | |
---|
.. | .. |
---|
1342 | 1366 | info->flags = FBINFO_HWACCEL_COPYAREA | FBINFO_HWACCEL_FILLRECT; |
---|
1343 | 1367 | info->pseudo_palette = &fb->pseudo_palette; |
---|
1344 | 1368 | |
---|
| 1369 | + scnprintf(modestr, sizeof(modestr), "%dx%d-%d", xres, yres, bpp); |
---|
| 1370 | + fb_find_mode(&info->var, info, modestr, NULL, 0, NULL, bpp); |
---|
| 1371 | + |
---|
1345 | 1372 | /* This has to be done !!! */ |
---|
1346 | 1373 | if (fb_alloc_cmap(&info->cmap, NR_PALETTE, 0)) |
---|
1347 | 1374 | goto out_err1; |
---|
.. | .. |
---|
1386 | 1413 | iounmap(info->screen_base); |
---|
1387 | 1414 | out_err0: |
---|
1388 | 1415 | kfree(fb); |
---|
| 1416 | + sti->info = NULL; |
---|
1389 | 1417 | return -ENXIO; |
---|
1390 | 1418 | } |
---|
1391 | 1419 | |
---|