dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] add mie driver for exynos
@ 2012-12-06 12:08 R. Chandrasekar
  2012-12-06 12:08 ` [PATCH 1/3] DTS: exynos: add device tree support for exynos mie R. Chandrasekar
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: R. Chandrasekar @ 2012-12-06 12:08 UTC (permalink / raw)
  To: linux-samsung-soc, devicetree-discuss, dri-devel
  Cc: kgene.kim, inki.dae, kyungmin.park, joshi, rcsekar.samsung, rcsekar

From: "R. Chandrasekar" <rcsekar@samsung.com>

this patch set adds the driver support for the dithering functionality of the
mobile image enhancement (mie) module.
 
device tree support is added for mie.

fimd adds the mie module as plugin and calls the dithering function. dithere is
required when the panels bpp is less then fimd output.
 
though mie mie has other functionalities, current system uses only dithereing.

R. Chandrasekar (3):
  DTS: exynos: add device tree support for exynos mie
  drm: fimd: add mie plugin support for dithering
  drm: mie: add mie driver for exynos

 arch/arm/boot/dts/exynos5250.dtsi               |    7 +-
 drivers/gpu/drm/exynos/Kconfig                  |    7 +
 drivers/gpu/drm/exynos/Makefile                 |    1 +
 drivers/gpu/drm/exynos/exynos_drm_fimd.c        |   58 +++++-
 drivers/gpu/drm/exynos/exynos_drm_fimd_common.h |   20 ++
 drivers/gpu/drm/exynos/exynos_drm_mie.c         |  250 +++++++++++++++++++++++
 drivers/gpu/drm/exynos/exynos_drm_mie.h         |   50 +++++
 drivers/gpu/drm/exynos/exynos_regs-mie.h        |   75 +++++++
 8 files changed, 465 insertions(+), 3 deletions(-)
 create mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimd_common.h
 create mode 100644 drivers/gpu/drm/exynos/exynos_drm_mie.c
 create mode 100644 drivers/gpu/drm/exynos/exynos_drm_mie.h
 create mode 100644 drivers/gpu/drm/exynos/exynos_regs-mie.h

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/3] DTS: exynos: add device tree support for exynos mie
  2012-12-06 12:08 [PATCH 0/3] add mie driver for exynos R. Chandrasekar
@ 2012-12-06 12:08 ` R. Chandrasekar
  2012-12-06 12:08 ` [PATCH 2/3] drm: fimd: add mie plugin support for dithering R. Chandrasekar
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: R. Chandrasekar @ 2012-12-06 12:08 UTC (permalink / raw)
  To: linux-samsung-soc, devicetree-discuss, dri-devel
  Cc: kgene.kim, inki.dae, kyungmin.park, joshi, rcsekar.samsung, rcsekar

From: "R. Chandrasekar" <rcsekar@samsung.com>

adding device tree support for mobile image enhancement (mie)
module of exynos SoC. driver fetches the base address of mie
from the device tree.

Signed-off-by: R. Chandrasekar <rcsekar@samsung.com>
---
 arch/arm/boot/dts/exynos5250.dtsi |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index 8ee3139..abe6520 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -562,10 +562,15 @@
 	fimd: fimd {
 		compatible = "samsung,exynos5-fimd";
 		interrupt-parent = <&combiner>;
-		reg = <0x14400000 0x40000>;
+		reg = <0x14400000 0x30000>;
 		interrupts = <18 5>, <18 4>, <18 6>;
 	};
 
+	mie: mie {
+		compatible = "samsung,exynos5-mie";
+		reg = <0x14430000 0x400>;
+	};
+
 	sysmmu-mfc-l {
 		mmuname = "mfc_l";
 		reg = <0x11210000 0x1000>;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/3] drm: fimd: add mie plugin support for dithering
  2012-12-06 12:08 [PATCH 0/3] add mie driver for exynos R. Chandrasekar
  2012-12-06 12:08 ` [PATCH 1/3] DTS: exynos: add device tree support for exynos mie R. Chandrasekar
