Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 54c217582652a6b264cb504b577d249321066905 Mon Sep 17 00:00:00 2001
- From: Joe Balough <scallopedllama@gmail.com>
- Date: Fri, 23 Nov 2018 13:36:46 -0500
- Subject: [PATCH 07/11] mxsfb: Add automatic refresh timer for mpu panels
- Start a timer when the screen is unblanked for mpu panels that
- calls mxsfb_mpu_refresh_panel every 33 ms or about 30 fps.
- When the screen is blanked, the timer is stopped.
- ---
- drivers/video/fbdev/mxsfb.c | 13 +++++++++++++
- drivers/video/fbdev/mxsfb.h | 2 ++
- 2 files changed, 15 insertions(+)
- diff --git a/drivers/video/fbdev/mxsfb.c b/drivers/video/fbdev/mxsfb.c
- index 1a1793316c62..d283e1ce05b1 100644
- --- a/drivers/video/fbdev/mxsfb.c
- +++ b/drivers/video/fbdev/mxsfb.c
- @@ -520,6 +520,14 @@ int mxsfb_mpu_refresh_panel(struct mxsfb_info *host)
- return 0;
- }
- +void mxsfb_mpu_refresh_callback(unsigned long data)
- +{
- + struct mxsfb_info *host = (struct mxsfb_info *) data;
- + mod_timer(&host->mpu_refresh_timer, jiffies + msecs_to_jiffies(33));
- +
- + mxsfb_mpu_refresh_panel(host);
- +}
- +
- void mxsfb_mpu_setup_refresh_data(struct mxsfb_info *host)
- {
- unsigned int val;
- @@ -1224,7 +1232,10 @@ static int mxsfb_blank(int blank, struct fb_info *fb_info)
- case FB_BLANK_NORMAL:
- if (host->enabled) {
- if (host->is_mpu_lcd)
- + {
- + del_timer(&host->mpu_refresh_timer);
- host->mpu_lcd_functions->mpu_lcd_poweroff(host);
- + }
- mxsfb_disable_controller(fb_info);
- pm_runtime_put_sync_suspend(&host->pdev->dev);
- }
- @@ -1249,6 +1260,8 @@ static int mxsfb_blank(int blank, struct fb_info *fb_info)
- if (host->is_mpu_lcd) {
- mxsfb_enable_controller(fb_info);
- mxsfb_set_par(host->fb_info);
- + setup_timer(&host->mpu_refresh_timer, mxsfb_mpu_refresh_callback, (unsigned long) host);
- + mod_timer(&host->mpu_refresh_timer, jiffies + msecs_to_jiffies(30));
- } else {
- mxsfb_set_par(host->fb_info);
- mxsfb_enable_controller(fb_info);
- diff --git a/drivers/video/fbdev/mxsfb.h b/drivers/video/fbdev/mxsfb.h
- index b922cc5fcf00..39a482a7ceec 100644
- --- a/drivers/video/fbdev/mxsfb.h
- +++ b/drivers/video/fbdev/mxsfb.h
- @@ -24,6 +24,7 @@
- #include <linux/fb.h>
- #include <linux/mxcfb.h>
- #include <linux/pm_qos.h>
- +#include <linux/timer.h>
- #define REG_SET 4
- #define REG_CLR 8
- @@ -353,6 +354,7 @@ struct mxsfb_info {
- bool is_mpu_lcd;
- struct mpu_lcd_config * mpu_lcd_sigs;
- struct mpu_lcd_callback * mpu_lcd_functions;
- + struct timer_list mpu_refresh_timer;
- #ifdef CONFIG_FB_MXC_OVERLAY
- struct mxsfb_layer overlay;
- --
- 2.19.1
Add Comment
Please, Sign In to add comment