diff options
author | Leonard Crestez <leonard.crestez@nxp.com> | 2018-06-14 22:59:05 +0300 |
---|---|---|
committer | Jason Liu <jason.hui.liu@nxp.com> | 2019-02-12 10:32:14 +0800 |
commit | 2106c06cf4f362fdd184a96ab3c51a8aa9c5194e (patch) | |
tree | 40be3fae5772838577752a5c3230903c50500120 /drivers/video | |
parent | b50db0692564add831840fab864c5097333fd4b8 (diff) |
MLK-18585 video: fb: sii902x: Only bind to first mxs-lcdif FB
This driver registers itself as a fb_client and handles notifications
from all FB in the system.
It can end up trying to call fb_draw_logo on an overlay FB and this will
crash because overlay_fb_ops has no fb_imageblit function.
It also handles blank/unblank indiscriminately and for example if you
connect a second LVDS display on 6sx and blank/unblank it then HDMI will
also incorrectly blank/unblank. This last issue even affects imx_4.9.y
Fix by only processing notifications from the FB that it's bound to.
Bind to the first FB whose name starts with "mxs-lcdif" by checking
fb_info->fix.id on FB_EVENT_FB_REGISTERED.
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Acked-by: Robert Chiras <robert.chiras@nxp.com>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/fbdev/mxc/mxsfb_sii902x.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/video/fbdev/mxc/mxsfb_sii902x.c b/drivers/video/fbdev/mxc/mxsfb_sii902x.c index b9ab7db822ed..1a6a2ee992be 100644 --- a/drivers/video/fbdev/mxc/mxsfb_sii902x.c +++ b/drivers/video/fbdev/mxc/mxsfb_sii902x.c @@ -329,19 +329,24 @@ static int sii902x_fb_event(struct notifier_block *nb, unsigned long val, void * struct fb_event *event = v; struct fb_info *fbi = event->info; - dev_dbg(&sii902x.client->dev, "%s event=0x%lx\n", __func__, val); + /* Check if our FB just registered */ + if (!sii902x.fbi && val == FB_EVENT_FB_REGISTERED && + !strncmp(fbi->fix.id, "mxs-lcdif", 9)) { + pr_info("sii902x bound to %s from %s\n", + fbi->fix.id, dev_name(fbi->device)); + sii902x.fbi = fbi; + } - if (sii902x_in_init_state) { - if (val == FB_EVENT_FB_REGISTERED && !sii902x.fbi) - sii902x.fbi = fbi; + /* Ignore if not our FB */ + if (fbi != sii902x.fbi) + return 0; + /* Ignore if driver did not probe yet */ + if (sii902x_in_init_state) return 0; - } switch (val) { case FB_EVENT_FB_REGISTERED: - if (sii902x.fbi == NULL) - sii902x.fbi = fbi; /* Manually trigger a plugin/plugout interrupter to check cable state */ schedule_delayed_work(&(sii902x.det_work), msecs_to_jiffies(50)); |