@ 2012-12-06 12:08 ` R. Chandrasekar
  2012-12-06 12:08 ` [PATCH 3/3] drm: mie: add mie driver for exynos R. Chandrasekar
  2012-12-10  6:26 ` [PATCH 0/3] " Inki Dae
  3 siblings, 0 replies; 11+ messages in thread
From: R. Chandrasekar @ 2012-12-06 12:08 UTC (permalink / raw)
  To: linux-samsung-soc, devicetree-discuss, dri-devel
  Cc: kgene.kim, inki.dae, kyungmin.park, joshi, rcsekar.samsung, rcsekar

From: "R. Chandrasekar" <rcsekar@samsung.com>

mie provides the dithereing functionality, fimd need to call the
mie dithering function is required when panel uses lesser
bits per pixel (bpp) of fimd.

This cl adds the functions to add the mie plugin, and calls the
mie dithereing function.

Signed-off-by: R. Chandrasekar <rcsekar@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c        |   58 ++++++++++++++++++++++-
 drivers/gpu/drm/exynos/exynos_drm_fimd_common.h |   20 ++++++++
 2 files changed, 76 insertions(+), 2 deletions(-)
 create mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimd_common.h

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index e2abae6..6e406d2 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -27,6 +27,7 @@
 #include "exynos_drm_fbdev.h"
 #include "exynos_drm_crtc.h"
 #include "exynos_drm_iommu.h"
+#include "exynos_drm_mie.h"
 
 /*
  * FIMD is stand for Fully Interactive Mobile Display and
@@ -107,9 +108,59 @@ struct fimd_context {
 
 static const struct of_device_id fimd_dt_match[];
 
-static inline struct fimd_driver_data *drm_fimd_get_driver_data(
-	struct platform_device *pdev)
+static struct mie_plugin *mie;
+
+/* This function provides the fecility to add the mie plugin with fimd */
+void fimd_add_mie_plugin(struct mie_plugin *mie_plugin_data)
+{
+	mie = mie_plugin_data;
+}
+
+static int fimd_set_dithering_mode(struct fimd_context *ctx,
+					enum en_dither_mode dither_mode)
 {
+	struct fb_videomode *timing = &ctx->panel->timing;
+	struct mie_settings settings;
+	int ret = -1;
+
+	DRM_DEBUG_KMS(" %s Called\n", __func__);
+
+	if (!mie) {
+		DRM_DEBUG_KMS("invalid  mie plugin.\n");
+		return -EINVAL;
+	}
+
+	if ((!mie->ops.fn_configure_dither) || (!mie->ops.fn_dither_enable)) {
+		DRM_DEBUG_KMS("Invalid MIE function pointers\n");
+		return -EINVAL;
+	}
+
+	settings.xres = timing->xres;
+	settings.yres = timing->yres;
+	settings.left_margin = timing->left_margin;
+	settings.right_margin = timing->right_margin;
+	settings.upper_margin = timing->upper_margin;
+	settings.lower_margin = timing->lower_margin;
+	settings.hsync_len = timing->hsync_len;
+	settings.vsync_len = timing->vsync_len;
+
+	if (dither_mode < INVALID_DITHER_MODE)
+		settings.dither_mode = dither_mode;
+	else {
+		DRM_DEBUG_KMS("Invalid dithering mode[%d]\n", dither_mode);
+		return -EINVAL;
+	}
+
+	ret = mie->ops.fn_configure_dither(mie->dev, &settings);
+
+	if (!ret)
+		ret = mie->ops.fn_dither_enable(mie->dev, MIE_DITHER_EN);
+
+	return ret;
+}
+
+static inline struct fimd_driver_data *drm_fimd_get_driver_data(
+	struct platform_device *pdev) {
 #ifdef CONFIG_OF
 	if (pdev->dev.of_node) {
 		const struct of_device_id *match;
@@ -558,6 +609,9 @@ static void fimd_win_commit(struct device *dev, int zpos)
 	val |= WINCONx_ENWIN;
 	writel(val, ctx->regs + WINCON(win));
 
+	/* enable 6bit dithering  based on pannel type TBD*/
+	fimd_set_dithering_mode(ctx, DITHER_6BIT);
+
 	/* Enable DMA channel and unprotect windows */
 	val = readl(ctx->regs + SHADOWCON);
 	val |= SHADOWCON_CHx_ENABLE(win);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd_common.h b/drivers/gpu/drm/exynos/exynos_drm_fimd_common.h
new file mode 100644
index 0000000..bdd4fc7
--- /dev/null
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd_common.h
@@ -0,0 +1,20 @@
+/* exynos_drm_fimd_common.h
+ *
+ * Copyright (C) 2012 Samsung Electronics Co.Ltd
+ * Authors:
+ *	R. Chandrasekar <rcsekar@samsung.com>
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ *
+ */
+
+#ifndef __EXYNOS_DRM_FIMD_COMMON_H
+#define __EXYNOS_DRM_FIMD_COMMON_H
+
+
+void fimd_add_mie_plugin(struct mie_plugin *mie_plugin_data);
+
+#endif /*__EXYNOS_DRM_FIMD_COMMON_H */
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/3] drm: mie: add mie driver for exynos
  2012-12-06 12:08 [PATCH 0/3] add mie driver for exynos R. Chandrasekar
  2012-12-06 12:08 ` [PATCH 1/3] DTS: exynos: add device tree support for exynos mie R. Chandrasekar
  2012-12-06 12:08 ` [PATCH 2/3] drm: fimd: add mie plugin support for dithering R. Chandrasekar
@ 2012-12-06 12:08 ` R. Chandrasekar
  2012-12-10  6:26 ` [PATCH 0/3] " Inki Dae
  3 siblings, 0 replies; 11+ messages in thread
From: R. Chandrasekar @ 2012-12-06 12:08 UTC (permalink / raw)
  To: linux-samsung-soc, devicetree-discuss, dri-devel
  Cc: kgene.kim, inki.dae, kyungmin.park, joshi, rcsekar.samsung, rcsekar

From: "R. Chandrasekar" <rcsekar@samsung.com>

Adding driver for the Mobile Image Enhancement (MIE)
module of exynos SoC. This cl scope is limited to dithereing.
mie dithering function is enabled from fimd

Signed-off-by: R. Chandrasekar <rcsekar@samsung.com>

Change-Id: I05be2a2a5484719ff7bdeff722d95223191b077f
---
 drivers/gpu/drm/exynos/Kconfig           |    7 +
 drivers/gpu/drm/exynos/Makefile          |    1 +
 drivers/gpu/drm/exynos/exynos_drm_mie.c  |  250 ++++++++++++++++++++++++++++++
 drivers/gpu/drm/exynos/exynos_drm_mie.h  |   50 ++++++
 drivers/gpu/drm/exynos/exynos_regs-mie.h |   75 +++++++++
 5 files changed, 383 insertions(+)
 create mode 100644 drivers/gpu/drm/exynos/exynos_drm_mie.c
 create mode 100644 drivers/gpu/drm/exynos/exynos_drm_mie.h
 create mode 100644 drivers/gpu/drm/exynos/exynos_regs-mie.h

diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig
index 86fb75d..6a0794f 100644
--- a/drivers/gpu/drm/exynos/Kconfig
+++ b/drivers/gpu/drm/exynos/Kconfig
@@ -28,6 +28,13 @@ config DRM_EXYNOS_FIMD
 	help
 	  Choose this option if you want to use Exynos FIMD for DRM.
 
+config DRM_EXYNOS_MIE
+	bool "Exynos DRM MIE"
+	depends on DRM_EXYNOS
+	help
+	  Choose this option if you want to use Exynos MIE for DRM.
+	  MIE provides only dithering functionality.
+
 config DRM_EXYNOS_HDMI
 	bool "Exynos DRM HDMI"
 	depends on DRM_EXYNOS && !VIDEO_SAMSUNG_S5P_TV
diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile
index 26813b8..aa25e9d 100644
--- a/drivers/gpu/drm/exynos/Makefile
+++ b/drivers/gpu/drm/exynos/Makefile
@@ -16,5 +16,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI)	+= exynos_hdmi.o exynos_mixer.o \
 					   exynos_drm_hdmi.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI)	+= exynos_drm_vidi.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_G2D)	+= exynos_drm_g2d.o
+exynosdrm-$(CONFIG_DRM_EXYNOS_MIE)	+= exynos_drm_mie.o
 
 obj-$(CONFIG_DRM_EXYNOS)		+= exynosdrm.o
diff --git a/drivers/gpu/drm/exynos/exynos_drm_mie.c b/drivers/gpu/drm/exynos/exynos_drm_mie.c
new file mode 100644
index 0000000..63de92c
--- /dev/null
+++ b/drivers/gpu/drm/exynos/exynos_drm_mie.c
@@ -0,0 +1,250 @@
+/* exynos_drm_mie.c
+ *
+ * Copyright (C) 2012 Samsung Electronics Co.Ltd
+ * Authors:
+ *	R. Chandrasekar <rcsekar@samsung.com>
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ *
+ */
+#include "drmP.h"
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <drm/exynos_drm.h>
+#include "exynos_drm_drv.h"
+#include "exynos_regs-mie.h"
+#include "exynos_drm_mie.h"
+#include "exynos_drm_fimd_common.h"
+
+struct mie_context {
+	void __iomem *regs;
+	struct mie_plugin plugin;
+	bool enabled;
+	bool configured;
+};
+
+#define get_mie_context(dev) platform_get_drvdata(to_platform_device(dev))
+
+static int mie_dither_enable(struct device *dev, bool enable)
+{
+	struct mie_context *ctx = NULL;
+	int reg;
+
+	DRM_DEBUG_KMS(" %s Called\n", __func__);
+
+	if (!dev) {
+		DRM_DEBUG_KMS("[mie] invalid device @ %s\n", __func__);
+		return -EINVAL;
+	}
+
+	ctx = get_mie_context(dev);
+
+	if (!ctx) {
+		dev_err(dev, "[mie] invalid context.\n");
+		return -EINVAL;
+	}
+
+	reg = readl(ctx->regs + MIE_AUXCON);
+	reg &= ~MIE_DITHCON_EN; /* Clear Enable */
+
+	if (enable) {
+		if (!ctx->configured) {
+			DRM_DEBUG_KMS("MIE Not Configured ");
+			DRM_DEBUG_KMS("Confgure mie before calling enable\n");
+			return -EINVAL;
+		}
+		reg |= MIE_DITHCON_EN; /* Set Enable */
+	}
+
+	writel(MIE_DITHCON_EN, ctx->regs + MIE_AUXCON);
+	ctx->enabled = enable;
+
+	return 0;
+}
+
+static int mie_configure_dither(struct device *dev,
+		struct mie_settings *settings)
+{
+	struct mie_context *ctx;
+	unsigned long val;
+	int i, rgb_mode;
+
+	DRM_DEBUG_KMS(" %s Called\n", __func__);
+
+	if (!dev) {
+		DRM_DEBUG_KMS("[mie] invalid mie device @ %s\n", __func__);
+		return -EINVAL;
+	}
+
+	if (!settings) {
+		DRM_DEBUG_KMS("[mie] Settings ptr is null @ %s\n", __func__);
+		return -EINVAL;
+	}
+
+	ctx = get_mie_context(dev);
+
+	if (!ctx) {
+		dev_err(dev, "[mie] invalid context.\n");
+		return -EINVAL;
+	}
+
+	DRM_DEBUG_KMS("Xres = %d, Yres = %d, LeftMargin = %d\n", settings->xres,
+		settings->yres, settings->left_margin);
+
+	if (settings->dither_mode == DITHER_6BIT)
+		rgb_mode = MIE_RGB6MODE;
+	else if (settings->dither_mode == DITHER_8BIT)
+		rgb_mode = MIE_RGB8MODE;
+	else
+		return -EINVAL;
+
+	writel(MIE_HRESOL(settings->xres) | MIE_VRESOL(settings->yres) |
+				MIE_MODE_UI, ctx->regs + MIE_CTRL1);
+
+	writel(MIE_WINHADDR0(0) | MIE_WINHADDR1(settings->xres),
+						ctx->regs + MIE_WINHADDR);
+	writel(MIE_WINVADDR0(0) | MIE_WINVADDR1(settings->yres),
+						ctx->regs + MIE_WINVADDR);
+
+	val = (settings->xres + settings->left_margin +
+			settings->right_margin + settings->hsync_len) *
+		(settings->yres + settings->upper_margin +
+		settings->lower_margin + settings->vsync_len) /
+		(MIE_PWMCLKVAL + 1);
+
+	writel(PWMCLKCNT(val), ctx->regs + MIE_PWMCLKCNT);
+
+	writel((MIE_VBPD(settings->upper_margin)) |
+		MIE_VFPD(settings->lower_margin) |
+		MIE_VSPW(settings->vsync_len), ctx->regs + MIE_PWMVIDTCON1);
+
+	writel(MIE_HBPD(settings->left_margin) |
+		MIE_HFPD(settings->right_margin) |
+		MIE_HSPW(settings->hsync_len), ctx->regs + MIE_PWMVIDTCON2);
+
+	val = readl(ctx->regs + MIE_AUXCON);
+	val &= ~MIE_RGBMODE;
+	val |= rgb_mode;
+	writel(val, ctx->regs + MIE_AUXCON);
+	writel(MIE_RGB8MODE, ctx->regs + MIE_AUXCON);
+
+
+	/* Bypass MIE image brightness enhancement */
+	for (i = 0; i <= MIE_MAX_BRIGHTNESS_CNT_REGS; i += 4) {
+		writel(0, ctx->regs + MIE_BRIGTNESS_REG1_OFFSET + i);
+		writel(0, ctx->regs + MIE_BRIGTNESS_REG2_OFFSET + i);
+	}
+
+	ctx->configured = true;
+
+	return 0;
+}
+
+
+int mie_get_dither_state(struct device *dev, bool *is_enabled)
+{
+	struct mie_context *ctx = NULL;
+
+	DRM_DEBUG_KMS(" %s Called\n", __func__);
+
+	if (!dev) {
+		DRM_DEBUG_KMS("[mie] invalid device.\n");
+		return -EINVAL;
+	}
+
+	ctx = get_mie_context(dev);
+
+	if ((ctx) && (is_enabled))
+		*is_enabled = ctx->enabled;
+	 else
+		return -EINVAL;
+
+	return 0;
+}
+
+static int __devinit mie_probe(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	struct mie_context *ctx;
+	struct resource *res;
+
+	DRM_DEBUG_KMS(" %s Called\n", __func__);
+
+	ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
+	if (!ctx) {
+		dev_err(dev, "[mie] context alocation failed\n");
+		return -ENOMEM;
+	}
+
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (!res) {
+		dev_err(dev, "[mie] failed to find registers\n");
+		return -ENOENT;
+	}
+
+	ctx->regs = devm_request_and_ioremap(dev, res);
+	if (!ctx->regs) {
+		dev_err(dev, "[mie] failed to map registers\n");
+		return -ENXIO;
+	}
+
+	ctx->configured = false;
+	ctx->enabled = false;
+
+	ctx->plugin.dev = dev;
+	ctx->plugin.ops.fn_dither_enable = mie_dither_enable;
+	ctx->plugin.ops.fn_get_dither_state = mie_get_dither_state;
+	ctx->plugin.ops.fn_configure_dither = mie_configure_dither;
+
+	fimd_add_mie_plugin(&ctx->plugin);
+
+	platform_set_drvdata(pdev, ctx);
+
+	return 0;
+}
+
+static int __devexit mie_remove(struct platform_device *pdev)
+{
+	DRM_DEBUG_KMS(" %s Called\n", __func__);
+	return 0;
+}
+
+static const struct of_device_id mie_dt_match[] = {
+	{
+		.compatible = "samsung,exynos5-mie",
+	},
+	{},
+};
+
+MODULE_DEVICE_TABLE(of, mie_dt_match);
+
+struct platform_device_id mie_driver_ids[] = {
+	{
+		.name = "exynos5-mie",
+	},
+	{},
+};
+
+MODULE_DEVICE_TABLE(platform, exynos_drm_driver_ids);
+
+struct platform_driver mie_driver = {
+	.probe = mie_probe,
+	.remove = __devexit_p(mie_remove),
+	.id_table = mie_driver_ids,
+	.driver = {
+		.name = "exynos-drm-mie",
+		.owner = THIS_MODULE,
+		.of_match_table = of_match_ptr(mie_dt_match),
+	},
+};
+
+module_platform_driver(mie_driver);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("R. Chandrasekar <rcsekar@samsung.com>");
+MODULE_DESCRIPTION("Samsung Mobile Image Enhancement Driver");
diff --git a/drivers/gpu/drm/exynos/exynos_drm_mie.h b/drivers/gpu/drm/exynos/exynos_drm_mie.h
new file mode 100644
index 0000000..f6eaad8
--- /dev/null
+++ b/drivers/gpu/drm/exynos/exynos_drm_mie.h
@@ -0,0 +1,50 @@
+/* exynos_drm_mie.h
+ *
+ * Copyright (C) 2012 Samsung Electronics Co.Ltd
+ * Authors:
+ *	R. Chandrasekar <rcsekar@samsung.com>
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ *
+ */
+
+#ifndef __EXYNOS_DRM_MIE_H
+#define __EXYNOS_DRM_MIE_H
+
+#define MIE_DITHER_EN 1
+
+enum en_dither_mode {
+	DITHER_6BIT,
+	DITHER_8BIT,
+
+	INVALID_DITHER_MODE
+};
+
+struct mie_settings {
+	u32 xres;
+	u32 yres;
+	u32 left_margin;
+	u32 right_margin;
+	u32 upper_margin;
+	u32 lower_margin;
+	u32 hsync_len;
+	u32 vsync_len;
+	enum en_dither_mode dither_mode;
+};
+
+struct mie_plugin_ops {
+	int (*fn_dither_enable)(struct device *dev, bool enable);
+	int (*fn_get_dither_state)(struct device *dev, bool *is_enabled);
+	int (*fn_configure_dither)(struct device *dev,
+		struct mie_settings *settings);
+};
+
+struct mie_plugin {
+	struct device *dev;
+	struct mie_plugin_ops ops;
+};
+
+#endif /*__EXYNOS_DRM_MIE_H */
diff --git a/drivers/gpu/drm/exynos/exynos_regs-mie.h b/drivers/gpu/drm/exynos/exynos_regs-mie.h
new file mode 100644
index 0000000..6b3dba2
--- /dev/null
+++ b/drivers/gpu/drm/exynos/exynos_regs-mie.h
@@ -0,0 +1,75 @@
+/* exynos_regs-mie.h
+ *
+ * Copyright (C) 2012 Samsung Electronics Co.Ltd
+ * Authors:
+ *	R. Chandrasekar <rcsekar@samsung.com>
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ *
+ */
+
+#ifndef __EXYNOS_REGS_MIE_H
+#define __EXYNOS_REGS_MIE_H
+
+#define MIE_MAX_BRIGHTNESS_CNT_REGS 0x30	/* Max Brightness registers */
+#define MIE_BRIGTNESS_REG1_OFFSET 0x100		/* Brightness register set1 */
+#define MIE_BRIGTNESS_REG2_OFFSET 0x200		/* Brightness register set1 */
+
+/* MIE registers */
+
+#define MIE_CTRL1			0x0	/* MIE Control Register 1 */
+#define MIE_HRESOL_SHIFT		18
+#define MIE_HRESOL(x)			((x & 0xfff) << MIE_HRESOL_SHIFT)
+#define MIE_VRESOL_SHIFT		7
+#define MIE_VRESOL(x)			((x & 0x7ff) << MIE_VRESOL_SHIFT)
+#define MIE_MODE_UI			(1 << 5)
+
+/* Specifies Horizontal window position */
+#define MIE_WINHADDR			0x10
+#define MIE_WINHADDR0_SHIFT		0
+#define MIE_WINHADDR1_SHIFT		20
+#define MIE_WINHADDR0(x)		((x & 0xfff) << MIE_WINHADDR0_SHIFT)
+#define MIE_WINHADDR1(x)		(((x-1) & 0xfff)\
+						<< MIE_WINHADDR1_SHIFT)
+
+/* Specifies Vertical window position */
+#define MIE_WINVADDR			0x14
+#define MIE_WINVADDR0_SHIFT		0
+#define MIE_WINVADDR1_SHIFT		21
+#define MIE_WINVADDR0(x)		((x & 0x7ff) << MIE_WINVADDR0_SHIFT)
+#define MIE_WINVADDR1(x)		(((x - 1) & 0x7ff)\
+						<< MIE_WINVADDR1_SHIFT)
+
+/* PWM Clock Count Register */
+#define MIE_PWMCLKCNT			0x20
+#define MIE_PWMCLKVAL			1
+#define PWMCLKCNT(x)			((x & 0x3fffff) << 4)
+
+/* PWM Control Register 1 */
+#define MIE_PWMVIDTCON1			0x38
+#define MIE_VBPD(x)			((x - 1) << 16)
+#define MIE_VFPD(x)			((x - 1) << 8)
+#define MIE_VSPW(x)			(x - 1)
+
+/* PWM Control Register 2 */
+#define MIE_PWMVIDTCON2			0x3c
+#define MIE_HBPD(x)			((x - 1) << 16)
+#define MIE_HFPD(x)			((x - 1) << 8)
+#define MIE_HSPW(x)			(x - 1)
+
+/* AUX Control Register */
+#define MIE_AUXCON			0x300
+#define MIE_DITHCON			1
+#define MIE_DITHCON_EN			0x1
+#define MIE_DITHCON_DISABLE		0
+
+#define MIE_RGBMODE			2
+#define MIE_RGBMODE_SHIFT		1
+#define MIE_RGB6MODE			(0 << MIE_RGBMODE_SHIFT)
+#define MIE_RGB8MODE			(1 << MIE_RGBMODE_SHIFT)
+
+#endif /* __EXYNOS_REGS_MIE_H */
+
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/3] add mie driver for exynos
  2012-12-06 12:08 [PATCH 0/3] add mie driver for exynos R. Chandrasekar
                   ` (2 preceding siblings ...)
  2012-12-06 12:08 ` [PATCH 3/3] drm: mie: add mie driver for exynos R. Chandrasekar
@ 2012-12-10  6:26 ` Inki Dae
  2012-12-10  7:45   ` Stéphane Marchesin
  3 siblings, 1 reply; 11+ messages in thread
From: Inki Dae @ 2012-12-10  6:26 UTC (permalink / raw)
  To: R. Chandrasekar
  Cc: kgene.kim, devicetree-discuss, joshi, dri-devel, kyungmin.park,
	linux-samsung-soc, rcsekar.samsung


[-- Attachment #1.1: Type: text/plain, Size: 2117 bytes --]

2012/12/6 R. Chandrasekar <rcsekar@samsung.com>

> From: "R. Chandrasekar" <rcsekar@samsung.com>
>
> this patch set adds the driver support for the dithering functionality of
> the
> mobile image enhancement (mie) module.
>
> device tree support is added for mie.
>
> fimd adds the mie module as plugin and calls the dithering function.
> dithere is
> required when the panels bpp is less then fimd output.
>
> though mie mie has other functionalities, current system uses only
> dithereing.
>
>
Please, move mie module into drivers/video/exynos. The mie is a interface
between fimd and lcd panel(or mipi-dsi, eDP) to enhance image to be
displayed. And it seems like that this doesn't need drm framework-relevant
interfaces, such as gem.

And also, please refer to the below link, Common Display Framework, for
more generic way.

http://lists.freedesktop.org/archives/dri-devel/2012-November/030888.html

Thanks,
Inki Dae


> R. Chandrasekar (3):
>   DTS: exynos: add device tree support for exynos mie
>   drm: fimd: add mie plugin support for dithering
>   drm: mie: add mie driver for exynos
>
>  arch/arm/boot/dts/exynos5250.dtsi               |    7 +-
>  drivers/gpu/drm/exynos/Kconfig                  |    7 +
>  drivers/gpu/drm/exynos/Makefile                 |    1 +
>  drivers/gpu/drm/exynos/exynos_drm_fimd.c        |   58 +++++-
>  drivers/gpu/drm/exynos/exynos_drm_fimd_common.h |   20 ++
>  drivers/gpu/drm/exynos/exynos_drm_mie.c         |  250
> +++++++++++++++++++++++
>  drivers/gpu/drm/exynos/exynos_drm_mie.h         |   50 +++++
>  drivers/gpu/drm/exynos/exynos_regs-mie.h        |   75 +++++++
>  8 files changed, 465 insertions(+), 3 deletions(-)
>  create mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimd_common.h
>  create mode 100644 drivers/gpu/drm/exynos/exynos_drm_mie.c
>  create mode 100644 drivers/gpu/drm/exynos/exynos_drm_mie.h
>  create mode 100644 drivers/gpu/drm/exynos/exynos_regs-mie.h
>
> --
> 1.7.9.5
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>

[-- Attachment #1.2: Type: text/html, Size: 2983 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/3] add mie driver for exynos
  2012-12-10  6:26 ` [PATCH 0/3] " Inki Dae
