diff options
author | Krzysztof Halasa <khc@pm.waw.pl> | 2007-10-16 04:29:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:43:19 -0400 |
commit | 689c9568f54747c13f287ae53956281e7cd810fa (patch) | |
tree | 1ab59495fc6e5203e7814cb927fd7ddd079d5c81 /drivers/video/intelfb/intelfbdrv.c | |
parent | 53ee1b5bbf937be29862ae8b3ea13af444af1f36 (diff) |
Intel FB: whitespace, bracket and other clean-ups
Intel FB: whitespace, bracket and other clean-ups
Signed-off-by: Krzysztof Halasa <khc@pm.waw.pl>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: <sylvain.meyer@worldonline.fr>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/intelfb/intelfbdrv.c')
-rw-r--r-- | drivers/video/intelfb/intelfbdrv.c | 178 |
1 files changed, 73 insertions, 105 deletions
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c index b75eda84858f..0428f211f192 100644 --- a/drivers/video/intelfb/intelfbdrv.c +++ b/drivers/video/intelfb/intelfbdrv.c | |||
@@ -99,13 +99,6 @@ | |||
99 | * Add vram option to reserve more memory than stolen by BIOS | 99 | * Add vram option to reserve more memory than stolen by BIOS |
100 | * Fix intelfbhw_pan_display typo | 100 | * Fix intelfbhw_pan_display typo |
101 | * Add __initdata annotations | 101 | * Add __initdata annotations |
102 | * | ||
103 | * TODO: | ||
104 | * | ||
105 | * | ||
106 | * Wish List: | ||
107 | * | ||
108 | * | ||
109 | */ | 102 | */ |
110 | 103 | ||
111 | #include <linux/module.h> | 104 | #include <linux/module.h> |
@@ -222,8 +215,8 @@ static struct pci_driver intelfb_driver = { | |||
222 | /* Module description/parameters */ | 215 | /* Module description/parameters */ |
223 | MODULE_AUTHOR("David Dawes <dawes@tungstengraphics.com>, " | 216 | MODULE_AUTHOR("David Dawes <dawes@tungstengraphics.com>, " |
224 | "Sylvain Meyer <sylvain.meyer@worldonline.fr>"); | 217 | "Sylvain Meyer <sylvain.meyer@worldonline.fr>"); |
225 | MODULE_DESCRIPTION( | 218 | MODULE_DESCRIPTION("Framebuffer driver for Intel(R) " SUPPORTED_CHIPSETS |
226 | "Framebuffer driver for Intel(R) " SUPPORTED_CHIPSETS " chipsets"); | 219 | " chipsets"); |
227 | MODULE_LICENSE("Dual BSD/GPL"); | 220 | MODULE_LICENSE("Dual BSD/GPL"); |
228 | MODULE_DEVICE_TABLE(pci, intelfb_pci_table); | 221 | MODULE_DEVICE_TABLE(pci, intelfb_pci_table); |
229 | 222 | ||
@@ -271,8 +264,7 @@ MODULE_PARM_DESC(mode, | |||
271 | #define OPT_INTVAL(opt, name) simple_strtoul(opt + strlen(name) + 1, NULL, 0) | 264 | #define OPT_INTVAL(opt, name) simple_strtoul(opt + strlen(name) + 1, NULL, 0) |
272 | #define OPT_STRVAL(opt, name) (opt + strlen(name)) | 265 | #define OPT_STRVAL(opt, name) (opt + strlen(name)) |
273 | 266 | ||
274 | static __inline__ char * | 267 | static __inline__ char * get_opt_string(const char *this_opt, const char *name) |
275 | get_opt_string(const char *this_opt, const char *name) | ||
276 | { | 268 | { |
277 | const char *p; | 269 | const char *p; |
278 | int i; | 270 | int i; |
@@ -290,8 +282,8 @@ get_opt_string(const char *this_opt, const char *name) | |||
290 | return ret; | 282 | return ret; |
291 | } | 283 | } |
292 | 284 | ||
293 | static __inline__ int | 285 | static __inline__ int get_opt_int(const char *this_opt, const char *name, |
294 | get_opt_int(const char *this_opt, const char *name, int *ret) | 286 | int *ret) |
295 | { | 287 | { |
296 | if (!ret) | 288 | if (!ret) |
297 | return 0; | 289 | return 0; |
@@ -303,8 +295,8 @@ get_opt_int(const char *this_opt, const char *name, int *ret) | |||
303 | return 1; | 295 | return 1; |
304 | } | 296 | } |
305 | 297 | ||
306 | static __inline__ int | 298 | static __inline__ int get_opt_bool(const char *this_opt, const char *name, |
307 | get_opt_bool(const char *this_opt, const char *name, int *ret) | 299 | int *ret) |
308 | { | 300 | { |
309 | if (!ret) | 301 | if (!ret) |
310 | return 0; | 302 | return 0; |
@@ -324,8 +316,7 @@ get_opt_bool(const char *this_opt, const char *name, int *ret) | |||
324 | return 1; | 316 | return 1; |
325 | } | 317 | } |
326 | 318 | ||
327 | static int __init | 319 | static int __init intelfb_setup(char *options) |
328 | intelfb_setup(char *options) | ||
329 | { | 320 | { |
330 | char *this_opt; | 321 | char *this_opt; |
331 | 322 | ||
@@ -355,7 +346,7 @@ intelfb_setup(char *options) | |||
355 | continue; | 346 | continue; |
356 | if (get_opt_bool(this_opt, "accel", &accel)) | 347 | if (get_opt_bool(this_opt, "accel", &accel)) |
357 | ; | 348 | ; |
358 | else if (get_opt_int(this_opt, "vram", &vram)) | 349 | else if (get_opt_int(this_opt, "vram", &vram)) |
359 | ; | 350 | ; |
360 | else if (get_opt_bool(this_opt, "hwcursor", &hwcursor)) | 351 | else if (get_opt_bool(this_opt, "hwcursor", &hwcursor)) |
361 | ; | 352 | ; |
@@ -376,8 +367,7 @@ intelfb_setup(char *options) | |||
376 | 367 | ||
377 | #endif | 368 | #endif |
378 | 369 | ||
379 | static int __init | 370 | static int __init intelfb_init(void) |
380 | intelfb_init(void) | ||
381 | { | 371 | { |
382 | #ifndef MODULE | 372 | #ifndef MODULE |
383 | char *option = NULL; | 373 | char *option = NULL; |
@@ -401,8 +391,7 @@ intelfb_init(void) | |||
401 | return pci_register_driver(&intelfb_driver); | 391 | return pci_register_driver(&intelfb_driver); |
402 | } | 392 | } |
403 | 393 | ||
404 | static void __exit | 394 | static void __exit intelfb_exit(void) |
405 | intelfb_exit(void) | ||
406 | { | 395 | { |
407 | DBG_MSG("intelfb_exit\n"); | 396 | DBG_MSG("intelfb_exit\n"); |
408 | pci_unregister_driver(&intelfb_driver); | 397 | pci_unregister_driver(&intelfb_driver); |
@@ -428,8 +417,8 @@ static inline void __devinit set_mtrr(struct intelfb_info *dinfo) | |||
428 | } | 417 | } |
429 | static inline void unset_mtrr(struct intelfb_info *dinfo) | 418 | static inline void unset_mtrr(struct intelfb_info *dinfo) |
430 | { | 419 | { |
431 | if (dinfo->has_mtrr) | 420 | if (dinfo->has_mtrr) |
432 | mtrr_del(dinfo->mtrr_reg, dinfo->aperture.physical, | 421 | mtrr_del(dinfo->mtrr_reg, dinfo->aperture.physical, |
433 | dinfo->aperture.size); | 422 | dinfo->aperture.size); |
434 | } | 423 | } |
435 | #else | 424 | #else |
@@ -442,8 +431,7 @@ static inline void unset_mtrr(struct intelfb_info *dinfo) | |||
442 | * driver init / cleanup * | 431 | * driver init / cleanup * |
443 | ***************************************************************/ | 432 | ***************************************************************/ |
444 | 433 | ||
445 | static void | 434 | static void cleanup(struct intelfb_info *dinfo) |
446 | cleanup(struct intelfb_info *dinfo) | ||
447 | { | 435 | { |
448 | DBG_MSG("cleanup\n"); | 436 | DBG_MSG("cleanup\n"); |
449 | 437 | ||
@@ -499,8 +487,8 @@ cleanup(struct intelfb_info *dinfo) | |||
499 | } while (0) | 487 | } while (0) |
500 | 488 | ||
501 | 489 | ||
502 | static int __devinit | 490 | static int __devinit intelfb_pci_register(struct pci_dev *pdev, |
503 | intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | 491 | const struct pci_device_id *ent) |
504 | { | 492 | { |
505 | struct fb_info *info; | 493 | struct fb_info *info; |
506 | struct intelfb_info *dinfo; | 494 | struct intelfb_info *dinfo; |
@@ -510,8 +498,8 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
510 | int agp_memtype; | 498 | int agp_memtype; |
511 | const char *s; | 499 | const char *s; |
512 | struct agp_bridge_data *bridge; | 500 | struct agp_bridge_data *bridge; |
513 | int aperture_bar = 0; | 501 | int aperture_bar = 0; |
514 | int mmio_bar = 1; | 502 | int mmio_bar = 1; |
515 | int offset; | 503 | int offset; |
516 | 504 | ||
517 | DBG_MSG("intelfb_pci_register\n"); | 505 | DBG_MSG("intelfb_pci_register\n"); |
@@ -637,9 +625,8 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
637 | dinfo->ring.size = RINGBUFFER_SIZE; | 625 | dinfo->ring.size = RINGBUFFER_SIZE; |
638 | dinfo->ring_tail_mask = dinfo->ring.size - 1; | 626 | dinfo->ring_tail_mask = dinfo->ring.size - 1; |
639 | } | 627 | } |
640 | if (dinfo->hwcursor) { | 628 | if (dinfo->hwcursor) |
641 | dinfo->cursor.size = HW_CURSOR_SIZE; | 629 | dinfo->cursor.size = HW_CURSOR_SIZE; |
642 | } | ||
643 | 630 | ||
644 | /* Use agpgart to manage the GATT */ | 631 | /* Use agpgart to manage the GATT */ |
645 | if (!(bridge = agp_backend_acquire(pdev))) { | 632 | if (!(bridge = agp_backend_acquire(pdev))) { |
@@ -662,18 +649,15 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
662 | offset = ROUND_UP_TO_PAGE(MB(voffset))/GTT_PAGE_SIZE; | 649 | offset = ROUND_UP_TO_PAGE(MB(voffset))/GTT_PAGE_SIZE; |
663 | 650 | ||
664 | /* set the mem offsets - set them after the already used pages */ | 651 | /* set the mem offsets - set them after the already used pages */ |
665 | if (dinfo->accel) { | 652 | if (dinfo->accel) |
666 | dinfo->ring.offset = offset + gtt_info.current_memory; | 653 | dinfo->ring.offset = offset + gtt_info.current_memory; |
667 | } | 654 | if (dinfo->hwcursor) |
668 | if (dinfo->hwcursor) { | ||
669 | dinfo->cursor.offset = offset + | 655 | dinfo->cursor.offset = offset + |
670 | + gtt_info.current_memory + (dinfo->ring.size >> 12); | 656 | + gtt_info.current_memory + (dinfo->ring.size >> 12); |
671 | } | 657 | if (dinfo->fbmem_gart) |
672 | if (dinfo->fbmem_gart) { | ||
673 | dinfo->fb.offset = offset + | 658 | dinfo->fb.offset = offset + |
674 | + gtt_info.current_memory + (dinfo->ring.size >> 12) | 659 | + gtt_info.current_memory + (dinfo->ring.size >> 12) |
675 | + (dinfo->cursor.size >> 12); | 660 | + (dinfo->cursor.size >> 12); |
676 | } | ||
677 | 661 | ||
678 | /* Allocate memories (which aren't stolen) */ | 662 | /* Allocate memories (which aren't stolen) */ |
679 | /* Map the fb and MMIO regions */ | 663 | /* Map the fb and MMIO regions */ |
@@ -689,7 +673,7 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
689 | 673 | ||
690 | dinfo->mmio_base = | 674 | dinfo->mmio_base = |
691 | (u8 __iomem *)ioremap_nocache(dinfo->mmio_base_phys, | 675 | (u8 __iomem *)ioremap_nocache(dinfo->mmio_base_phys, |
692 | INTEL_REG_SIZE); | 676 | INTEL_REG_SIZE); |
693 | if (!dinfo->mmio_base) { | 677 | if (!dinfo->mmio_base) { |
694 | ERR_MSG("Cannot remap MMIO region.\n"); | 678 | ERR_MSG("Cannot remap MMIO region.\n"); |
695 | cleanup(dinfo); | 679 | cleanup(dinfo); |
@@ -837,10 +821,8 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
837 | if (bailearly == 3) | 821 | if (bailearly == 3) |
838 | bailout(dinfo); | 822 | bailout(dinfo); |
839 | 823 | ||
840 | if (FIXED_MODE(dinfo)) { | 824 | if (FIXED_MODE(dinfo)) /* remap fb address */ |
841 | /* remap fb address */ | ||
842 | update_dinfo(dinfo, &dinfo->initial_var); | 825 | update_dinfo(dinfo, &dinfo->initial_var); |
843 | } | ||
844 | 826 | ||
845 | if (bailearly == 4) | 827 | if (bailearly == 4) |
846 | bailout(dinfo); | 828 | bailout(dinfo); |
@@ -939,8 +921,7 @@ intelfb_pci_unregister(struct pci_dev *pdev) | |||
939 | * helper functions * | 921 | * helper functions * |
940 | ***************************************************************/ | 922 | ***************************************************************/ |
941 | 923 | ||
942 | int __inline__ | 924 | int __inline__ intelfb_var_to_depth(const struct fb_var_screeninfo *var) |
943 | intelfb_var_to_depth(const struct fb_var_screeninfo *var) | ||
944 | { | 925 | { |
945 | DBG_MSG("intelfb_var_to_depth: bpp: %d, green.length is %d\n", | 926 | DBG_MSG("intelfb_var_to_depth: bpp: %d, green.length is %d\n", |
946 | var->bits_per_pixel, var->green.length); | 927 | var->bits_per_pixel, var->green.length); |
@@ -956,8 +937,7 @@ intelfb_var_to_depth(const struct fb_var_screeninfo *var) | |||
956 | } | 937 | } |
957 | 938 | ||
958 | 939 | ||
959 | static __inline__ int | 940 | static __inline__ int var_to_refresh(const struct fb_var_screeninfo *var) |
960 | var_to_refresh(const struct fb_var_screeninfo *var) | ||
961 | { | 941 | { |
962 | int xtot = var->xres + var->left_margin + var->right_margin + | 942 | int xtot = var->xres + var->left_margin + var->right_margin + |
963 | var->hsync_len; | 943 | var->hsync_len; |
@@ -971,8 +951,7 @@ var_to_refresh(const struct fb_var_screeninfo *var) | |||
971 | * Various intialisation functions * | 951 | * Various intialisation functions * |
972 | ***************************************************************/ | 952 | ***************************************************************/ |
973 | 953 | ||
974 | static void __devinit | 954 | static void __devinit get_initial_mode(struct intelfb_info *dinfo) |
975 | get_initial_mode(struct intelfb_info *dinfo) | ||
976 | { | 955 | { |
977 | struct fb_var_screeninfo *var; | 956 | struct fb_var_screeninfo *var; |
978 | int xtot, ytot; | 957 | int xtot, ytot; |
@@ -1039,8 +1018,7 @@ get_initial_mode(struct intelfb_info *dinfo) | |||
1039 | } | 1018 | } |
1040 | } | 1019 | } |
1041 | 1020 | ||
1042 | static int __devinit | 1021 | static int __devinit intelfb_init_var(struct intelfb_info *dinfo) |
1043 | intelfb_init_var(struct intelfb_info *dinfo) | ||
1044 | { | 1022 | { |
1045 | struct fb_var_screeninfo *var; | 1023 | struct fb_var_screeninfo *var; |
1046 | int msrc = 0; | 1024 | int msrc = 0; |
@@ -1087,10 +1065,9 @@ intelfb_init_var(struct intelfb_info *dinfo) | |||
1087 | 1065 | ||
1088 | } | 1066 | } |
1089 | 1067 | ||
1090 | if (!msrc) { | 1068 | if (!msrc) |
1091 | msrc = fb_find_mode(var, dinfo->info, PREFERRED_MODE, | 1069 | msrc = fb_find_mode(var, dinfo->info, PREFERRED_MODE, |
1092 | NULL, 0, NULL, 0); | 1070 | NULL, 0, NULL, 0); |
1093 | } | ||
1094 | } | 1071 | } |
1095 | 1072 | ||
1096 | if (!msrc) { | 1073 | if (!msrc) { |
@@ -1122,8 +1099,7 @@ intelfb_init_var(struct intelfb_info *dinfo) | |||
1122 | return 0; | 1099 | return 0; |
1123 | } | 1100 | } |
1124 | 1101 | ||
1125 | static int __devinit | 1102 | static int __devinit intelfb_set_fbinfo(struct intelfb_info *dinfo) |
1126 | intelfb_set_fbinfo(struct intelfb_info *dinfo) | ||
1127 | { | 1103 | { |
1128 | struct fb_info *info = dinfo->info; | 1104 | struct fb_info *info = dinfo->info; |
1129 | 1105 | ||
@@ -1159,8 +1135,8 @@ intelfb_set_fbinfo(struct intelfb_info *dinfo) | |||
1159 | } | 1135 | } |
1160 | 1136 | ||
1161 | /* Update dinfo to match the active video mode. */ | 1137 | /* Update dinfo to match the active video mode. */ |
1162 | static void | 1138 | static void update_dinfo(struct intelfb_info *dinfo, |
1163 | update_dinfo(struct intelfb_info *dinfo, struct fb_var_screeninfo *var) | 1139 | struct fb_var_screeninfo *var) |
1164 | { | 1140 | { |
1165 | DBG_MSG("update_dinfo\n"); | 1141 | DBG_MSG("update_dinfo\n"); |
1166 | 1142 | ||
@@ -1208,36 +1184,32 @@ update_dinfo(struct intelfb_info *dinfo, struct fb_var_screeninfo *var) | |||
1208 | * fbdev interface * | 1184 | * fbdev interface * |
1209 | ***************************************************************/ | 1185 | ***************************************************************/ |
1210 | 1186 | ||
1211 | static int | 1187 | static int intelfb_open(struct fb_info *info, int user) |
1212 | intelfb_open(struct fb_info *info, int user) | ||
1213 | { | 1188 | { |
1214 | struct intelfb_info *dinfo = GET_DINFO(info); | 1189 | struct intelfb_info *dinfo = GET_DINFO(info); |
1215 | 1190 | ||
1216 | if (user) { | 1191 | if (user) |
1217 | dinfo->open++; | 1192 | dinfo->open++; |
1218 | } | ||
1219 | 1193 | ||
1220 | return 0; | 1194 | return 0; |
1221 | } | 1195 | } |
1222 | 1196 | ||
1223 | static int | 1197 | static int intelfb_release(struct fb_info *info, int user) |
1224 | intelfb_release(struct fb_info *info, int user) | ||
1225 | { | 1198 | { |
1226 | struct intelfb_info *dinfo = GET_DINFO(info); | 1199 | struct intelfb_info *dinfo = GET_DINFO(info); |
1227 | 1200 | ||
1228 | if (user) { | 1201 | if (user) { |
1229 | dinfo->open--; | 1202 | dinfo->open--; |
1230 | msleep(1); | 1203 | msleep(1); |
1231 | if (!dinfo->open) { | 1204 | if (!dinfo->open) |
1232 | intelfbhw_disable_irq(dinfo); | 1205 | intelfbhw_disable_irq(dinfo); |
1233 | } | ||
1234 | } | 1206 | } |
1235 | 1207 | ||
1236 | return 0; | 1208 | return 0; |
1237 | } | 1209 | } |
1238 | 1210 | ||
1239 | static int | 1211 | static int intelfb_check_var(struct fb_var_screeninfo *var, |
1240 | intelfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | 1212 | struct fb_info *info) |
1241 | { | 1213 | { |
1242 | int change_var = 0; | 1214 | int change_var = 0; |
1243 | struct fb_var_screeninfo v; | 1215 | struct fb_var_screeninfo v; |
@@ -1271,15 +1243,15 @@ intelfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | |||
1271 | } | 1243 | } |
1272 | 1244 | ||
1273 | /* Check for a supported bpp. */ | 1245 | /* Check for a supported bpp. */ |
1274 | if (v.bits_per_pixel <= 8) { | 1246 | if (v.bits_per_pixel <= 8) |
1275 | v.bits_per_pixel = 8; | 1247 | v.bits_per_pixel = 8; |
1276 | } else if (v.bits_per_pixel <= 16) { | 1248 | else if (v.bits_per_pixel <= 16) { |
1277 | if (v.bits_per_pixel == 16) | 1249 | if (v.bits_per_pixel == 16) |
1278 | v.green.length = 6; | 1250 | v.green.length = 6; |
1279 | v.bits_per_pixel = 16; | 1251 | v.bits_per_pixel = 16; |
1280 | } else if (v.bits_per_pixel <= 32) { | 1252 | } else if (v.bits_per_pixel <= 32) |
1281 | v.bits_per_pixel = 32; | 1253 | v.bits_per_pixel = 32; |
1282 | } else | 1254 | else |
1283 | return -EINVAL; | 1255 | return -EINVAL; |
1284 | 1256 | ||
1285 | change_var = ((info->var.xres != var->xres) || | 1257 | change_var = ((info->var.xres != var->xres) || |
@@ -1361,10 +1333,9 @@ intelfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | |||
1361 | return 0; | 1333 | return 0; |
1362 | } | 1334 | } |
1363 | 1335 | ||
1364 | static int | 1336 | static int intelfb_set_par(struct fb_info *info) |
1365 | intelfb_set_par(struct fb_info *info) | ||
1366 | { | 1337 | { |
1367 | struct intelfb_hwstate *hw; | 1338 | struct intelfb_hwstate *hw; |
1368 | struct intelfb_info *dinfo = GET_DINFO(info); | 1339 | struct intelfb_info *dinfo = GET_DINFO(info); |
1369 | 1340 | ||
1370 | if (FIXED_MODE(dinfo)) { | 1341 | if (FIXED_MODE(dinfo)) { |
@@ -1372,9 +1343,9 @@ intelfb_set_par(struct fb_info *info) | |||
1372 | return -EINVAL; | 1343 | return -EINVAL; |
1373 | } | 1344 | } |
1374 | 1345 | ||
1375 | hw = kmalloc(sizeof(*hw), GFP_ATOMIC); | 1346 | hw = kmalloc(sizeof(*hw), GFP_ATOMIC); |
1376 | if (!hw) | 1347 | if (!hw) |
1377 | return -ENOMEM; | 1348 | return -ENOMEM; |
1378 | 1349 | ||
1379 | DBG_MSG("intelfb_set_par (%dx%d-%d)\n", info->var.xres, | 1350 | DBG_MSG("intelfb_set_par (%dx%d-%d)\n", info->var.xres, |
1380 | info->var.yres, info->var.bits_per_pixel); | 1351 | info->var.yres, info->var.bits_per_pixel); |
@@ -1384,15 +1355,15 @@ intelfb_set_par(struct fb_info *info) | |||
1384 | if (ACCEL(dinfo, info)) | 1355 | if (ACCEL(dinfo, info)) |
1385 | intelfbhw_2d_stop(dinfo); | 1356 | intelfbhw_2d_stop(dinfo); |
1386 | 1357 | ||
1387 | memcpy(hw, &dinfo->save_state, sizeof(*hw)); | 1358 | memcpy(hw, &dinfo->save_state, sizeof(*hw)); |
1388 | if (intelfbhw_mode_to_hw(dinfo, hw, &info->var)) | 1359 | if (intelfbhw_mode_to_hw(dinfo, hw, &info->var)) |
1389 | goto invalid_mode; | 1360 | goto invalid_mode; |
1390 | if (intelfbhw_program_mode(dinfo, hw, 0)) | 1361 | if (intelfbhw_program_mode(dinfo, hw, 0)) |
1391 | goto invalid_mode; | 1362 | goto invalid_mode; |
1392 | 1363 | ||
1393 | #if REGDUMP > 0 | 1364 | #if REGDUMP > 0 |
1394 | intelfbhw_read_hw_state(dinfo, hw, 0); | 1365 | intelfbhw_read_hw_state(dinfo, hw, 0); |
1395 | intelfbhw_print_hw_state(dinfo, hw); | 1366 | intelfbhw_print_hw_state(dinfo, hw); |
1396 | #endif | 1367 | #endif |
1397 | 1368 | ||
1398 | update_dinfo(dinfo, &info->var); | 1369 | update_dinfo(dinfo, &info->var); |
@@ -1408,9 +1379,9 @@ intelfb_set_par(struct fb_info *info) | |||
1408 | info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN | | 1379 | info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN | |
1409 | FBINFO_HWACCEL_COPYAREA | FBINFO_HWACCEL_FILLRECT | | 1380 | FBINFO_HWACCEL_COPYAREA | FBINFO_HWACCEL_FILLRECT | |
1410 | FBINFO_HWACCEL_IMAGEBLIT; | 1381 | FBINFO_HWACCEL_IMAGEBLIT; |
1411 | } else { | 1382 | } else |
1412 | info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN; | 1383 | info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN; |
1413 | } | 1384 | |
1414 | kfree(hw); | 1385 | kfree(hw); |
1415 | return 0; | 1386 | return 0; |
1416 | invalid_mode: | 1387 | invalid_mode: |
@@ -1418,9 +1389,9 @@ invalid_mode: | |||
1418 | return -EINVAL; | 1389 | return -EINVAL; |
1419 | } | 1390 | } |
1420 | 1391 | ||
1421 | static int | 1392 | static int intelfb_setcolreg(unsigned regno, unsigned red, unsigned green, |
1422 | intelfb_setcolreg(unsigned regno, unsigned red, unsigned green, | 1393 | unsigned blue, unsigned transp, |
1423 | unsigned blue, unsigned transp, struct fb_info *info) | 1394 | struct fb_info *info) |
1424 | { | 1395 | { |
1425 | struct intelfb_info *dinfo = GET_DINFO(info); | 1396 | struct intelfb_info *dinfo = GET_DINFO(info); |
1426 | 1397 | ||
@@ -1463,23 +1434,22 @@ intelfb_setcolreg(unsigned regno, unsigned red, unsigned green, | |||
1463 | return 0; | 1434 | return 0; |
1464 | } | 1435 | } |
1465 | 1436 | ||
1466 | static int | 1437 | static int intelfb_blank(int blank, struct fb_info *info) |
1467 | intelfb_blank(int blank, struct fb_info *info) | ||
1468 | { | 1438 | { |
1469 | intelfbhw_do_blank(blank, info); | 1439 | intelfbhw_do_blank(blank, info); |
1470 | return 0; | 1440 | return 0; |
1471 | } | 1441 | } |
1472 | 1442 | ||
1473 | static int | 1443 | static int intelfb_pan_display(struct fb_var_screeninfo *var, |
1474 | intelfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) | 1444 | struct fb_info *info) |
1475 | { | 1445 | { |
1476 | intelfbhw_pan_display(var, info); | 1446 | intelfbhw_pan_display(var, info); |
1477 | return 0; | 1447 | return 0; |
1478 | } | 1448 | } |
1479 | 1449 | ||
1480 | /* When/if we have our own ioctls. */ | 1450 | /* When/if we have our own ioctls. */ |
1481 | static int | 1451 | static int intelfb_ioctl(struct fb_info *info, unsigned int cmd, |
1482 | intelfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) | 1452 | unsigned long arg) |
1483 | { | 1453 | { |
1484 | int retval = 0; | 1454 | int retval = 0; |
1485 | struct intelfb_info *dinfo = GET_DINFO(info); | 1455 | struct intelfb_info *dinfo = GET_DINFO(info); |
@@ -1499,8 +1469,8 @@ intelfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) | |||
1499 | return retval; | 1469 | return retval; |
1500 | } | 1470 | } |
1501 | 1471 | ||
1502 | static void | 1472 | static void intelfb_fillrect (struct fb_info *info, |
1503 | intelfb_fillrect (struct fb_info *info, const struct fb_fillrect *rect) | 1473 | const struct fb_fillrect *rect) |
1504 | { | 1474 | { |
1505 | struct intelfb_info *dinfo = GET_DINFO(info); | 1475 | struct intelfb_info *dinfo = GET_DINFO(info); |
1506 | u32 rop, color; | 1476 | u32 rop, color; |
@@ -1514,7 +1484,7 @@ intelfb_fillrect (struct fb_info *info, const struct fb_fillrect *rect) | |||
1514 | 1484 | ||
1515 | if (rect->rop == ROP_COPY) | 1485 | if (rect->rop == ROP_COPY) |
1516 | rop = PAT_ROP_GXCOPY; | 1486 | rop = PAT_ROP_GXCOPY; |
1517 | else // ROP_XOR | 1487 | else /* ROP_XOR */ |
1518 | rop = PAT_ROP_GXXOR; | 1488 | rop = PAT_ROP_GXXOR; |
1519 | 1489 | ||
1520 | if (dinfo->depth != 8) | 1490 | if (dinfo->depth != 8) |
@@ -1528,8 +1498,8 @@ intelfb_fillrect (struct fb_info *info, const struct fb_fillrect *rect) | |||
1528 | rop); | 1498 | rop); |
1529 | } | 1499 | } |
1530 | 1500 | ||
1531 | static void | 1501 | static void intelfb_copyarea(struct fb_info *info, |
1532 | intelfb_copyarea(struct fb_info *info, const struct fb_copyarea *region) | 1502 | const struct fb_copyarea *region) |
1533 | { | 1503 | { |
1534 | struct intelfb_info *dinfo = GET_DINFO(info); | 1504 | struct intelfb_info *dinfo = GET_DINFO(info); |
1535 | 1505 | ||
@@ -1545,8 +1515,8 @@ intelfb_copyarea(struct fb_info *info, const struct fb_copyarea *region) | |||
1545 | dinfo->pitch, info->var.bits_per_pixel); | 1515 | dinfo->pitch, info->var.bits_per_pixel); |
1546 | } | 1516 | } |
1547 | 1517 | ||
1548 | static void | 1518 | static void intelfb_imageblit(struct fb_info *info, |
1549 | intelfb_imageblit(struct fb_info *info, const struct fb_image *image) | 1519 | const struct fb_image *image) |
1550 | { | 1520 | { |
1551 | struct intelfb_info *dinfo = GET_DINFO(info); | 1521 | struct intelfb_info *dinfo = GET_DINFO(info); |
1552 | u32 fgcolor, bgcolor; | 1522 | u32 fgcolor, bgcolor; |
@@ -1574,8 +1544,7 @@ intelfb_imageblit(struct fb_info *info, const struct fb_image *image) | |||
1574 | return cfb_imageblit(info, image); | 1544 | return cfb_imageblit(info, image); |
1575 | } | 1545 | } |
1576 | 1546 | ||
1577 | static int | 1547 | static int intelfb_cursor(struct fb_info *info, struct fb_cursor *cursor) |
1578 | intelfb_cursor(struct fb_info *info, struct fb_cursor *cursor) | ||
1579 | { | 1548 | { |
1580 | struct intelfb_info *dinfo = GET_DINFO(info); | 1549 | struct intelfb_info *dinfo = GET_DINFO(info); |
1581 | u32 physical; | 1550 | u32 physical; |
@@ -1689,8 +1658,7 @@ intelfb_cursor(struct fb_info *info, struct fb_cursor *cursor) | |||
1689 | return 0; | 1658 | return 0; |
1690 | } | 1659 | } |
1691 | 1660 | ||
1692 | static int | 1661 | static int intelfb_sync(struct fb_info *info) |
1693 | intelfb_sync(struct fb_info *info) | ||
1694 | { | 1662 | { |
1695 | struct intelfb_info *dinfo = GET_DINFO(info); | 1663 | struct intelfb_info *dinfo = GET_DINFO(info); |
1696 | 1664 | ||