diff options
author | Daniel Kochmanski <dkochmanski@antmicro.com> | 2014-08-27 09:18:42 +0200 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2017-01-10 23:11:17 +0100 |
commit | f6620779981e6aebe40e7a400568e454d6a7408f (patch) | |
tree | 9d27aad36a57e1da20ac4cd244fc570ada37ca7d | |
parent | 1bc66f0fb5882f76e8aa9c9893b2274d27db8c13 (diff) |
mxc_hdmi: skip unnecessary mxc_hdmi_setup calls
Signed-off-by: Daniel Kochmanski <dkochmanski@antmicro.com>
Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
(cherry picked from commit 98b68aee3695ae898ef19aa547267fcdb69cf7eb)
-rw-r--r-- | drivers/video/fbdev/mxc/mxc_hdmi.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/video/fbdev/mxc/mxc_hdmi.c b/drivers/video/fbdev/mxc/mxc_hdmi.c index 7932ab2a1554..d22e18d42815 100644 --- a/drivers/video/fbdev/mxc/mxc_hdmi.c +++ b/drivers/video/fbdev/mxc/mxc_hdmi.c @@ -170,6 +170,7 @@ struct mxc_hdmi { spinlock_t irq_lock; bool phy_enabled; struct fb_videomode default_mode; + struct fb_videomode previous_mode; struct fb_videomode previous_non_vga_mode; bool requesting_vga_for_initialization; @@ -2156,6 +2157,9 @@ static void mxc_hdmi_setup(struct mxc_hdmi *hdmi, unsigned long event) dev_dbg(&hdmi->pdev->dev, "%s - video mode changed\n", __func__); + /* Save mode as 'previous_mode' so that we can know if mode changed. */ + memcpy(&hdmi->previous_mode, &m, sizeof(struct fb_videomode)); + hdmi->vic = 0; if (!hdmi->requesting_vga_for_initialization) { /* Save mode if this isn't the result of requesting @@ -2295,6 +2299,7 @@ static int mxc_hdmi_fb_event(struct notifier_block *nb, { struct fb_event *event = v; struct mxc_hdmi *hdmi = container_of(nb, struct mxc_hdmi, nb); + struct fb_videomode *mode; if (strcmp(event->info->fix.id, hdmi->fbi->fix.id)) return 0; @@ -2314,7 +2319,10 @@ static int mxc_hdmi_fb_event(struct notifier_block *nb, case FB_EVENT_MODE_CHANGE: dev_dbg(&hdmi->pdev->dev, "event=FB_EVENT_MODE_CHANGE\n"); - if (hdmi->fb_reg) + mode = (struct fb_videomode *)event->data; + if ((hdmi->fb_reg) && + (mode != NULL) && + !fb_mode_is_equal(&hdmi->previous_mode, mode)) mxc_hdmi_setup(hdmi, val); break; |