@ 2012-12-10  7:45   ` Stéphane Marchesin
  2012-12-10  9:27     ` Inki Dae
  0 siblings, 1 reply; 11+ messages in thread
From: Stéphane Marchesin @ 2012-12-10  7:45 UTC (permalink / raw)
  To: Inki Dae
  Cc: R. Chandrasekar, kgene.kim, devicetree-discuss, joshi, dri-devel,
	kyungmin.park, linux-samsung-soc, rcsekar.samsung

On Sun, Dec 9, 2012 at 10:26 PM, Inki Dae <inki.dae@samsung.com> wrote:
>
>
> 2012/12/6 R. Chandrasekar <rcsekar@samsung.com>
>
>> From: "R. Chandrasekar" <rcsekar@samsung.com>
>>
>> this patch set adds the driver support for the dithering functionality of
>> the
>> mobile image enhancement (mie) module.
>>
>> device tree support is added for mie.
>>
>> fimd adds the mie module as plugin and calls the dithering function.
>> dithere is
>> required when the panels bpp is less then fimd output.
>>
>> though mie mie has other functionalities, current system uses only
>> dithereing.
>>
>
> Please, move mie module into drivers/video/exynos. The mie is a interface
> between fimd and lcd panel(or mipi-dsi, eDP) to enhance image to be
> displayed. And it seems like that this doesn't need drm framework-relevant
> interfaces, such as gem.

