diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
commit | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch) | |
tree | a8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /drivers/video/intelfb | |
parent | 406089d01562f1e2bf9f089fd7637009ebaad589 (diff) |
Patched in Tegra support.
Diffstat (limited to 'drivers/video/intelfb')
-rw-r--r-- | drivers/video/intelfb/intelfbdrv.c | 50 | ||||
-rw-r--r-- | drivers/video/intelfb/intelfbhw.c | 6 |
2 files changed, 28 insertions, 28 deletions
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c index 8209e46c5d2..5ba39999105 100644 --- a/drivers/video/intelfb/intelfbdrv.c +++ b/drivers/video/intelfb/intelfbdrv.c | |||
@@ -132,7 +132,7 @@ | |||
132 | #include "intelfbhw.h" | 132 | #include "intelfbhw.h" |
133 | #include "../edid.h" | 133 | #include "../edid.h" |
134 | 134 | ||
135 | static void get_initial_mode(struct intelfb_info *dinfo); | 135 | static void __devinit get_initial_mode(struct intelfb_info *dinfo); |
136 | static void update_dinfo(struct intelfb_info *dinfo, | 136 | static void update_dinfo(struct intelfb_info *dinfo, |
137 | struct fb_var_screeninfo *var); | 137 | struct fb_var_screeninfo *var); |
138 | static int intelfb_open(struct fb_info *info, int user); | 138 | static int intelfb_open(struct fb_info *info, int user); |
@@ -162,10 +162,10 @@ static int intelfb_sync(struct fb_info *info); | |||
162 | static int intelfb_ioctl(struct fb_info *info, | 162 | static int intelfb_ioctl(struct fb_info *info, |
163 | unsigned int cmd, unsigned long arg); | 163 | unsigned int cmd, unsigned long arg); |
164 | 164 | ||
165 | static int intelfb_pci_register(struct pci_dev *pdev, | 165 | static int __devinit intelfb_pci_register(struct pci_dev *pdev, |
166 | const struct pci_device_id *ent); | 166 | const struct pci_device_id *ent); |
167 | static void intelfb_pci_unregister(struct pci_dev *pdev); | 167 | static void __devexit intelfb_pci_unregister(struct pci_dev *pdev); |
168 | static int intelfb_set_fbinfo(struct intelfb_info *dinfo); | 168 | static int __devinit intelfb_set_fbinfo(struct intelfb_info *dinfo); |
169 | 169 | ||
170 | /* | 170 | /* |
171 | * Limiting the class to PCI_CLASS_DISPLAY_VGA prevents function 1 of the | 171 | * Limiting the class to PCI_CLASS_DISPLAY_VGA prevents function 1 of the |
@@ -177,7 +177,7 @@ static int intelfb_set_fbinfo(struct intelfb_info *dinfo); | |||
177 | #define INTELFB_CLASS_MASK 0 | 177 | #define INTELFB_CLASS_MASK 0 |
178 | #endif | 178 | #endif |
179 | 179 | ||
180 | static struct pci_device_id intelfb_pci_table[] = { | 180 | static struct pci_device_id intelfb_pci_table[] __devinitdata = { |
181 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_830M, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_830M }, | 181 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_830M, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_830M }, |
182 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_845G, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_845G }, | 182 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_845G, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_845G }, |
183 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_85XGM, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_85XGM }, | 183 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_85XGM, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_85XGM }, |
@@ -219,7 +219,7 @@ static struct pci_driver intelfb_driver = { | |||
219 | .name = "intelfb", | 219 | .name = "intelfb", |
220 | .id_table = intelfb_pci_table, | 220 | .id_table = intelfb_pci_table, |
221 | .probe = intelfb_pci_register, | 221 | .probe = intelfb_pci_register, |
222 | .remove = intelfb_pci_unregister, | 222 | .remove = __devexit_p(intelfb_pci_unregister) |
223 | }; | 223 | }; |
224 | 224 | ||
225 | /* Module description/parameters */ | 225 | /* Module description/parameters */ |
@@ -230,15 +230,15 @@ MODULE_DESCRIPTION("Framebuffer driver for Intel(R) " SUPPORTED_CHIPSETS | |||
230 | MODULE_LICENSE("Dual BSD/GPL"); | 230 | MODULE_LICENSE("Dual BSD/GPL"); |
231 | MODULE_DEVICE_TABLE(pci, intelfb_pci_table); | 231 | MODULE_DEVICE_TABLE(pci, intelfb_pci_table); |
232 | 232 | ||
233 | static bool accel = 1; | 233 | static int accel = 1; |
234 | static int vram = 4; | 234 | static int vram = 4; |
235 | static bool hwcursor = 0; | 235 | static int hwcursor = 0; |
236 | static bool mtrr = 1; | 236 | static int mtrr = 1; |
237 | static bool fixed = 0; | 237 | static int fixed = 0; |
238 | static bool noinit = 0; | 238 | static int noinit = 0; |
239 | static bool noregister = 0; | 239 | static int noregister = 0; |
240 | static bool probeonly = 0; | 240 | static int probeonly = 0; |
241 | static bool idonly = 0; | 241 | static int idonly = 0; |
242 | static int bailearly = 0; | 242 | static int bailearly = 0; |
243 | static int voffset = 48; | 243 | static int voffset = 48; |
244 | static char *mode = NULL; | 244 | static char *mode = NULL; |
@@ -263,7 +263,7 @@ module_param(probeonly, bool, 0); | |||
263 | MODULE_PARM_DESC(probeonly, "Do a minimal probe (debug)"); | 263 | MODULE_PARM_DESC(probeonly, "Do a minimal probe (debug)"); |
264 | module_param(idonly, bool, 0); | 264 | module_param(idonly, bool, 0); |
265 | MODULE_PARM_DESC(idonly, "Just identify without doing anything else (debug)"); | 265 | MODULE_PARM_DESC(idonly, "Just identify without doing anything else (debug)"); |
266 | module_param(bailearly, int, 0); | 266 | module_param(bailearly, bool, 0); |
267 | MODULE_PARM_DESC(bailearly, "Bail out early, depending on value (debug)"); | 267 | MODULE_PARM_DESC(bailearly, "Bail out early, depending on value (debug)"); |
268 | module_param(mode, charp, S_IRUGO); | 268 | module_param(mode, charp, S_IRUGO); |
269 | MODULE_PARM_DESC(mode, | 269 | MODULE_PARM_DESC(mode, |
@@ -415,7 +415,7 @@ module_exit(intelfb_exit); | |||
415 | ***************************************************************/ | 415 | ***************************************************************/ |
416 | 416 | ||
417 | #ifdef CONFIG_MTRR | 417 | #ifdef CONFIG_MTRR |
418 | static inline void set_mtrr(struct intelfb_info *dinfo) | 418 | static inline void __devinit set_mtrr(struct intelfb_info *dinfo) |
419 | { | 419 | { |
420 | dinfo->mtrr_reg = mtrr_add(dinfo->aperture.physical, | 420 | dinfo->mtrr_reg = mtrr_add(dinfo->aperture.physical, |
421 | dinfo->aperture.size, MTRR_TYPE_WRCOMB, 1); | 421 | dinfo->aperture.size, MTRR_TYPE_WRCOMB, 1); |
@@ -497,8 +497,8 @@ static void cleanup(struct intelfb_info *dinfo) | |||
497 | } while (0) | 497 | } while (0) |
498 | 498 | ||
499 | 499 | ||
500 | static int intelfb_pci_register(struct pci_dev *pdev, | 500 | static int __devinit intelfb_pci_register(struct pci_dev *pdev, |
501 | const struct pci_device_id *ent) | 501 | const struct pci_device_id *ent) |
502 | { | 502 | { |
503 | struct fb_info *info; | 503 | struct fb_info *info; |
504 | struct intelfb_info *dinfo; | 504 | struct intelfb_info *dinfo; |
@@ -529,6 +529,7 @@ static int intelfb_pci_register(struct pci_dev *pdev, | |||
529 | if (fb_alloc_cmap(&info->cmap, 256, 1) < 0) { | 529 | if (fb_alloc_cmap(&info->cmap, 256, 1) < 0) { |
530 | ERR_MSG("Could not allocate cmap for intelfb_info.\n"); | 530 | ERR_MSG("Could not allocate cmap for intelfb_info.\n"); |
531 | goto err_out_cmap; | 531 | goto err_out_cmap; |
532 | return -ENODEV; | ||
532 | } | 533 | } |
533 | 534 | ||
534 | dinfo = info->par; | 535 | dinfo = info->par; |
@@ -680,7 +681,6 @@ static int intelfb_pci_register(struct pci_dev *pdev, | |||
680 | + dinfo->fb.size); | 681 | + dinfo->fb.size); |
681 | if (!dinfo->aperture.virtual) { | 682 | if (!dinfo->aperture.virtual) { |
682 | ERR_MSG("Cannot remap FB region.\n"); | 683 | ERR_MSG("Cannot remap FB region.\n"); |
683 | agp_backend_release(bridge); | ||
684 | cleanup(dinfo); | 684 | cleanup(dinfo); |
685 | return -ENODEV; | 685 | return -ENODEV; |
686 | } | 686 | } |
@@ -690,7 +690,6 @@ static int intelfb_pci_register(struct pci_dev *pdev, | |||
690 | INTEL_REG_SIZE); | 690 | INTEL_REG_SIZE); |
691 | if (!dinfo->mmio_base) { | 691 | if (!dinfo->mmio_base) { |
692 | ERR_MSG("Cannot remap MMIO region.\n"); | 692 | ERR_MSG("Cannot remap MMIO region.\n"); |
693 | agp_backend_release(bridge); | ||
694 | cleanup(dinfo); | 693 | cleanup(dinfo); |
695 | return -ENODEV; | 694 | return -ENODEV; |
696 | } | 695 | } |
@@ -921,7 +920,8 @@ err_out_cmap: | |||
921 | return -ENODEV; | 920 | return -ENODEV; |
922 | } | 921 | } |
923 | 922 | ||
924 | static void intelfb_pci_unregister(struct pci_dev *pdev) | 923 | static void __devexit |
924 | intelfb_pci_unregister(struct pci_dev *pdev) | ||
925 | { | 925 | { |
926 | struct intelfb_info *dinfo = pci_get_drvdata(pdev); | 926 | struct intelfb_info *dinfo = pci_get_drvdata(pdev); |
927 | 927 | ||
@@ -969,7 +969,7 @@ static __inline__ int var_to_refresh(const struct fb_var_screeninfo *var) | |||
969 | * Various intialisation functions * | 969 | * Various intialisation functions * |
970 | ***************************************************************/ | 970 | ***************************************************************/ |
971 | 971 | ||
972 | static void get_initial_mode(struct intelfb_info *dinfo) | 972 | static void __devinit get_initial_mode(struct intelfb_info *dinfo) |
973 | { | 973 | { |
974 | struct fb_var_screeninfo *var; | 974 | struct fb_var_screeninfo *var; |
975 | int xtot, ytot; | 975 | int xtot, ytot; |
@@ -1036,7 +1036,7 @@ static void get_initial_mode(struct intelfb_info *dinfo) | |||
1036 | } | 1036 | } |
1037 | } | 1037 | } |
1038 | 1038 | ||
1039 | static int intelfb_init_var(struct intelfb_info *dinfo) | 1039 | static int __devinit intelfb_init_var(struct intelfb_info *dinfo) |
1040 | { | 1040 | { |
1041 | struct fb_var_screeninfo *var; | 1041 | struct fb_var_screeninfo *var; |
1042 | int msrc = 0; | 1042 | int msrc = 0; |
@@ -1117,7 +1117,7 @@ static int intelfb_init_var(struct intelfb_info *dinfo) | |||
1117 | return 0; | 1117 | return 0; |
1118 | } | 1118 | } |
1119 | 1119 | ||
1120 | static int intelfb_set_fbinfo(struct intelfb_info *dinfo) | 1120 | static int __devinit intelfb_set_fbinfo(struct intelfb_info *dinfo) |
1121 | { | 1121 | { |
1122 | struct fb_info *info = dinfo->info; | 1122 | struct fb_info *info = dinfo->info; |
1123 | 1123 | ||
diff --git a/drivers/video/intelfb/intelfbhw.c b/drivers/video/intelfb/intelfbhw.c index fbad61da359..38065cf94ac 100644 --- a/drivers/video/intelfb/intelfbhw.c +++ b/drivers/video/intelfb/intelfbhw.c | |||
@@ -390,12 +390,12 @@ int intelfbhw_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) | |||
390 | xoffset = ROUND_DOWN_TO(var->xoffset, 8); | 390 | xoffset = ROUND_DOWN_TO(var->xoffset, 8); |
391 | yoffset = var->yoffset; | 391 | yoffset = var->yoffset; |
392 | 392 | ||
393 | if ((xoffset + info->var.xres > info->var.xres_virtual) || | 393 | if ((xoffset + var->xres > var->xres_virtual) || |
394 | (yoffset + info->var.yres > info->var.yres_virtual)) | 394 | (yoffset + var->yres > var->yres_virtual)) |
395 | return -EINVAL; | 395 | return -EINVAL; |
396 | 396 | ||
397 | offset = (yoffset * dinfo->pitch) + | 397 | offset = (yoffset * dinfo->pitch) + |
398 | (xoffset * info->var.bits_per_pixel) / 8; | 398 | (xoffset * var->bits_per_pixel) / 8; |
399 | 399 | ||
400 | offset += dinfo->fb.offset << 12; | 400 | offset += dinfo->fb.offset << 12; |
401 | 401 | ||