diff options
author | Michael Hennerich <michael.hennerich@analog.com> | 2010-03-10 18:21:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-12 18:52:32 -0500 |
commit | d40f29bff30a1a50d7ad69bd150c9cda1ce1ba9d (patch) | |
tree | dd83d32b45588d06e1150f899f93faf6c1d6f566 | |
parent | 0d3580d40cc38bbaf63d0b2756931e0ae241a9ea (diff) |
fbdev: bf54x-lq043fb/bfin-t350mcqb-fb: drop custom mmap() handler
The common Blackfin code implements the get_fb_unmapped_area() function,
so we no longer need to have our own mmap() handler. The common fb code
will take care of everything for us now.
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/video/bf54x-lq043fb.c | 30 | ||||
-rw-r--r-- | drivers/video/bfin-t350mcqb-fb.c | 29 |
2 files changed, 0 insertions, 59 deletions
diff --git a/drivers/video/bf54x-lq043fb.c b/drivers/video/bf54x-lq043fb.c index e49ae5edcc00..814312a7452f 100644 --- a/drivers/video/bf54x-lq043fb.c +++ b/drivers/video/bf54x-lq043fb.c | |||
@@ -82,7 +82,6 @@ struct bfin_bf54xfb_info { | |||
82 | unsigned char *fb_buffer; /* RGB Buffer */ | 82 | unsigned char *fb_buffer; /* RGB Buffer */ |
83 | 83 | ||
84 | dma_addr_t dma_handle; | 84 | dma_addr_t dma_handle; |
85 | int lq043_mmap; | ||
86 | int lq043_open_cnt; | 85 | int lq043_open_cnt; |
87 | int irq; | 86 | int irq; |
88 | spinlock_t lock; /* lock */ | 87 | spinlock_t lock; /* lock */ |
@@ -316,7 +315,6 @@ static int bfin_bf54x_fb_release(struct fb_info *info, int user) | |||
316 | spin_lock(&fbi->lock); | 315 | spin_lock(&fbi->lock); |
317 | 316 | ||
318 | fbi->lq043_open_cnt--; | 317 | fbi->lq043_open_cnt--; |
319 | fbi->lq043_mmap = 0; | ||
320 | 318 | ||
321 | if (fbi->lq043_open_cnt <= 0) { | 319 | if (fbi->lq043_open_cnt <= 0) { |
322 | 320 | ||
@@ -374,33 +372,6 @@ static int bfin_bf54x_fb_check_var(struct fb_var_screeninfo *var, | |||
374 | return 0; | 372 | return 0; |
375 | } | 373 | } |
376 | 374 | ||
377 | static int bfin_bf54x_fb_mmap(struct fb_info *info, struct vm_area_struct *vma) | ||
378 | { | ||
379 | |||
380 | struct bfin_bf54xfb_info *fbi = info->par; | ||
381 | |||
382 | if (fbi->lq043_mmap) | ||
383 | return -1; | ||
384 | |||
385 | spin_lock(&fbi->lock); | ||
386 | fbi->lq043_mmap = 1; | ||
387 | spin_unlock(&fbi->lock); | ||
388 | |||
389 | vma->vm_start = (unsigned long)(fbi->fb_buffer); | ||
390 | |||
391 | vma->vm_end = vma->vm_start + info->fix.smem_len; | ||
392 | /* For those who don't understand how mmap works, go read | ||
393 | * Documentation/nommu-mmap.txt. | ||
394 | * For those that do, you will know that the VM_MAYSHARE flag | ||
395 | * must be set in the vma->vm_flags structure on noMMU | ||
396 | * Other flags can be set, and are documented in | ||
397 | * include/linux/mm.h | ||
398 | */ | ||
399 | vma->vm_flags |= VM_MAYSHARE | VM_SHARED; | ||
400 | |||
401 | return 0; | ||
402 | } | ||
403 | |||
404 | int bfin_bf54x_fb_cursor(struct fb_info *info, struct fb_cursor *cursor) | 375 | int bfin_bf54x_fb_cursor(struct fb_info *info, struct fb_cursor *cursor) |
405 | { | 376 | { |
406 | if (nocursor) | 377 | if (nocursor) |
@@ -452,7 +423,6 @@ static struct fb_ops bfin_bf54x_fb_ops = { | |||
452 | .fb_fillrect = cfb_fillrect, | 423 | .fb_fillrect = cfb_fillrect, |
453 | .fb_copyarea = cfb_copyarea, | 424 | .fb_copyarea = cfb_copyarea, |
454 | .fb_imageblit = cfb_imageblit, | 425 | .fb_imageblit = cfb_imageblit, |
455 | .fb_mmap = bfin_bf54x_fb_mmap, | ||
456 | .fb_cursor = bfin_bf54x_fb_cursor, | 426 | .fb_cursor = bfin_bf54x_fb_cursor, |
457 | .fb_setcolreg = bfin_bf54x_fb_setcolreg, | 427 | .fb_setcolreg = bfin_bf54x_fb_setcolreg, |
458 | }; | 428 | }; |
diff --git a/drivers/video/bfin-t350mcqb-fb.c b/drivers/video/bfin-t350mcqb-fb.c index 2549c53b26a0..5653d083a983 100644 --- a/drivers/video/bfin-t350mcqb-fb.c +++ b/drivers/video/bfin-t350mcqb-fb.c | |||
@@ -87,7 +87,6 @@ struct bfin_t350mcqbfb_info { | |||
87 | struct device *dev; | 87 | struct device *dev; |
88 | unsigned char *fb_buffer; /* RGB Buffer */ | 88 | unsigned char *fb_buffer; /* RGB Buffer */ |
89 | dma_addr_t dma_handle; | 89 | dma_addr_t dma_handle; |
90 | int lq043_mmap; | ||
91 | int lq043_open_cnt; | 90 | int lq043_open_cnt; |
92 | int irq; | 91 | int irq; |
93 | spinlock_t lock; /* lock */ | 92 | spinlock_t lock; /* lock */ |
@@ -235,7 +234,6 @@ static int bfin_t350mcqb_fb_release(struct fb_info *info, int user) | |||
235 | spin_lock(&fbi->lock); | 234 | spin_lock(&fbi->lock); |
236 | 235 | ||
237 | fbi->lq043_open_cnt--; | 236 | fbi->lq043_open_cnt--; |
238 | fbi->lq043_mmap = 0; | ||
239 | 237 | ||
240 | if (fbi->lq043_open_cnt <= 0) { | 238 | if (fbi->lq043_open_cnt <= 0) { |
241 | bfin_t350mcqb_disable_ppi(); | 239 | bfin_t350mcqb_disable_ppi(); |
@@ -293,32 +291,6 @@ static int bfin_t350mcqb_fb_check_var(struct fb_var_screeninfo *var, | |||
293 | return 0; | 291 | return 0; |
294 | } | 292 | } |
295 | 293 | ||
296 | static int bfin_t350mcqb_fb_mmap(struct fb_info *info, struct vm_area_struct *vma) | ||
297 | { | ||
298 | struct bfin_t350mcqbfb_info *fbi = info->par; | ||
299 | |||
300 | if (fbi->lq043_mmap) | ||
301 | return -1; | ||
302 | |||
303 | spin_lock(&fbi->lock); | ||
304 | fbi->lq043_mmap = 1; | ||
305 | spin_unlock(&fbi->lock); | ||
306 | |||
307 | vma->vm_start = (unsigned long)(fbi->fb_buffer + ACTIVE_VIDEO_MEM_OFFSET); | ||
308 | |||
309 | vma->vm_end = vma->vm_start + info->fix.smem_len; | ||
310 | /* For those who don't understand how mmap works, go read | ||
311 | * Documentation/nommu-mmap.txt. | ||
312 | * For those that do, you will know that the VM_MAYSHARE flag | ||
313 | * must be set in the vma->vm_flags structure on noMMU | ||
314 | * Other flags can be set, and are documented in | ||
315 | * include/linux/mm.h | ||
316 | */ | ||
317 | vma->vm_flags |= VM_MAYSHARE | VM_SHARED; | ||
318 | |||
319 | return 0; | ||
320 | } | ||
321 | |||
322 | int bfin_t350mcqb_fb_cursor(struct fb_info *info, struct fb_cursor *cursor) | 294 | int bfin_t350mcqb_fb_cursor(struct fb_info *info, struct fb_cursor *cursor) |
323 | { | 295 | { |
324 | if (nocursor) | 296 | if (nocursor) |
@@ -370,7 +342,6 @@ static struct fb_ops bfin_t350mcqb_fb_ops = { | |||
370 | .fb_fillrect = cfb_fillrect, | 342 | .fb_fillrect = cfb_fillrect, |
371 | .fb_copyarea = cfb_copyarea, | 343 | .fb_copyarea = cfb_copyarea, |
372 | .fb_imageblit = cfb_imageblit, | 344 | .fb_imageblit = cfb_imageblit, |
373 | .fb_mmap = bfin_t350mcqb_fb_mmap, | ||
374 | .fb_cursor = bfin_t350mcqb_fb_cursor, | 345 | .fb_cursor = bfin_t350mcqb_fb_cursor, |
375 | .fb_setcolreg = bfin_t350mcqb_fb_setcolreg, | 346 | .fb_setcolreg = bfin_t350mcqb_fb_setcolreg, |
376 | }; | 347 | }; |