Well, if you want to support it from the DRM, it should live in
drivers/gpu/drm, and I don't think you should add another platform
driver in the first place. The profusion of platform drivers in exynos
makes it really difficult to support suspend/resume and initialization
properly as many devices which operate separately need to sync through
global variables.

Stéphane


>
> And also, please refer to the below link, Common Display Framework, for more
> generic way.
>
> http://lists.freedesktop.org/archives/dri-devel/2012-November/030888.html
>
> Thanks,
> Inki Dae
>
>>
>> R. Chandrasekar (3):
>>   DTS: exynos: add device tree support for exynos mie
>>   drm: fimd: add mie plugin support for dithering
>>   drm: mie: add mie driver for exynos
>>
>>  arch/arm/boot/dts/exynos5250.dtsi               |    7 +-
>>  drivers/gpu/drm/exynos/Kconfig                  |    7 +
>>  drivers/gpu/drm/exynos/Makefile                 |    1 +
>>  drivers/gpu/drm/exynos/exynos_drm_fimd.c        |   58 +++++-
>>  drivers/gpu/drm/exynos/exynos_drm_fimd_common.h |   20 ++
>>  drivers/gpu/drm/exynos/exynos_drm_mie.c         |  250
>> +++++++++++++++++++++++
>>  drivers/gpu/drm/exynos/exynos_drm_mie.h         |   50 +++++
>>  drivers/gpu/drm/exynos/exynos_regs-mie.h        |   75 +++++++
>>  8 files changed, 465 insertions(+), 3 deletions(-)
>>  create mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimd_common.h
>>  create mode 100644 drivers/gpu/drm/exynos/exynos_drm_mie.c
>>  create mode 100644 drivers/gpu/drm/exynos/exynos_drm_mie.h
>>  create mode 100644 drivers/gpu/drm/exynos/exynos_regs-mie.h
>>
>> --
>> 1.7.9.5
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/3] add mie driver for exynos
  2012-12-10  7:45   ` Stéphane Marchesin
@ 2012-12-10  9:27     ` Inki Dae
  2012-12-11 23:08       ` Stéphane Marchesin
  0 siblings, 1 reply; 11+ messages in thread
From: Inki Dae @ 2012-12-10  9:27 UTC (permalink / raw)
  To: Stéphane Marchesin
  Cc: kgene.kim, R. Chandrasekar, devicetree-discuss, joshi, dri-devel,
	kyungmin.park, linux-samsung-soc, rcsekar.samsung


[-- Attachment #1.1: Type: text/plain, Size: 4053 bytes --]

2012/12/10 Stéphane Marchesin <stephane.marchesin@gmail.com>

> On Sun, Dec 9, 2012 at 10:26 PM, Inki Dae <inki.dae@samsung.com> wrote:
> >
> >
> > 2012/12/6 R. Chandrasekar <rcsekar@samsung.com>
> >
> >> From: "R. Chandrasekar" <rcsekar@samsung.com>
> >>
> >> this patch set adds the driver support for the dithering functionality
> of
> >> the
> >> mobile image enhancement (mie) module.
> >>
> >> device tree support is added for mie.
> >>
> >> fimd adds the mie module as plugin and calls the dithering function.
> >> dithere is
> >> required when the panels bpp is less then fimd output.
> >>
> >> though mie mie has other functionalities, current system uses only
> >> dithereing.
> >>
> >
> > Please, move mie module into drivers/video/exynos. The mie is a interface
> > between fimd and lcd panel(or mipi-dsi, eDP) to enhance image to be
> > displayed. And it seems like that this doesn't need drm
> framework-relevant
> > interfaces, such as gem.
>
> Well, if you want to support it from the DRM, it should live in
> drivers/gpu/drm, and I don't think you should add another platform
> driver in the first place. The profusion of platform drivers in exynos
> makes it really difficult to support suspend/resume and initialization
> properly as many devices which operate separately need to sync through
> global variables.
>
>
MIE could be used by linux framebuffer-based specific driver(s3c-fb) also.
If linux framebuffer-based driver want to use this mie module, should the
mie module be placed in drivers/video coping it? I think it's not good so
it's better way to use this mie module commonly without duplicated codes.
And mipi-dsi and eDP drivers also have their own platform device/driver and
are being used by exynos drm driver or s3c-fb driver. Of course, for some
IPs such as mie between display controller and lcd panel, It seems like
that there should be proper framework or interfaces in drivers/video/exynos
or somewhere so that other frameworks can use it commonly. And drm and
linux framebuffer drivers should call the interfaces.

Thanks,
Inki Dae

Stéphane
>
>
> >
> > And also, please refer to the below link, Common Display Framework, for
> more
> > generic way.
> >
> >
> http://lists.freedesktop.org/archives/dri-devel/2012-November/030888.html
> >
> > Thanks,
> > Inki Dae
> >
> >>
> >> R. Chandrasekar (3):
> >>   DTS: exynos: add device tree support for exynos mie
> >>   drm: fimd: add mie plugin support for dithering
> >>   drm: mie: add mie driver for exynos
> >>
> >>  arch/arm/boot/dts/exynos5250.dtsi               |    7 +-
> >>  drivers/gpu/drm/exynos/Kconfig                  |    7 +
> >>  drivers/gpu/drm/exynos/Makefile                 |    1 +
> >>  drivers/gpu/drm/exynos/exynos_drm_fimd.c        |   58 +++++-
> >>  drivers/gpu/drm/exynos/exynos_drm_fimd_common.h |   20 ++
> >>  drivers/gpu/drm/exynos/exynos_drm_mie.c         |  250
> >> +++++++++++++++++++++++
> >>  drivers/gpu/drm/exynos/exynos_drm_mie.h         |   50 +++++
> >>  drivers/gpu/drm/exynos/exynos_regs-mie.h        |   75 +++++++
> >>  8 files changed, 465 insertions(+), 3 deletions(-)
> >>  create mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimd_common.h
> >>  create mode 100644 drivers/gpu/drm/exynos/exynos_drm_mie.c
> >>  create mode 100644 drivers/gpu/drm/exynos/exynos_drm_mie.h
> >>  create mode 100644 drivers/gpu/drm/exynos/exynos_regs-mie.h
> >>
> >> --
> >> 1.7.9.5
> >>
> >> _______________________________________________
> >> dri-devel mailing list
> >> dri-devel@lists.freedesktop.org
> >> http://lists.freedesktop.org/mailman/listinfo/dri-devel
> >
> >
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/dri-devel
> >
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>

[-- Attachment #1.2: Type: text/html, Size: 5811 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/3] add mie driver for exynos
  2012-12-10  9:27     ` Inki Dae
