From patchwork Sat Aug 27 10:28:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jaya Kumar X-Patchwork-Id: 1103652 X-Patchwork-Delegate: tomi.valkeinen@nokia.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7RASnce011892 for ; Sat, 27 Aug 2011 10:28:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751149Ab1H0K2t (ORCPT ); Sat, 27 Aug 2011 06:28:49 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:38635 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751124Ab1H0K2s convert rfc822-to-8bit (ORCPT ); Sat, 27 Aug 2011 06:28:48 -0400 Received: by bke11 with SMTP id 11so3093214bke.19 for ; Sat, 27 Aug 2011 03:28:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=WSF1//GMdaj9S6pmgbRdz3786yvvBLNUqaDRuKXxBtQ=; b=uLnhjV02OHgN+Pjt7VXsEHuUP9Ag5GXqBVTS5syBwUSBCILyHtJhRXlNnFNrAiaZGj v7n7/hWRhj1jLQ9HVq/bG+T8mov90N6Wf09721aVaQQVOCUg7YIViGkAWDuRaj992C2f /GvtQTms4losRjjQQUKksmS1kEOQRiyMw8wII= MIME-Version: 1.0 Received: by 10.204.142.144 with SMTP id q16mr1151488bku.268.1314440926943; Sat, 27 Aug 2011 03:28:46 -0700 (PDT) Received: by 10.204.103.204 with HTTP; Sat, 27 Aug 2011 03:28:46 -0700 (PDT) In-Reply-To: <1314001636-18036-2-git-send-email-tomi.valkeinen@ti.com> References: <1314001636-18036-1-git-send-email-tomi.valkeinen@ti.com> <1314001636-18036-2-git-send-email-tomi.valkeinen@ti.com> Date: Sat, 27 Aug 2011 18:28:46 +0800 Message-ID: Subject: Re: [PATCH 1/4] OMAP: OMAPFB: make omapfb start even when a display is missing a driver From: Jaya Kumar To: Tomi Valkeinen Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, archit@ti.com Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sat, 27 Aug 2011 10:28:50 +0000 (UTC) On Mon, Aug 22, 2011 at 4:27 PM, Tomi Valkeinen wrote: > Currently omapfb wants that all the display devices have a driver, > otherwise omapfb refuses to start. There's no real requirement to act > like that, and this patch will make omapfb give a warning and skip that > device. Hi Tomi, Just a question, I am working with an out-of-tree hdmi driver for the NXP TDA9984 with dm3730. This worked fine in 2.6.32 as a runtime loaded dss display driver. That is: +static struct omap_dss_device wiser2_hdmi_device = { + .type = OMAP_DISPLAY_TYPE_DPI, + .name = "hdmi", + .driver_name = "hdmi_panel", + .phy.dpi.data_lines = 24, + .platform_enable = wiser2_enable_hdmi, + .platform_disable = wiser2_disable_hdmi, +}; + +static struct omap_dss_device wiser2_tv_device = { + .name = "tv", + .driver_name = "venc", + .type = OMAP_DISPLAY_TYPE_VENC, + .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, + .platform_enable = wiser2_panel_enable_tv, + .platform_disable = wiser2_panel_disable_tv, +}; + +static struct omap_dss_device *wiser2_dss_devices[] = { + &wiser2_dvi_device, + &wiser2_tv_device, + &wiser2_hdmi_device, +}; so this hdmi_panel omap_dss_driver was being insmoded after init at bootup and it worked fine, no problems with omaplfb so pvr stuff worked fine. I then switched to 2.6.37 (from TI devkit 2.1 gingerbread) and this kernel wasn't so happy (panic at boot). I applied your patch below. I also figured out that omap_vout had a similar problem as the one you've fixed which was what was causing the panic (omap_vout tries to call display->driver->update without checking if driver exists): > --- >  drivers/video/omap2/omapfb/omapfb-main.c |    5 +++-- >  1 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c > index e5a64b3..cd2cae8e 100644 > --- a/drivers/video/omap2/omapfb/omapfb-main.c > +++ b/drivers/video/omap2/omapfb/omapfb-main.c > @@ -2373,9 +2373,10 @@ static int omapfb_probe(struct platform_device *pdev) >                omap_dss_get_device(dssdev); > >                if (!dssdev->driver) { > -                       dev_err(&pdev->dev, "no driver for display: %s\n", > +                       dev_warn(&pdev->dev, "no driver for display: %s\n", >                                dssdev->name); > -                       r = -ENODEV; > +                       omap_dss_put_device(dssdev); > +                       continue; >                } > >                d = &fbdev->displays[fbdev->num_displays++]; > -- > 1.7.4.1 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at  http://vger.kernel.org/majordomo-info.html > --- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/video/omap/omap_vout.c b/drivers/media/video/omap/omap_vout.c index 2aee372..36d69db 100644 --- a/drivers/media/video/omap/omap_vout.c +++ b/drivers/media/video/omap/omap_vout.c @@ -2574,24 +2591,32 @@ static int __init omap_vout_probe(struct platform_device *pdev) + printk(KERN_INFO "%s:%d\n", __func__, __LINE__); for (i = 0; i < vid_dev->num_displays; i++) { struct omap_dss_device *display = vid_dev->displays[i]; - if (display->driver->update) + printk(KERN_INFO "%s:%d\n", __func__, __LINE__); + if ((display->driver) && (display->driver->update)) { + printk(KERN_INFO "%s:%d\n", __func__, __LINE__); display->driver->update(display, 0, 0, display->panel.timings.x_res, display->panel.timings.y_res); + } + printk(KERN_INFO "%s:%d\n", __func__, __LINE__); } + printk(KERN_INFO "%s:%d\n", __func__, __LINE__); return 0; After that change, it boots up cleanly but I don't get any display output. I noticed that: echo 1 > /sys/devices/omapdss/display2/enabled no longer works. display2 stays enabled=0 rather than coming on. I'm planning on debugging this some more when I have some free time. But I figured I should ask first if this is a known problem, whether anyone else is testing runtime loaded omap_dss_driver stuff and if anyone has gotten it to work with kernels 2.6.37 and above. Thanks, jaya > > Signed-off-by: Tomi Valkeinen