diff options
author | Daniel Kochmanski <dkochmanski@antmicro.com> | 2014-08-27 09:18:42 +0200 |
---|---|---|
committer | Philippe Schenker <philippe.schenker@toradex.com> | 2019-05-24 11:34:13 +0200 |
commit | e03145d1a261a82a0fa562db301d635f4d0b308e (patch) | |
tree | 51ed7bd5f5a9e98cbaf798867f70feb890adb6c8 /drivers/video | |
parent | 4e8a26bfb6b90a01bdbae14f9b9b1c6bd0cf16ef (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)
(cherry picked from commit f6620779981e6aebe40e7a400568e454d6a7408f)
Diffstat (limited to 'drivers/video')
-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 b39cd44e8f79..f7703c27d381 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; @@ -2170,6 +2171,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 @@ -2309,6 +2313,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; @@ -2328,7 +2333,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; |