@ 2012-12-11 23:08       ` Stéphane Marchesin
  2012-12-12  4:01         ` Inki Dae
  0 siblings, 1 reply; 11+ messages in thread
From: Stéphane Marchesin @ 2012-12-11 23:08 UTC (permalink / raw)
  To: Inki Dae
  Cc: kgene.kim, R. Chandrasekar, devicetree-discuss, joshi, dri-devel,
	kyungmin.park, linux-samsung-soc, rcsekar.samsung

On Mon, Dec 10, 2012 at 1:27 AM, Inki Dae <inki.dae@samsung.com> wrote:
>
>
> 2012/12/10 Stéphane Marchesin <stephane.marchesin@gmail.com>
>>
>> On Sun, Dec 9, 2012 at 10:26 PM, Inki Dae <inki.dae@samsung.com> wrote:
>> >
>> >
>> > 2012/12/6 R. Chandrasekar <rcsekar@samsung.com>
>> >
>> >> From: "R. Chandrasekar" <rcsekar@samsung.com>
>> >>
>> >> this patch set adds the driver support for the dithering functionality
>> >> of
>> >> the
>> >> mobile image enhancement (mie) module.
>> >>
>> >> device tree support is added for mie.
>> >>
>> >> fimd adds the mie module as plugin and calls the dithering function.
>> >> dithere is
>> >> required when the panels bpp is less then fimd output.
>> >>
>> >> though mie mie has other functionalities, current system uses only
>> >> dithereing.
>> >>
>> >
>> > Please, move mie module into drivers/video/exynos. The mie is a
>> > interface
>> > between fimd and lcd panel(or mipi-dsi, eDP) to enhance image to be
>> > displayed. And it seems like that this doesn't need drm
>> > framework-relevant
>> > interfaces, such as gem.
>>
>> Well, if you want to support it from the DRM, it should live in
>> drivers/gpu/drm, and I don't think you should add another platform
>> driver in the first place. The profusion of platform drivers in exynos
>> makes it really difficult to support suspend/resume and initialization
>> properly as many devices which operate separately need to sync through
>> global variables.
>>
>
> MIE could be used by linux framebuffer-based specific driver(s3c-fb) also.

