diff options
Diffstat (limited to 'drivers/video/intelfb/intelfbdrv.c')
-rw-r--r-- | drivers/video/intelfb/intelfbdrv.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c index 0a0a8b199ecc..068c56d4e652 100644 --- a/drivers/video/intelfb/intelfbdrv.c +++ b/drivers/video/intelfb/intelfbdrv.c | |||
@@ -137,6 +137,8 @@ | |||
137 | static void __devinit get_initial_mode(struct intelfb_info *dinfo); | 137 | static void __devinit get_initial_mode(struct intelfb_info *dinfo); |
138 | static void update_dinfo(struct intelfb_info *dinfo, | 138 | static void update_dinfo(struct intelfb_info *dinfo, |
139 | struct fb_var_screeninfo *var); | 139 | struct fb_var_screeninfo *var); |
140 | static int intelfb_open(struct fb_info *info, int user); | ||
141 | static int intelfb_release(struct fb_info *info, int user); | ||
140 | static int intelfb_check_var(struct fb_var_screeninfo *var, | 142 | static int intelfb_check_var(struct fb_var_screeninfo *var, |
141 | struct fb_info *info); | 143 | struct fb_info *info); |
142 | static int intelfb_set_par(struct fb_info *info); | 144 | static int intelfb_set_par(struct fb_info *info); |
@@ -195,6 +197,8 @@ static int num_registered = 0; | |||
195 | /* fb ops */ | 197 | /* fb ops */ |
196 | static struct fb_ops intel_fb_ops = { | 198 | static struct fb_ops intel_fb_ops = { |
197 | .owner = THIS_MODULE, | 199 | .owner = THIS_MODULE, |
200 | .fb_open = intelfb_open, | ||
201 | .fb_release = intelfb_release, | ||
198 | .fb_check_var = intelfb_check_var, | 202 | .fb_check_var = intelfb_check_var, |
199 | .fb_set_par = intelfb_set_par, | 203 | .fb_set_par = intelfb_set_par, |
200 | .fb_setcolreg = intelfb_setcolreg, | 204 | .fb_setcolreg = intelfb_setcolreg, |
@@ -447,6 +451,8 @@ cleanup(struct intelfb_info *dinfo) | |||
447 | if (!dinfo) | 451 | if (!dinfo) |
448 | return; | 452 | return; |
449 | 453 | ||
454 | intelfbhw_disable_irq(dinfo); | ||
455 | |||
450 | fb_dealloc_cmap(&dinfo->info->cmap); | 456 | fb_dealloc_cmap(&dinfo->info->cmap); |
451 | kfree(dinfo->info->pixmap.addr); | 457 | kfree(dinfo->info->pixmap.addr); |
452 | 458 | ||
@@ -889,6 +895,11 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
889 | } | 895 | } |
890 | 896 | ||
891 | dinfo->registered = 1; | 897 | dinfo->registered = 1; |
898 | dinfo->open = 0; | ||
899 | |||
900 | init_waitqueue_head(&dinfo->vsync.wait); | ||
901 | spin_lock_init(&dinfo->int_lock); | ||
902 | dinfo->irq_flags = 0; | ||
892 | 903 | ||
893 | return 0; | 904 | return 0; |
894 | 905 | ||
@@ -1189,6 +1200,34 @@ update_dinfo(struct intelfb_info *dinfo, struct fb_var_screeninfo *var) | |||
1189 | ***************************************************************/ | 1200 | ***************************************************************/ |
1190 | 1201 | ||
1191 | static int | 1202 | static int |
1203 | intelfb_open(struct fb_info *info, int user) | ||
1204 | { | ||
1205 | struct intelfb_info *dinfo = GET_DINFO(info); | ||
1206 | |||
1207 | if (user) { | ||
1208 | dinfo->open++; | ||
1209 | } | ||
1210 | |||
1211 | return 0; | ||
1212 | } | ||
1213 | |||
1214 | static int | ||
1215 | intelfb_release(struct fb_info *info, int user) | ||
1216 | { | ||
1217 | struct intelfb_info *dinfo = GET_DINFO(info); | ||
1218 | |||
1219 | if (user) { | ||
1220 | dinfo->open--; | ||
1221 | msleep(1); | ||
1222 | if (!dinfo->open) { | ||
1223 | intelfbhw_disable_irq(dinfo); | ||
1224 | } | ||
1225 | } | ||
1226 | |||
1227 | return 0; | ||
1228 | } | ||
1229 | |||
1230 | static int | ||
1192 | intelfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | 1231 | intelfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) |
1193 | { | 1232 | { |
1194 | int change_var = 0; | 1233 | int change_var = 0; |