diff options
author | Daniel Kochmanski <dkochmanski@antmicro.com> | 2014-08-27 09:18:42 +0200 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2015-05-29 13:43:42 +0200 |
commit | 98d3ba3af6deafe0d3e9e33315287a91a7f9d4ab (patch) | |
tree | ed048422dfc3917c62e95d68f327b65c05d6afad /drivers | |
parent | ab0b8b152f0bccb50c4921859b9d9ef521a01781 (diff) |
mxc_hdmi: skip unnecessary mxc_hdmi_setup calls
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/mxc/mxc_hdmi.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/video/mxc/mxc_hdmi.c b/drivers/video/mxc/mxc_hdmi.c index 98b03ec0920a..64ddf641b877 100644 --- a/drivers/video/mxc/mxc_hdmi.c +++ b/drivers/video/mxc/mxc_hdmi.c @@ -178,6 +178,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; |