Skip to contentSkip to conversation

Add display-timing node parsing to exynos drm fimd

PATCH Superseded Vikas Sajjan 2 participants 5 messages Mar 7, 2013

Subsystems (4)

v12 of 13 Superseded Latest is v13 →

lore
Share & tools
lore
#0 lore raw

v12 cover Add display-timing node parsing to exynos drm fimd

Add display-timing node parsing to drm fimd and depends on the display helper patchset at
http://lists.freedesktop.org/archives/dri-devel/2013-January/033998.html

changes since v11:
- Oops, there was a build error, fixed that.

changes since v10:
- abandoned the pinctrl patch, as commented by Linus Walleij <[email protected]>
- added new patch to enable the OF_VIDEOMODE and FB_MODE_HELPERS for EXYNOS DRM FIMD.

changes since v9:
- replaced IS_ERR_OR_NULL() with IS_ERR(), since IS_ERR_OR_NULL() will be depreciated, as discussed at
http://lists.infradead.org/pipermail/linux-arm-kernel/2013-January/140543.html
http://www.mail-archive.com/[email protected]/msg78030.html

changes since v8:
- replaced IS_ERR() with IS_ERR_OR_NULL(),
because devm_pinctrl_get_select_default can return NULL, If CONFIG_PINCTRL is disabled.
- modified the error log, such that it shall NOT cross 80 column.
- added Acked-by.

changes since v7:
- addressed comments from Joonyoung Shim <[email protected]> to remove a unnecessary variable.

changes since v6:
addressed comments from Inki Dae <[email protected]> to separated out the pinctrl functionality and made a separate patch.

changes since v5:
- addressed comments from Inki Dae <[email protected]>, to remove the allocation of 'fbmode' and replaced '-1'in "of_get_fb_videomode(dev->of_node, fbmode, -1)" with OF_USE_NATIVE_MODE.

changes since v4:
- addressed comments from Paul Menzel <[email protected]>, to modify the commit message

changes since v3:
- addressed comments from Sean Paul <[email protected]>, to modify the return values and print messages.

changes since v2:
- moved 'devm_pinctrl_get_select_default' function call under 'if (pdev->dev.of_node)', this makes NON-DT code unchanged. (reported by: Rahul Sharma <[email protected]>)

changes since v1:
- addressed comments from Sean Paul <[email protected]>

Vikas Sajjan (2):
video: drm: exynos: Add display-timing node parsing using video
helper function
drm/exynos: enable OF_VIDEOMODE and FB_MODE_HELPERS for exynos drm
fimd

 drivers/gpu/drm/exynos/Kconfig           |    2 ++
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   27 +++++++++++++++++++++++----
 2 files changed, 25 insertions(+), 4 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v12 1/2 video: drm: exynos: Add display-timing node parsing using video helper function

Add support for parsing the display-timing node using video helper function.

The DT node parsing is done only if 'dev.of_node'
exists and the NON-DT logic is still maintained under the 'else' part.

---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +20 -4
index 9537761..e323cf9 100644
@@ -20,6 +20,7 @@
 #include <linux/of_device.h>
 #include <linux/pm_runtime.h>
 
+#include <video/of_display_timing.h>
 #include <video/samsung_fimd.h>
 #include <drm/exynos_drm.h>
 
@@ -883,10 +884,25 @@ static int fimd_probe(struct platform_device *pdev)
 
 	DRM_DEBUG_KMS("%s\n", __FILE__);
 
-	pdata = pdev->dev.platform_data;
-	if (!pdata) {
-		dev_err(dev, "no platform data specified\n");
-		return -EINVAL;
+	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;
+		}
+
+		ret = of_get_fb_videomode(dev->of_node, &pdata->panel.timing,
+					OF_USE_NATIVE_MODE);
+		if (ret) {
+			DRM_ERROR("failed: of_get_fb_videomode() : %d\n", ret);
+			return ret;
+		}
+	} else {
+		pdata = pdev->dev.platform_data;
+		if (!pdata) {
+			DRM_ERROR("no platform data specified\n");
+			return -EINVAL;
+		}
 	}
 
 	panel = &pdata->panel;
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v12 2/2 drm/exynos: enable OF_VIDEOMODE and FB_MODE_HELPERS for exynos drm fimd

In reply to Vikas Sajjan

patch adds "select OF_VIDEOMODE" and "select FB_MODE_HELPERS" when EXYNOS_DRM_FIMD config is selected.

