Guest User

0005-mxsfb-Add-automatic-refresh-timer-for-mpu-panels.patch

a guest
Nov 30th, 2018
123
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. From 54c217582652a6b264cb504b577d249321066905 Mon Sep 17 00:00:00 2001
  2. From: Joe Balough <scallopedllama@gmail.com>
  3. Date: Fri, 23 Nov 2018 13:36:46 -0500
  4. Subject: [PATCH 07/11] mxsfb: Add automatic refresh timer for mpu panels
  5.  
  6. Start a timer when the screen is unblanked for mpu panels that
  7. calls mxsfb_mpu_refresh_panel every 33 ms or about 30 fps.
  8. When the screen is blanked, the timer is stopped.
  9. ---
  10. drivers/video/fbdev/mxsfb.c | 13 +++++++++++++
  11. drivers/video/fbdev/mxsfb.h | 2 ++
  12. 2 files changed, 15 insertions(+)
  13.  
  14. diff --git a/drivers/video/fbdev/mxsfb.c b/drivers/video/fbdev/mxsfb.c
  15. index 1a1793316c62..d283e1ce05b1 100644
  16. --- a/drivers/video/fbdev/mxsfb.c
  17. +++ b/drivers/video/fbdev/mxsfb.c
  18. @@ -520,6 +520,14 @@ int mxsfb_mpu_refresh_panel(struct mxsfb_info *host)
  19. return 0;
  20. }
  21.  
  22. +void mxsfb_mpu_refresh_callback(unsigned long data)
  23. +{
  24. + struct mxsfb_info *host = (struct mxsfb_info *) data;
  25. + mod_timer(&host->mpu_refresh_timer, jiffies + msecs_to_jiffies(33));
  26. +
  27. + mxsfb_mpu_refresh_panel(host);
  28. +}
  29. +
  30. void mxsfb_mpu_setup_refresh_data(struct mxsfb_info *host)
  31. {
  32. unsigned int val;
  33. @@ -1224,7 +1232,10 @@ static int mxsfb_blank(int blank, struct fb_info *fb_info)
  34. case FB_BLANK_NORMAL:
  35. if (host->enabled) {
  36. if (host->is_mpu_lcd)
  37. + {
  38. + del_timer(&host->mpu_refresh_timer);
  39. host->mpu_lcd_functions->mpu_lcd_poweroff(host);
  40. + }
  41. mxsfb_disable_controller(fb_info);
  42. pm_runtime_put_sync_suspend(&host->pdev->dev);
  43. }
  44. @@ -1249,6 +1260,8 @@ static int mxsfb_blank(int blank, struct fb_info *fb_info)
  45. if (host->is_mpu_lcd) {
  46. mxsfb_enable_controller(fb_info);
  47. mxsfb_set_par(host->fb_info);
  48. + setup_timer(&host->mpu_refresh_timer, mxsfb_mpu_refresh_callback, (unsigned long) host);
  49. + mod_timer(&host->mpu_refresh_timer, jiffies + msecs_to_jiffies(30));
  50. } else {
  51. mxsfb_set_par(host->fb_info);
  52. mxsfb_enable_controller(fb_info);
  53. diff --git a/drivers/video/fbdev/mxsfb.h b/drivers/video/fbdev/mxsfb.h
  54. index b922cc5fcf00..39a482a7ceec 100644
  55. --- a/drivers/video/fbdev/mxsfb.h
  56. +++ b/drivers/video/fbdev/mxsfb.h
  57. @@ -24,6 +24,7 @@
  58. #include <linux/fb.h>
  59. #include <linux/mxcfb.h>
  60. #include <linux/pm_qos.h>
  61. +#include <linux/timer.h>
  62.  
  63. #define REG_SET 4
  64. #define REG_CLR 8
  65. @@ -353,6 +354,7 @@ struct mxsfb_info {
  66. bool is_mpu_lcd;
  67. struct mpu_lcd_config * mpu_lcd_sigs;
  68. struct mpu_lcd_callback * mpu_lcd_functions;
  69. + struct timer_list mpu_refresh_timer;
  70.  
  71. #ifdef CONFIG_FB_MXC_OVERLAY
  72. struct mxsfb_layer overlay;
  73. --
  74. 2.19.1
RAW Paste Data