Yes, but it is a DRM driver we're talking about here. Again it is
really difficult to work with it across suspend-resume. I don't think
the DRM was ever meant to be a collection of independent platform
drivers.

> If linux framebuffer-based driver want to use this mie module, should the
> mie module be placed in drivers/video coping it? I think it's not good so
> it's better way to use this mie module commonly without duplicated codes.
> And mipi-dsi and eDP drivers also have their own platform device/driver and
> are being used by exynos drm driver or s3c-fb driver. Of course, for some
> IPs such as mie between display controller and lcd panel, It seems like that
> there should be proper framework or interfaces in drivers/video/exynos or
> somewhere so that other frameworks can use it commonly. And drm and linux
> framebuffer drivers should call the interfaces.

For the short term, I think it's fine to duplicate the code.

For the longer term, I think framebuffer support should be provided by
the drm framebuffer compat layer, and s3c-fb should disappear. This is
what has been done with all the other DRM drivers.

Stéphane


>
> Thanks,
> Inki Dae
>
>> Stéphane
>>
>>
>> >
>> > And also, please refer to the below link, Common Display Framework, for
>> > more
>> > generic way.
>> >
>> >
>> > http://lists.freedesktop.org/archives/dri-devel/2012-November/030888.html
>> >
>> > Thanks,
>> > Inki Dae
>> >
>> >>
>> >> R. Chandrasekar (3):
>> >>   DTS: exynos: add device tree support for exynos mie
>> >>   drm: fimd: add mie plugin support for dithering
>> >>   drm: mie: add mie driver for exynos
>> >>
>> >>  arch/arm/boot/dts/exynos5250.dtsi               |    7 +-
>> >>  drivers/gpu/drm/exynos/Kconfig                  |    7 +
>> >>  drivers/gpu/drm/exynos/Makefile                 |    1 +
>> >>  drivers/gpu/drm/exynos/exynos_drm_fimd.c        |   58 +++++-
>> >>  drivers/gpu/drm/exynos/exynos_drm_fimd_common.h |   20 ++
>> >>  drivers/gpu/drm/exynos/exynos_drm_mie.c         |  250
>> >> +++++++++++++++++++++++
>> >>  drivers/gpu/drm/exynos/exynos_drm_mie.h         |   50 +++++
>> >>  drivers/gpu/drm/exynos/exynos_regs-mie.h        |   75 +++++++
>> >>  8 files changed, 465 insertions(+), 3 deletions(-)
>> >>  create mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimd_common.h
>> >>  create mode 100644 drivers/gpu/drm/exynos/exynos_drm_mie.c
>> >>  create mode 100644 drivers/gpu/drm/exynos/exynos_drm_mie.h
>> >>  create mode 100644 drivers/gpu/drm/exynos/exynos_regs-mie.h
>> >>
>> >> --
>> >> 1.7.9.5
>> >>
>> >> _______________________________________________
>> >> dri-devel mailing list
>> >> dri-devel@lists.freedesktop.org
>> >> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>> >
>> >
>> >
>> > _______________________________________________
>> > dri-devel mailing list
>> > dri-devel@lists.freedesktop.org
>> > http://lists.freedesktop.org/mailman/listinfo/dri-devel
>> >
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/3] add mie driver for exynos
  2012-12-11 23:08       ` Stéphane Marchesin
@ 2012-12-12  4:01         ` Inki Dae
  2012-12-17 18:59           ` Stéphane Marchesin
  0 siblings, 1 reply; 11+ messages in thread
From: Inki Dae @ 2012-12-12  4:01 UTC (permalink / raw)
  To: Stéphane Marchesin
  Cc: kgene.kim, R. Chandrasekar, devicetree-discuss, joshi, dri-devel,
	kyungmin.park, linux-samsung-soc, rcsekar.samsung


[-- Attachment #1.1: Type: text/plain, Size: 6118 bytes --]

2012/12/12 Stéphane Marchesin <stephane.marchesin@gmail.com>

> On Mon, Dec 10, 2012 at 1:27 AM, Inki Dae <inki.dae@samsung.com> wrote:
> >
> >
> > 2012/12/10 Stéphane Marchesin <stephane.marchesin@gmail.com>
> >>
> >> On Sun, Dec 9, 2012 at 10:26 PM, Inki Dae <inki.dae@samsung.com> wrote:
> >> >
> >> >
> >> > 2012/12/6 R. Chandrasekar <rcsekar@samsung.com>
> >> >
> >> >> From: "R. Chandrasekar" <rcsekar@samsung.com>
> >> >>
> >> >> this patch set adds the driver support for the dithering
> functionality
> >> >> of
> >> >> the
> >> >> mobile image enhancement (mie) module.
> >> >>
> >> >> device tree support is added for mie.
> >> >>
> >> >> fimd adds the mie module as plugin and calls the dithering function.
> >> >> dithere is
> >> >> required when the panels bpp is less then fimd output.
> >> >>
> >> >> though mie mie has other functionalities, current system uses only
> >> >> dithereing.
> >> >>
> >> >
> >> > Please, move mie module into drivers/video/exynos. The mie is a
> >> > interface
> >> > between fimd and lcd panel(or mipi-dsi, eDP) to enhance image to be
> >> > displayed. And it seems like that this doesn't need drm
> >> > framework-relevant
> >> > interfaces, such as gem.
> >>
> >> Well, if you want to support it from the DRM, it should live in
> >> drivers/gpu/drm, and I don't think you should add another platform
> >> driver in the first place. The profusion of platform drivers in exynos
> >> makes it really difficult to support suspend/resume and initialization
> >> properly as many devices which operate separately need to sync through
> >> global variables.
> >>
> >
> > MIE could be used by linux framebuffer-based specific driver(s3c-fb)
> also.
>
> Yes, but it is a DRM driver we're talking about here. Again it is
> really difficult to work with it across suspend-resume. I don't think
>

You want to use Exynos drm core framework just for suspend/resume to MIE
module? as I mentioned before, I think the framework suitable to MIE is
Common Display Framework. Of course, maybe you should add new features to
Common Display Framework for it like MIPI DBI bus support framework because
current Common Display Framework supports only display bus. Logically, MIE
should be used without dependency of any frameworks such as Linux
Framebuffer or DRM frameworks. And see the below hardware path,

fimd--------mie-----------------------------lcd panel
fimd--------mie--------mipi-dsi----------lcd panel
fimd--------mie--------eDP---------------lcd panel

Thus, the MIE is placed between fimd and lcd panel, mipi dsi or eDP. And
fimd, as display controller, could be controlled by linux framebuffer or
drm framework.


> the DRM was ever meant to be a collection of independent platform
> drivers.
>

> > If linux framebuffer-based driver want to use this mie module, should the
> > mie module be placed in drivers/video coping it? I think it's not good so
> > it's better way to use this mie module commonly without duplicated codes.
> > And mipi-dsi and eDP drivers also have their own platform device/driver
> and
> > are being used by exynos drm driver or s3c-fb driver. Of course, for some
> > IPs such as mie between display controller and lcd panel, It seems like
> that
> > there should be proper framework or interfaces in drivers/video/exynos or
> > somewhere so that other frameworks can use it commonly. And drm and linux
> > framebuffer drivers should call the interfaces.
>
> For the short term, I think it's fine to duplicate the code.
>
> For the longer term, I think framebuffer support should be provided by
> the drm framebuffer compat layer, and s3c-fb should disappear. This is
> what has been done with all the other DRM drivers.
>
> Stéphane
>
>
> >
> > Thanks,
> > Inki Dae
> >
> >> Stéphane
> >>
> >>
> >> >
> >> > And also, please refer to the below link, Common Display Framework,
> for
> >> > more
> >> > generic way.
> >> >
> >> >
> >> >
> http://lists.freedesktop.org/archives/dri-devel/2012-November/030888.html
> >> >
> >> > Thanks,
> >> > Inki Dae
> >> >
> >> >>
> >> >> R. Chandrasekar (3):
> >> >>   DTS: exynos: add device tree support for exynos mie
> >> >>   drm: fimd: add mie plugin support for dithering
> >> >>   drm: mie: add mie driver for exynos
> >> >>
> >> >>  arch/arm/boot/dts/exynos5250.dtsi               |    7 +-
> >> >>  drivers/gpu/drm/exynos/Kconfig                  |    7 +
> >> >>  drivers/gpu/drm/exynos/Makefile                 |    1 +
> >> >>  drivers/gpu/drm/exynos/exynos_drm_fimd.c        |   58 +++++-
> >> >>  drivers/gpu/drm/exynos/exynos_drm_fimd_common.h |   20 ++
> >> >>  drivers/gpu/drm/exynos/exynos_drm_mie.c         |  250
> >> >> +++++++++++++++++++++++
> >> >>  drivers/gpu/drm/exynos/exynos_drm_mie.h         |   50 +++++
> >> >>  drivers/gpu/drm/exynos/exynos_regs-mie.h        |   75 +++++++
> >> >>  8 files changed, 465 insertions(+), 3 deletions(-)
> >> >>  create mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimd_common.h
> >> >>  create mode 100644 drivers/gpu/drm/exynos/exynos_drm_mie.c
> >> >>  create mode 100644 drivers/gpu/drm/exynos/exynos_drm_mie.h
> >> >>  create mode 100644 drivers/gpu/drm/exynos/exynos_regs-mie.h
> >> >>
> >> >> --
> >> >> 1.7.9.5
> >> >>
> >> >> _______________________________________________
> >> >> dri-devel mailing list
> >> >> dri-devel@lists.freedesktop.org
> >> >> http://lists.freedesktop.org/mailman/listinfo/dri-devel
> >> >
> >> >
> >> >
> >> > _______________________________________________
> >> > dri-devel mailing list
> >> > dri-devel@lists.freedesktop.org
> >> > http://lists.freedesktop.org/mailman/listinfo/dri-devel
> >> >
> >> _______________________________________________
> >> dri-devel mailing list
> >> dri-devel@lists.freedesktop.org
> >> http://lists.freedesktop.org/mailman/listinfo/dri-devel
> >
> >
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>

[-- Attachment #1.2: Type: text/html, Size: 8949 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/3] add mie driver for exynos
  2012-12-12  4:01         ` Inki Dae