---
 drivers/gpu/drm/exynos/Kconfig |    2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/exynos/Kconfig +2 -0
index 046bcda..bb25130 100644
@@ -25,6 +25,8 @@ config DRM_EXYNOS_DMABUF
 config DRM_EXYNOS_FIMD
 	bool "Exynos DRM FIMD"
 	depends on DRM_EXYNOS && !FB_S3C && !ARCH_MULTIPLATFORM
+	select OF_VIDEOMODE
+	select FB_MODE_HELPERS
 	help
 	  Choose this option if you want to use Exynos FIMD for DRM.
 
Signature · 1 line
1.7.9.5
maintainer
#3 lore raw

RE: [PATCH v12 2/2] drm/exynos: enable OF_VIDEOMODE and FB_MODE_HELPERS for exynos drm fimd

Quoted 27 lines

-----Original Message-----
From: [email protected] [mailto:linux-media- [email protected]] On Behalf Of Vikas Sajjan
Sent: Thursday, March 07, 2013 4:40 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; linaro- [email protected]
Subject: [PATCH v12 2/2] drm/exynos: enable OF_VIDEOMODE and FB_MODE_HELPERS for exynos drm fimd

patch adds "select OF_VIDEOMODE" and "select FB_MODE_HELPERS" when EXYNOS_DRM_FIMD config is selected.

---
 drivers/gpu/drm/exynos/Kconfig |    2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/exynos/Kconfig +0 -0
index 046bcda..bb25130 100644

drivers/gpu/drm/exynos/Kconfig config DRM_EXYNOS_DMABUF · line 27

Quoted 3 lines
drivers/gpu/drm/exynos/Kconfig +0 -0
@@ -25,6 +25,8 @@ config DRM_EXYNOS_DMABUF
 config DRM_EXYNOS_FIMD
 	bool "Exynos DRM FIMD"
 	depends on DRM_EXYNOS && !FB_S3C && !ARCH_MULTIPLATFORM

Again, you missed 'OF' dependency. At least, let's have build testing surely before posting :)

Thanks,
Inki Dae

Quoted 12 lines
drivers/gpu/drm/exynos/Kconfig +2 -1
+	select OF_VIDEOMODE
+	select FB_MODE_HELPERS
 	help
 	  Choose this option if you want to use Exynos FIMD for DRM.
 
--

1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw

Re: [PATCH v12 2/2] drm/exynos: enable OF_VIDEOMODE and FB_MODE_HELPERS for exynos drm fimd

Hi Mr. Dae,

Quoted 21 lines · Inki Dae
Quoted 21 lines

-----Original Message-----
From: [email protected] [mailto:linux-media- [email protected]] On Behalf Of Vikas Sajjan
Sent: Thursday, March 07, 2013 4:40 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; linaro- [email protected]
Subject: [PATCH v12 2/2] drm/exynos: enable OF_VIDEOMODE and FB_MODE_HELPERS for exynos drm fimd

patch adds "select OF_VIDEOMODE" and "select FB_MODE_HELPERS" when EXYNOS_DRM_FIMD config is selected.

---
 drivers/gpu/drm/exynos/Kconfig |    2 ++
 1 file changed, 2 insertions(+)
Quoted 13 lines

drivers/gpu/drm/exynos/Kconfig config DRM_EXYNOS_DMABUF · line 27

Quoted 9 lines
drivers/gpu/drm/exynos/Kconfig +0 -0
index 046bcda..bb25130 100644
@@ -25,6 +25,8 @@ config DRM_EXYNOS_DMABUF
 config DRM_EXYNOS_FIMD
      bool "Exynos DRM FIMD"
      depends on DRM_EXYNOS && !FB_S3C && !ARCH_MULTIPLATFORM

Again, you missed 'OF' dependency. At least, let's have build testing surely before posting :)

Surely will add " depends on OF && DRM_EXYNOS && !FB_S3C &&
!ARCH_MULTIPLATFORM "
and repost.

Quoted 16 lines

Thanks,
Inki Dae

Quoted 12 lines
drivers/gpu/drm/exynos/Kconfig +2 -1
+     select OF_VIDEOMODE
+     select FB_MODE_HELPERS
      help
        Choose this option if you want to use Exynos FIMD for DRM.
 
--

1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Thanks and Regards
 Vikas Sajjan