Message ID | 1359527449-5174-2-git-send-email-vikas.sajjan@linaro.org (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers |
Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from <linux-media-owner@vger.kernel.org>) id 1U0RGB-0006kb-6U; Wed, 30 Jan 2013 07:35:03 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-4) with esmtp id 1U0RGA-0002yS-BJ; Wed, 30 Jan 2013 07:35:03 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753491Ab3A3GbF (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Wed, 30 Jan 2013 01:31:05 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:34830 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753317Ab3A3GbB (ORCPT <rfc822;linux-media@vger.kernel.org>); Wed, 30 Jan 2013 01:31:01 -0500 Received: by mail-pa0-f46.google.com with SMTP id kp14so890018pab.19 for <linux-media@vger.kernel.org>; Tue, 29 Jan 2013 22:31:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=kscNp+NzX+RWM+SAoEH4AjWs7LwusRUm8rHl/n2f44E=; b=cuCiauF0EQrZI7hXoHDg2Rtm1K7PtlnaBY/LvOiJ0ZfWGycG0l1EoZWtD838qJJ4bn b5C6+mFvUxUGCYqlUVgFcBnUw5usSHeq3r8LLxVs6UVuludZlIQ6SHb/OUN9o8EZGZt5 72KcMKpYsCSnB1mBJgd2SXpBJzUPXvI7AvYvHtIYWUHAKPmnwUapTAQXKS8Qsgq1VYQi tpzEUkU0U6lsuTtPQhdroJsTmVXcHmvr0RTmrED+l7c3LGlgzVSAt++SlDnAtqw94NsQ vAD6GZucGouyXEQu4nPeehfxzIZapd2Xx1Z68bmXlv30rBRtNjcjHM/6xYZ/OGDFnmcC NoiQ== X-Received: by 10.69.1.35 with SMTP id bd3mr9926599pbd.5.1359527460760; Tue, 29 Jan 2013 22:31:00 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id pc9sm631373pbc.1.2013.01.29.22.30.56 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 29 Jan 2013 22:30:59 -0800 (PST) From: Vikas Sajjan <vikas.sajjan@linaro.org> To: dri-devel@lists.freedesktop.org Cc: linux-media@vger.kernel.org, kgene.kim@samsung.com, s.trumtrar@pengutronix.de, inki.dae@samsung.com, l.krishna@samsung.com Subject: [PATCH v2 1/1] video: drm: exynos: Adds display-timing node parsing using video helper function Date: Wed, 30 Jan 2013 12:00:49 +0530 Message-Id: <1359527449-5174-2-git-send-email-vikas.sajjan@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1359527449-5174-1-git-send-email-vikas.sajjan@linaro.org> References: <1359527449-5174-1-git-send-email-vikas.sajjan@linaro.org> X-Gm-Message-State: ALoCoQkZvqLyKDA7PKSHXQJKZb6yuU3xJKa9eb/VW6NG8xNcJVkUfn6WHZi7TiTF+W7RM4vD+r9i Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.1.30.62719 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_MEDIA_BODY 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS , __YOUTUBE_RCVD 0' |
Commit Message
Vikas Sajjan
Jan. 30, 2013, 6:30 a.m. UTC
This patch adds display-timing node parsing using video helper function Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com> Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org> --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 38 +++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-)
Comments
On Wed, Jan 30, 2013 at 1:30 AM, Vikas Sajjan <vikas.sajjan@linaro.org> wrote: > This patch adds display-timing node parsing using video helper function > > Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com> > Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org> > --- > drivers/gpu/drm/exynos/exynos_drm_fimd.c | 38 +++++++++++++++++++++++++++--- > 1 file changed, 35 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c > index bf0d9ba..94729ed 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c > @@ -19,6 +19,7 @@ > #include <linux/clk.h> > #include <linux/of_device.h> > #include <linux/pm_runtime.h> > +#include <linux/pinctrl/consumer.h> > > #include <video/samsung_fimd.h> > #include <drm/exynos_drm.h> > @@ -905,15 +906,46 @@ static int __devinit fimd_probe(struct platform_device *pdev) > struct exynos_drm_subdrv *subdrv; > struct exynos_drm_fimd_pdata *pdata; > struct exynos_drm_panel_info *panel; > + struct fb_videomode *fbmode; > + struct device *disp_dev = &pdev->dev; Isn't this the same as dev (maybe I'm missing some dependent patch)? > + struct pinctrl *pctrl; > struct resource *res; > int win; > int ret = -EINVAL; > > DRM_DEBUG_KMS("%s\n", __FILE__); > > - pdata = pdev->dev.platform_data; > - if (!pdata) { > - dev_err(dev, "no platform data specified\n"); > + if (pdev->dev.of_node) { > + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); > + if (!pdata) { > + DRM_ERROR("memory allocation for pdata failed\n"); > + return -ENOMEM; > + } > + > + fbmode = devm_kzalloc(dev, sizeof(*fbmode), GFP_KERNEL); > + if (!fbmode) { > + DRM_ERROR("memory allocation for fbmode failed\n"); > + return -ENOMEM; > + } > + > + ret = of_get_fb_videomode(disp_dev->of_node, fbmode, -1); > + if (ret) { > + DRM_ERROR("failed to get fb_videomode\n"); > + return -EINVAL; > + } > + pdata->panel.timing = (struct fb_videomode) *fbmode; > + > + } else { > + pdata = pdev->dev.platform_data; > + if (!pdata) { > + DRM_ERROR("no platform data specified\n"); > + return -EINVAL; > + } > + } > + > + pctrl = devm_pinctrl_get_select_default(dev); > + if (IS_ERR(pctrl)) { Will this work for exynos5? AFAICT, there's no pinctrl setup for it. Sean > + DRM_ERROR("no pinctrl data provided.\n"); > return -EINVAL; > } > > -- > 1.7.9.5 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Sean, On 30 January 2013 21:28, Sean Paul <seanpaul@chromium.org> wrote: > On Wed, Jan 30, 2013 at 1:30 AM, Vikas Sajjan <vikas.sajjan@linaro.org> wrote: >> This patch adds display-timing node parsing using video helper function >> >> Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com> >> Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org> >> --- >> drivers/gpu/drm/exynos/exynos_drm_fimd.c | 38 +++++++++++++++++++++++++++--- >> 1 file changed, 35 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c >> index bf0d9ba..94729ed 100644 >> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c >> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c >> @@ -19,6 +19,7 @@ >> #include <linux/clk.h> >> #include <linux/of_device.h> >> #include <linux/pm_runtime.h> >> +#include <linux/pinctrl/consumer.h> >> >> #include <video/samsung_fimd.h> >> #include <drm/exynos_drm.h> >> @@ -905,15 +906,46 @@ static int __devinit fimd_probe(struct platform_device *pdev) >> struct exynos_drm_subdrv *subdrv; >> struct exynos_drm_fimd_pdata *pdata; >> struct exynos_drm_panel_info *panel; >> + struct fb_videomode *fbmode; >> + struct device *disp_dev = &pdev->dev; > > Isn't this the same as dev (maybe I'm missing some dependent patch)? > yeah, its same. Will remove the duplicate variable. >> + struct pinctrl *pctrl; >> struct resource *res; >> int win; >> int ret = -EINVAL; >> >> DRM_DEBUG_KMS("%s\n", __FILE__); >> >> - pdata = pdev->dev.platform_data; >> - if (!pdata) { >> - dev_err(dev, "no platform data specified\n"); >> + if (pdev->dev.of_node) { >> + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); >> + if (!pdata) { >> + DRM_ERROR("memory allocation for pdata failed\n"); >> + return -ENOMEM; >> + } >> + >> + fbmode = devm_kzalloc(dev, sizeof(*fbmode), GFP_KERNEL); >> + if (!fbmode) { >> + DRM_ERROR("memory allocation for fbmode failed\n"); >> + return -ENOMEM; >> + } >> + >> + ret = of_get_fb_videomode(disp_dev->of_node, fbmode, -1); >> + if (ret) { >> + DRM_ERROR("failed to get fb_videomode\n"); >> + return -EINVAL; >> + } >> + pdata->panel.timing = (struct fb_videomode) *fbmode; >> + >> + } else { >> + pdata = pdev->dev.platform_data; >> + if (!pdata) { >> + DRM_ERROR("no platform data specified\n"); >> + return -EINVAL; >> + } >> + } >> + >> + pctrl = devm_pinctrl_get_select_default(dev); >> + if (IS_ERR(pctrl)) { > > Will this work for exynos5? AFAICT, there's no pinctrl setup for it. Was tested with > > Sean > >> + DRM_ERROR("no pinctrl data provided.\n"); >> return -EINVAL; >> } >> >> -- >> 1.7.9.5 >> >> _______________________________________________ >> dri-devel mailing list >> dri-devel@lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Sean, Sorry, wrongly sent incomplete mail. On 31 January 2013 10:41, Vikas Sajjan <vikas.sajjan@linaro.org> wrote: > Hi Sean, > > On 30 January 2013 21:28, Sean Paul <seanpaul@chromium.org> wrote: >> On Wed, Jan 30, 2013 at 1:30 AM, Vikas Sajjan <vikas.sajjan@linaro.org> wrote: >>> This patch adds display-timing node parsing using video helper function >>> >>> Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com> >>> Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org> >>> --- >>> drivers/gpu/drm/exynos/exynos_drm_fimd.c | 38 +++++++++++++++++++++++++++--- >>> 1 file changed, 35 insertions(+), 3 deletions(-) >>> >>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c >>> index bf0d9ba..94729ed 100644 >>> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c >>> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c >>> @@ -19,6 +19,7 @@ >>> #include <linux/clk.h> >>> #include <linux/of_device.h> >>> #include <linux/pm_runtime.h> >>> +#include <linux/pinctrl/consumer.h> >>> >>> #include <video/samsung_fimd.h> >>> #include <drm/exynos_drm.h> >>> @@ -905,15 +906,46 @@ static int __devinit fimd_probe(struct platform_device *pdev) >>> struct exynos_drm_subdrv *subdrv; >>> struct exynos_drm_fimd_pdata *pdata; >>> struct exynos_drm_panel_info *panel; >>> + struct fb_videomode *fbmode; >>> + struct device *disp_dev = &pdev->dev; >> >> Isn't this the same as dev (maybe I'm missing some dependent patch)? >> > yeah, its same. Will remove the duplicate variable. > >>> + struct pinctrl *pctrl; >>> struct resource *res; >>> int win; >>> int ret = -EINVAL; >>> >>> DRM_DEBUG_KMS("%s\n", __FILE__); >>> >>> - pdata = pdev->dev.platform_data; >>> - if (!pdata) { >>> - dev_err(dev, "no platform data specified\n"); >>> + if (pdev->dev.of_node) { >>> + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); >>> + if (!pdata) { >>> + DRM_ERROR("memory allocation for pdata failed\n"); >>> + return -ENOMEM; >>> + } >>> + >>> + fbmode = devm_kzalloc(dev, sizeof(*fbmode), GFP_KERNEL); >>> + if (!fbmode) { >>> + DRM_ERROR("memory allocation for fbmode failed\n"); >>> + return -ENOMEM; >>> + } >>> + >>> + ret = of_get_fb_videomode(disp_dev->of_node, fbmode, -1); >>> + if (ret) { >>> + DRM_ERROR("failed to get fb_videomode\n"); >>> + return -EINVAL; >>> + } >>> + pdata->panel.timing = (struct fb_videomode) *fbmode; >>> + >>> + } else { >>> + pdata = pdev->dev.platform_data; >>> + if (!pdata) { >>> + DRM_ERROR("no platform data specified\n"); >>> + return -EINVAL; >>> + } >>> + } >>> + >>> + pctrl = devm_pinctrl_get_select_default(dev); >>> + if (IS_ERR(pctrl)) { >> >> Will this work for exynos5? AFAICT, there's no pinctrl setup for it. > > Was tested with test on Exynos 4412 SoC, with the arch side changes (refer below link ) http://www.mail-archive.com/linux-samsung-soc@vger.kernel.org/msg15336.html as you said there's no pinctrl setup for it, by making similar changes for exynos5, it should work for exynos5 also. >> >> Sean >> >>> + DRM_ERROR("no pinctrl data provided.\n"); >>> return -EINVAL; >>> } >>> >>> -- >>> 1.7.9.5 >>> >>> _______________________________________________ >>> dri-devel mailing list >>> dri-devel@lists.freedesktop.org >>> http://lists.freedesktop.org/mailman/listinfo/dri-devel > > > > -- > Thanks and Regards > Vikas Sajjan
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index bf0d9ba..94729ed 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -19,6 +19,7 @@ #include <linux/clk.h> #include <linux/of_device.h> #include <linux/pm_runtime.h> +#include <linux/pinctrl/consumer.h> #include <video/samsung_fimd.h> #include <drm/exynos_drm.h> @@ -905,15 +906,46 @@ static int __devinit fimd_probe(struct platform_device *pdev) struct exynos_drm_subdrv *subdrv; struct exynos_drm_fimd_pdata *pdata; struct exynos_drm_panel_info *panel; + struct fb_videomode *fbmode; + struct device *disp_dev = &pdev->dev; + struct pinctrl *pctrl; struct resource *res; int win; int ret = -EINVAL; DRM_DEBUG_KMS("%s\n", __FILE__); - pdata = pdev->dev.platform_data; - if (!pdata) { - dev_err(dev, "no platform data specified\n"); + if (pdev->dev.of_node) { + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) { + DRM_ERROR("memory allocation for pdata failed\n"); + return -ENOMEM; + } + + fbmode = devm_kzalloc(dev, sizeof(*fbmode), GFP_KERNEL); + if (!fbmode) { + DRM_ERROR("memory allocation for fbmode failed\n"); + return -ENOMEM; + } + + ret = of_get_fb_videomode(disp_dev->of_node, fbmode, -1); + if (ret) { + DRM_ERROR("failed to get fb_videomode\n"); + return -EINVAL; + } + pdata->panel.timing = (struct fb_videomode) *fbmode; + + } else { + pdata = pdev->dev.platform_data; + if (!pdata) { + DRM_ERROR("no platform data specified\n"); + return -EINVAL; + } + } + + pctrl = devm_pinctrl_get_select_default(dev); + if (IS_ERR(pctrl)) { + DRM_ERROR("no pinctrl data provided.\n"); return -EINVAL; }