diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-04-30 09:55:12 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-07-01 05:01:14 -0400 |
commit | 27cc213ea7dde929692df46a64c8d8ef74663e48 (patch) | |
tree | e500ad95bb76864878966aeaafa29ed5ef330ef1 /drivers/video/omap2/omapfb/omapfb-sysfs.c | |
parent | 065a40bd461d3709a2c36adf0ec383581cc692a7 (diff) |
OMAP: DSS2: OMAPFB: Implement auto-update mode
Implement auto-update mode for manual-update displays. omapfb driver
uses a delayed work to update the display with a constant rate.
The update mode can be changed via OMAPFB_SET_UPDATE_MODE ioctl, which
previously called omapdss but is now handled inside omapfb, and a new
sysfs file, "update_mode".
The update interval is by default 20 times per second, but can be
changed via "auto_update_freq" module parameter. There is also a new
module parameter "auto_update", which will make omapfb start manual
update displays in auto-update mode.
This auto-update mode can be used for testing if the userspace does not
support manual update displays properly. However, it is a very
inefficient solution, and should be considered more as a hack for
testing than something that could be used as a long term solution.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/omapfb/omapfb-sysfs.c')
-rw-r--r-- | drivers/video/omap2/omapfb/omapfb-sysfs.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb-sysfs.c b/drivers/video/omap2/omapfb/omapfb-sysfs.c index 2f5e817b2a9a..153bf1aceebc 100644 --- a/drivers/video/omap2/omapfb/omapfb-sysfs.c +++ b/drivers/video/omap2/omapfb/omapfb-sysfs.c | |||
@@ -518,6 +518,39 @@ static ssize_t show_virt(struct device *dev, | |||
518 | return snprintf(buf, PAGE_SIZE, "%p\n", ofbi->region->vaddr); | 518 | return snprintf(buf, PAGE_SIZE, "%p\n", ofbi->region->vaddr); |
519 | } | 519 | } |
520 | 520 | ||
521 | static ssize_t show_upd_mode(struct device *dev, | ||
522 | struct device_attribute *attr, char *buf) | ||
523 | { | ||
524 | struct fb_info *fbi = dev_get_drvdata(dev); | ||
525 | enum omapfb_update_mode mode; | ||
526 | int r; | ||
527 | |||
528 | r = omapfb_get_update_mode(fbi, &mode); | ||
529 | |||
530 | if (r) | ||
531 | return r; | ||
532 | |||
533 | return snprintf(buf, PAGE_SIZE, "%u\n", (unsigned)mode); | ||
534 | } | ||
535 | |||
536 | static ssize_t store_upd_mode(struct device *dev, struct device_attribute *attr, | ||
537 | const char *buf, size_t count) | ||
538 | { | ||
539 | struct fb_info *fbi = dev_get_drvdata(dev); | ||
540 | unsigned mode; | ||
541 | int r; | ||
542 | |||
543 | r = kstrtouint(buf, 0, &mode); | ||
544 | if (r) | ||
545 | return r; | ||
546 | |||
547 | r = omapfb_set_update_mode(fbi, mode); | ||
548 | if (r) | ||
549 | return r; | ||
550 | |||
551 | return count; | ||
552 | } | ||
553 | |||
521 | static struct device_attribute omapfb_attrs[] = { | 554 | static struct device_attribute omapfb_attrs[] = { |
522 | __ATTR(rotate_type, S_IRUGO | S_IWUSR, show_rotate_type, | 555 | __ATTR(rotate_type, S_IRUGO | S_IWUSR, show_rotate_type, |
523 | store_rotate_type), | 556 | store_rotate_type), |
@@ -528,6 +561,7 @@ static struct device_attribute omapfb_attrs[] = { | |||
528 | store_overlays_rotate), | 561 | store_overlays_rotate), |
529 | __ATTR(phys_addr, S_IRUGO, show_phys, NULL), | 562 | __ATTR(phys_addr, S_IRUGO, show_phys, NULL), |
530 | __ATTR(virt_addr, S_IRUGO, show_virt, NULL), | 563 | __ATTR(virt_addr, S_IRUGO, show_virt, NULL), |
564 | __ATTR(update_mode, S_IRUGO | S_IWUSR, show_upd_mode, store_upd_mode), | ||
531 | }; | 565 | }; |
532 | 566 | ||
533 | int omapfb_create_sysfs(struct omapfb2_device *fbdev) | 567 | int omapfb_create_sysfs(struct omapfb2_device *fbdev) |