@ 2012-12-17 18:59           ` Stéphane Marchesin
  2012-12-17 20:07             ` Daniel Vetter
  0 siblings, 1 reply; 11+ messages in thread
From: Stéphane Marchesin @ 2012-12-17 18:59 UTC (permalink / raw)
  To: Inki Dae
  Cc: kgene.kim, R. Chandrasekar, devicetree-discuss, joshi, dri-devel,
	kyungmin.park, linux-samsung-soc, rcsekar.samsung

On Tue, Dec 11, 2012 at 8:01 PM, Inki Dae <inki.dae@samsung.com> wrote:
>
>
> 2012/12/12 Stéphane Marchesin <stephane.marchesin@gmail.com>
>>
>> On Mon, Dec 10, 2012 at 1:27 AM, Inki Dae <inki.dae@samsung.com> wrote:
>> >
>> >
>> > 2012/12/10 Stéphane Marchesin <stephane.marchesin@gmail.com>
>> >>
>> >> On Sun, Dec 9, 2012 at 10:26 PM, Inki Dae <inki.dae@samsung.com> wrote:
>> >> >
>> >> >
>> >> > 2012/12/6 R. Chandrasekar <rcsekar@samsung.com>
>> >> >
>> >> >> From: "R. Chandrasekar" <rcsekar@samsung.com>
>> >> >>
>> >> >> this patch set adds the driver support for the dithering
>> >> >> functionality
>> >> >> of
>> >> >> the
>> >> >> mobile image enhancement (mie) module.
>> >> >>
>> >> >> device tree support is added for mie.
>> >> >>
>> >> >> fimd adds the mie module as plugin and calls the dithering function.
>> >> >> dithere is
>> >> >> required when the panels bpp is less then fimd output.
>> >> >>
>> >> >> though mie mie has other functionalities, current system uses only
>> >> >> dithereing.
>> >> >>
>> >> >
>> >> > Please, move mie module into drivers/video/exynos. The mie is a
>> >> > interface
>> >> > between fimd and lcd panel(or mipi-dsi, eDP) to enhance image to be
>> >> > displayed. And it seems like that this doesn't need drm
>> >> > framework-relevant
>> >> > interfaces, such as gem.
>> >>
>> >> Well, if you want to support it from the DRM, it should live in
>> >> drivers/gpu/drm, and I don't think you should add another platform
>> >> driver in the first place. The profusion of platform drivers in exynos
>> >> makes it really difficult to support suspend/resume and initialization
>> >> properly as many devices which operate separately need to sync through
>> >> global variables.
>> >>
>> >
>> > MIE could be used by linux framebuffer-based specific driver(s3c-fb)
>> > also.
>>
>> Yes, but it is a DRM driver we're talking about here. Again it is
>> really difficult to work with it across suspend-resume. I don't think
>
>
> You want to use Exynos drm core framework just for suspend/resume to MIE
> module? as I mentioned before, I think the framework suitable to MIE is
> Common Display Framework. Of course, maybe you should add new features to
> Common Display Framework for it like MIPI DBI bus support framework because
> current Common Display Framework supports only display bus. Logically, MIE
> should be used without dependency of any frameworks such as Linux
> Framebuffer or DRM frameworks. And see the below hardware path,
>
> fimd--------mie-----------------------------lcd panel
> fimd--------mie--------mipi-dsi----------lcd panel
> fimd--------mie--------eDP---------------lcd panel
>
> Thus, the MIE is placed between fimd and lcd panel, mipi dsi or eDP.

