aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/atafb.c5
-rw-r--r--drivers/video/fbmem.c2
-rw-r--r--drivers/video/fbsysfs.c3
-rw-r--r--drivers/video/i810/i810_main.c3
-rw-r--r--drivers/video/matrox/matroxfb_base.c2
-rw-r--r--drivers/video/matrox/matroxfb_crtc2.c6
-rw-r--r--drivers/video/sm501fb.c2
-rw-r--r--drivers/video/w100fb.c2
8 files changed, 12 insertions, 13 deletions
diff --git a/drivers/video/atafb.c b/drivers/video/atafb.c
index 497ff8af03ed..8cd279be74e5 100644
--- a/drivers/video/atafb.c
+++ b/drivers/video/atafb.c
@@ -2405,6 +2405,9 @@ static int do_fb_set_var(struct fb_var_screeninfo *var, int isactive)
2405 return 0; 2405 return 0;
2406} 2406}
2407 2407
2408/* fbhw->encode_fix() must be called with fb_info->mm_lock held
2409 * if it is called after the register_framebuffer() - not a case here
2410 */
2408static int atafb_get_fix(struct fb_fix_screeninfo *fix, struct fb_info *info) 2411static int atafb_get_fix(struct fb_fix_screeninfo *fix, struct fb_info *info)
2409{ 2412{
2410 struct atafb_par par; 2413 struct atafb_par par;
@@ -2414,9 +2417,7 @@ static int atafb_get_fix(struct fb_fix_screeninfo *fix, struct fb_info *info)
2414 if (err) 2417 if (err)
2415 return err; 2418 return err;
2416 memset(fix, 0, sizeof(struct fb_fix_screeninfo)); 2419 memset(fix, 0, sizeof(struct fb_fix_screeninfo));
2417 mutex_lock(&info->mm_lock);
2418 err = fbhw->encode_fix(fix, &par); 2420 err = fbhw->encode_fix(fix, &par);
2419 mutex_unlock(&info->mm_lock);
2420 return err; 2421 return err;
2421} 2422}
2422 2423
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 53eb39652791..53ea05645ff8 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -1513,6 +1513,8 @@ register_framebuffer(struct fb_info *fb_info)
1513 if (!registered_fb[i]) 1513 if (!registered_fb[i])
1514 break; 1514 break;
1515 fb_info->node = i; 1515 fb_info->node = i;
1516 mutex_init(&fb_info->lock);
1517 mutex_init(&fb_info->mm_lock);
1516 1518
1517 fb_info->dev = device_create(fb_class, fb_info->device, 1519 fb_info->dev = device_create(fb_class, fb_info->device,
1518 MKDEV(FB_MAJOR, i), NULL, "fb%d", i); 1520 MKDEV(FB_MAJOR, i), NULL, "fb%d", i);
diff --git a/drivers/video/fbsysfs.c b/drivers/video/fbsysfs.c
index afc04df39a03..d4a2c11d9809 100644
--- a/drivers/video/fbsysfs.c
+++ b/drivers/video/fbsysfs.c
@@ -62,9 +62,6 @@ struct fb_info *framebuffer_alloc(size_t size, struct device *dev)
62 mutex_init(&info->bl_curve_mutex); 62 mutex_init(&info->bl_curve_mutex);
63#endif 63#endif
64 64
65 mutex_init(&info->lock);
66 mutex_init(&info->mm_lock);
67
68 return info; 65 return info;
69#undef PADDING 66#undef PADDING
70#undef BYTES_PER_LONG 67#undef BYTES_PER_LONG
diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c
index 71960672d721..5743ea25e818 100644
--- a/drivers/video/i810/i810_main.c
+++ b/drivers/video/i810/i810_main.c
@@ -2060,8 +2060,7 @@ static int __devinit i810fb_init_pci (struct pci_dev *dev,
2060 2060
2061 fb_var_to_videomode(&mode, &info->var); 2061 fb_var_to_videomode(&mode, &info->var);
2062 fb_add_videomode(&mode, &info->modelist); 2062 fb_add_videomode(&mode, &info->modelist);
2063 encode_fix(&info->fix, info); 2063
2064
2065 i810fb_init_ringbuffer(info); 2064 i810fb_init_ringbuffer(info);
2066 err = register_framebuffer(info); 2065 err = register_framebuffer(info);
2067 2066
diff --git a/drivers/video/matrox/matroxfb_base.c b/drivers/video/matrox/matroxfb_base.c
index 76bc51b616d1..0c1049b308bf 100644
--- a/drivers/video/matrox/matroxfb_base.c
+++ b/drivers/video/matrox/matroxfb_base.c
@@ -1876,7 +1876,6 @@ static int initMatrox2(WPMINFO struct board* b){
1876 } 1876 }
1877 matroxfb_init_fix(PMINFO2); 1877 matroxfb_init_fix(PMINFO2);
1878 ACCESS_FBINFO(fbcon.screen_base) = vaddr_va(ACCESS_FBINFO(video.vbase)); 1878 ACCESS_FBINFO(fbcon.screen_base) = vaddr_va(ACCESS_FBINFO(video.vbase));
1879 matroxfb_update_fix(PMINFO2);
1880 /* Normalize values (namely yres_virtual) */ 1879 /* Normalize values (namely yres_virtual) */
1881 matroxfb_check_var(&vesafb_defined, &ACCESS_FBINFO(fbcon)); 1880 matroxfb_check_var(&vesafb_defined, &ACCESS_FBINFO(fbcon));
1882 /* And put it into "current" var. Do NOT program hardware yet, or we'll not take over 1881 /* And put it into "current" var. Do NOT program hardware yet, or we'll not take over
@@ -2083,7 +2082,6 @@ static int matroxfb_probe(struct pci_dev* pdev, const struct pci_device_id* dumm
2083 spin_lock_init(&ACCESS_FBINFO(lock.accel)); 2082 spin_lock_init(&ACCESS_FBINFO(lock.accel));
2084 init_rwsem(&ACCESS_FBINFO(crtc2.lock)); 2083 init_rwsem(&ACCESS_FBINFO(crtc2.lock));
2085 init_rwsem(&ACCESS_FBINFO(altout.lock)); 2084 init_rwsem(&ACCESS_FBINFO(altout.lock));
2086 mutex_init(&ACCESS_FBINFO(fbcon).lock);
2087 mutex_init(&ACCESS_FBINFO(fbcon).mm_lock); 2085 mutex_init(&ACCESS_FBINFO(fbcon).mm_lock);
2088 ACCESS_FBINFO(irq_flags) = 0; 2086 ACCESS_FBINFO(irq_flags) = 0;
2089 init_waitqueue_head(&ACCESS_FBINFO(crtc1.vsync.wait)); 2087 init_waitqueue_head(&ACCESS_FBINFO(crtc1.vsync.wait));
diff --git a/drivers/video/matrox/matroxfb_crtc2.c b/drivers/video/matrox/matroxfb_crtc2.c
index 909e10a11898..ebcb5c6b4962 100644
--- a/drivers/video/matrox/matroxfb_crtc2.c
+++ b/drivers/video/matrox/matroxfb_crtc2.c
@@ -289,16 +289,18 @@ static int matroxfb_dh_release(struct fb_info* info, int user) {
289#undef m2info 289#undef m2info
290} 290}
291 291
292/*
293 * This function is called before the register_framebuffer so
294 * no locking is needed.
295 */
292static void matroxfb_dh_init_fix(struct matroxfb_dh_fb_info *m2info) 296static void matroxfb_dh_init_fix(struct matroxfb_dh_fb_info *m2info)
293{ 297{
294 struct fb_fix_screeninfo *fix = &m2info->fbcon.fix; 298 struct fb_fix_screeninfo *fix = &m2info->fbcon.fix;
295 299
296 strcpy(fix->id, "MATROX DH"); 300 strcpy(fix->id, "MATROX DH");
297 301
298 mutex_lock(&m2info->fbcon.mm_lock);
299 fix->smem_start = m2info->video.base; 302 fix->smem_start = m2info->video.base;
300 fix->smem_len = m2info->video.len_usable; 303 fix->smem_len = m2info->video.len_usable;
301 mutex_unlock(&m2info->fbcon.mm_lock);
302 fix->ypanstep = 1; 304 fix->ypanstep = 1;
303 fix->ywrapstep = 0; 305 fix->ywrapstep = 0;
304 fix->xpanstep = 8; /* TBD */ 306 fix->xpanstep = 8; /* TBD */
diff --git a/drivers/video/sm501fb.c b/drivers/video/sm501fb.c
index 98f24f0ec00d..16d4f4c7d52b 100644
--- a/drivers/video/sm501fb.c
+++ b/drivers/video/sm501fb.c
@@ -1624,6 +1624,8 @@ static int __devinit sm501fb_start_one(struct sm501fb_info *info,
1624 if (!fbi) 1624 if (!fbi)
1625 return 0; 1625 return 0;
1626 1626
1627 mutex_init(&info->fb[head]->mm_lock);
1628
1627 ret = sm501fb_init_fb(info->fb[head], head, drvname); 1629 ret = sm501fb_init_fb(info->fb[head], head, drvname);
1628 if (ret) { 1630 if (ret) {
1629 dev_err(info->dev, "cannot initialise fb %s\n", drvname); 1631 dev_err(info->dev, "cannot initialise fb %s\n", drvname);
diff --git a/drivers/video/w100fb.c b/drivers/video/w100fb.c
index 8a141c2c637b..2376f688ec8b 100644
--- a/drivers/video/w100fb.c
+++ b/drivers/video/w100fb.c
@@ -748,8 +748,6 @@ int __init w100fb_probe(struct platform_device *pdev)
748 goto out; 748 goto out;
749 } 749 }
750 750
751 w100fb_set_par(info);
752
753 if (register_framebuffer(info) < 0) { 751 if (register_framebuffer(info) < 0) {
754 err = -EINVAL; 752 err = -EINVAL;
755 goto out; 753 goto out;