But for example the MIE only affects one of the layers. So your
drawing doesn't match reality. You'd need to pass a layer number
somehow which the API doesn't seem to allow...

> And
> fimd, as display controller, could be controlled by linux framebuffer or drm
> framework.
>

I don't think it's a valid point. If the framebuffer is properly done
on top of the DRM, you don't need all of that at all.

Stéphane


>>
>> the DRM was ever meant to be a collection of independent platform
>> drivers.
>>
>>
>> > If linux framebuffer-based driver want to use this mie module, should
>> > the
>> > mie module be placed in drivers/video coping it? I think it's not good
>> > so
>> > it's better way to use this mie module commonly without duplicated
>> > codes.
>> > And mipi-dsi and eDP drivers also have their own platform device/driver
>> > and
>> > are being used by exynos drm driver or s3c-fb driver. Of course, for
>> > some
>> > IPs such as mie between display controller and lcd panel, It seems like
>> > that
>> > there should be proper framework or interfaces in drivers/video/exynos
>> > or
>> > somewhere so that other frameworks can use it commonly. And drm and
>> > linux
>> > framebuffer drivers should call the interfaces.
>>
>> For the short term, I think it's fine to duplicate the code.
>>
>> For the longer term, I think framebuffer support should be provided by
>> the drm framebuffer compat layer, and s3c-fb should disappear. This is
>> what has been done with all the other DRM drivers.
>>
>> Stéphane
>>
>>
>> >
>> > Thanks,
>> > Inki Dae
>> >
>> >> Stéphane
>> >>
>> >>
>> >> >
>> >> > And also, please refer to the below link, Common Display Framework,
>> >> > for
>> >> > more
>> >> > generic way.
>> >> >
>> >> >
>> >> >
>> >> > http://lists.freedesktop.org/archives/dri-devel/2012-November/030888.html
>> >> >
>> >> > Thanks,
>> >> > Inki Dae
>> >> >
>> >> >>
>> >> >> R. Chandrasekar (3):
>> >> >>   DTS: exynos: add device tree support for exynos mie
>> >> >>   drm: fimd: add mie plugin support for dithering
>> >> >>   drm: mie: add mie driver for exynos
>> >> >>
>> >> >>  arch/arm/boot/dts/exynos5250.dtsi               |    7 +-
>> >> >>  drivers/gpu/drm/exynos/Kconfig                  |    7 +
>> >> >>  drivers/gpu/drm/exynos/Makefile                 |    1 +
>> >> >>  drivers/gpu/drm/exynos/exynos_drm_fimd.c        |   58 +++++-
>> >> >>  drivers/gpu/drm/exynos/exynos_drm_fimd_common.h |   20 ++
>> >> >>  drivers/gpu/drm/exynos/exynos_drm_mie.c         |  250
>> >> >> +++++++++++++++++++++++
>> >> >>  drivers/gpu/drm/exynos/exynos_drm_mie.h         |   50 +++++
>> >> >>  drivers/gpu/drm/exynos/exynos_regs-mie.h        |   75 +++++++
>> >> >>  8 files changed, 465 insertions(+), 3 deletions(-)
>> >> >>  create mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimd_common.h
>> >> >>  create mode 100644 drivers/gpu/drm/exynos/exynos_drm_mie.c
>> >> >>  create mode 100644 drivers/gpu/drm/exynos/exynos_drm_mie.h
>> >> >>  create mode 100644 drivers/gpu/drm/exynos/exynos_regs-mie.h
>> >> >>
>> >> >> --
>> >> >> 1.7.9.5
>> >> >>
>> >> >> _______________________________________________
>> >> >> dri-devel mailing list
>> >> >> dri-devel@lists.freedesktop.org
>> >> >> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>> >> >
>> >> >
>> >> >
>> >> > _______________________________________________
>> >> > dri-devel mailing list
>> >> > dri-devel@lists.freedesktop.org
>> >> > http://lists.freedesktop.org/mailman/listinfo/dri-devel
>> >> >
>> >> _______________________________________________
>> >> dri-devel mailing list
>> >> dri-devel@lists.freedesktop.org
>> >> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>> >
>> >
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/3] add mie driver for exynos
  2012-12-17 18:59           ` Stéphane Marchesin
@ 2012-12-17 20:07             ` Daniel Vetter
  0 siblings, 0 replies; 11+ messages in thread
From: Daniel Vetter @ 2012-12-17 20:07 UTC (permalink / raw)
  To: Stéphane Marchesin
  Cc: Inki Dae, kgene.kim, R. Chandrasekar, devicetree-discuss, joshi,
	dri-devel, kyungmin.park, linux-samsung-soc, rcsekar.samsung

On Mon, Dec 17, 2012 at 7:59 PM, Stéphane Marchesin
<stephane.marchesin@gmail.com> wrote:
>
>> And
>> fimd, as display controller, could be controlled by linux framebuffer or drm
>> framework.
>>
>
> I don't think it's a valid point. If the framebuffer is properly done
> on top of the DRM, you don't need all of that at all.

Imo for hw with full-fledge drm kms drivers the sanest option for
traditional fbdev support is to pimp the fb helpers a bit. Pretty much
the only thing left that a real fbdev driver can do afaics is fb
reallocation - it shouldn't be too hard to (optionally) implement this
in the helpers ...
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-12-17 20:07 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-06 12:08 [PATCH 0/3] add mie driver for exynos R. Chandrasekar
2012-12-06 12:08 ` [PATCH 1/3] DTS: exynos: add device tree support for exynos mie R. Chandrasekar
2012-12-06 12:08 ` [PATCH 2/3] drm: fimd: add mie plugin support for dithering R. Chandrasekar
2012-12-06 12:08 ` [PATCH 3/3] drm: mie: add mie driver for exynos R. Chandrasekar
2012-12-10  6:26 ` [PATCH 0/3] " Inki Dae
2012-12-10  7:45   ` Stéphane Marchesin
2012-12-10  9:27     ` Inki Dae
2012-12-11 23:08       ` Stéphane Marchesin
2012-12-12  4:01         ` Inki Dae
2012-12-17 18:59           ` Stéphane Marchesin
2012-12-17 20:07             ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).