All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] code cleanup patchset of drm/exynos
@ 2012-04-05 10:23 Joonyoung Shim
  2012-04-05 10:23 ` [PATCH 1/4] drm/exynos: remove unnecessary type conversion of hdmi and mixer Joonyoung Shim
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Joonyoung Shim @ 2012-04-05 10:23 UTC (permalink / raw)
  To: dri-devel; +Cc: inki.dae, kyungmin.park, sw0312.kim

Hi.

The most of this patchset is code cleanup. Three patches are for exynos
hdmi driver and mixer driver. And last patch is cleanup for subdrv of
drm/exynos.

The base of this patchset is 62fb376e214d3c1bfdf6fbb77dac162f6da04d7e
commit of git://people.freedesktop.org/~airlied/linux.git drm-fixes
branch.

Thanks.

Joonyoung Shim (4):
      drm/exynos: remove unnecessary type conversion of hdmi and mixer
      drm/exynos: remove unused codes in hdmi and mixer driver
      drm/exynos: fix struct for operation callback functions to driver name
      drm/exynos: fix to pointer manager member of struct exynos_drm_subdrv

 drivers/gpu/drm/exynos/exynos_drm_core.c |   14 ++--
 drivers/gpu/drm/exynos/exynos_drm_drv.h  |   10 ++--
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   20 ++++--
 drivers/gpu/drm/exynos/exynos_drm_hdmi.c |  107 +++++++++++++----------------
 drivers/gpu/drm/exynos/exynos_drm_hdmi.h |   23 +++----
 drivers/gpu/drm/exynos/exynos_drm_vidi.c |   20 ++++--
 drivers/gpu/drm/exynos/exynos_hdmi.c     |   42 ++++++------
 drivers/gpu/drm/exynos/exynos_mixer.c    |   40 +++++------
 8 files changed, 133 insertions(+), 143 deletions(-)

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

* [PATCH 1/4] drm/exynos: remove unnecessary type conversion of hdmi and mixer
  2012-04-05 10:23 [PATCH 0/4] code cleanup patchset of drm/exynos Joonyoung Shim
@ 2012-04-05 10:23 ` Joonyoung Shim
  2012-04-05 10:23 ` [PATCH 2/4] drm/exynos: remove unused codes in hdmi and mixer driver Joonyoung Shim
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Joonyoung Shim @ 2012-04-05 10:23 UTC (permalink / raw)
  To: dri-devel; +Cc: inki.dae, kyungmin.park, sw0312.kim

When the void pointer type variable is assigned to the specific pointer
type variable, don't need to do type conversion.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_hdmi.c  |   22 +++++++++++-----------
 drivers/gpu/drm/exynos/exynos_mixer.c |   12 +++++-------
 2 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 575a8cb..0a71317 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -1194,7 +1194,7 @@ static int hdmi_conf_index(struct hdmi_context *hdata,
 
 static bool hdmi_is_connected(void *ctx)
 {
-	struct hdmi_context *hdata = (struct hdmi_context *)ctx;
+	struct hdmi_context *hdata = ctx;
 	u32 val = hdmi_reg_read(hdata, HDMI_HPD_STATUS);
 
 	if (val)
@@ -1207,7 +1207,7 @@ static int hdmi_get_edid(void *ctx, struct drm_connector *connector,
 				u8 *edid, int len)
 {
 	struct edid *raw_edid;
-	struct hdmi_context *hdata = (struct hdmi_context *)ctx;
+	struct hdmi_context *hdata = ctx;
 
 	DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
 
@@ -1275,7 +1275,7 @@ static int hdmi_v14_check_timing(struct fb_videomode *check_timing)
 
 static int hdmi_check_timing(void *ctx, void *timing)
 {
-	struct hdmi_context *hdata = (struct hdmi_context *)ctx;
+	struct hdmi_context *hdata = ctx;
 	struct fb_videomode *check_timing = timing;
 
 	DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
@@ -1914,7 +1914,7 @@ static void hdmi_mode_fixup(void *ctx, struct drm_connector *connector,
 				struct drm_display_mode *adjusted_mode)
 {
 	struct drm_display_mode *m;
-	struct hdmi_context *hdata = (struct hdmi_context *)ctx;
+	struct hdmi_context *hdata = ctx;
 	int index;
 
 	DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
@@ -1951,7 +1951,7 @@ static void hdmi_mode_fixup(void *ctx, struct drm_connector *connector,
 
 static void hdmi_mode_set(void *ctx, void *mode)
 {
-	struct hdmi_context *hdata = (struct hdmi_context *)ctx;
+	struct hdmi_context *hdata = ctx;
 	int conf_idx;
 
 	DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
@@ -1974,7 +1974,7 @@ static void hdmi_get_max_resol(void *ctx, unsigned int *width,
 
 static void hdmi_commit(void *ctx)
 {
-	struct hdmi_context *hdata = (struct hdmi_context *)ctx;
+	struct hdmi_context *hdata = ctx;
 
 	DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
 
@@ -1985,7 +1985,7 @@ static void hdmi_commit(void *ctx)
 
 static void hdmi_disable(void *ctx)
 {
-	struct hdmi_context *hdata = (struct hdmi_context *)ctx;
+	struct hdmi_context *hdata = ctx;
 
 	DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
 
@@ -2020,7 +2020,7 @@ static void hdmi_hotplug_func(struct work_struct *work)
 static irqreturn_t hdmi_irq_handler(int irq, void *arg)
 {
 	struct exynos_drm_hdmi_context *ctx = arg;
-	struct hdmi_context *hdata = (struct hdmi_context *)ctx->ctx;
+	struct hdmi_context *hdata = ctx->ctx;
 	u32 intc_flag;
 
 	intc_flag = hdmi_reg_read(hdata, HDMI_INTC_FLAG);
@@ -2173,7 +2173,7 @@ static int hdmi_runtime_suspend(struct device *dev)
 
 	DRM_DEBUG_KMS("%s\n", __func__);
 
-	hdmi_resource_poweroff((struct hdmi_context *)ctx->ctx);
+	hdmi_resource_poweroff(ctx->ctx);
 
 	return 0;
 }
@@ -2184,7 +2184,7 @@ static int hdmi_runtime_resume(struct device *dev)
 
 	DRM_DEBUG_KMS("%s\n", __func__);
 
-	hdmi_resource_poweron((struct hdmi_context *)ctx->ctx);
+	hdmi_resource_poweron(ctx->ctx);
 
 	return 0;
 }
@@ -2351,7 +2351,7 @@ err_data:
 static int __devexit hdmi_remove(struct platform_device *pdev)
 {
 	struct exynos_drm_hdmi_context *ctx = platform_get_drvdata(pdev);
-	struct hdmi_context *hdata = (struct hdmi_context *)ctx->ctx;
+	struct hdmi_context *hdata = ctx->ctx;
 
 	DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
 
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index 4d5f41e..495a7af 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -771,8 +771,7 @@ static void mixer_finish_pageflip(struct drm_device *drm_dev, int crtc)
 static irqreturn_t mixer_irq_handler(int irq, void *arg)
 {
 	struct exynos_drm_hdmi_context *drm_hdmi_ctx = arg;
-	struct mixer_context *ctx =
-			(struct mixer_context *)drm_hdmi_ctx->ctx;
+	struct mixer_context *ctx = drm_hdmi_ctx->ctx;
 	struct mixer_resources *res = &ctx->mixer_res;
 	u32 val, val_base;
 
@@ -902,7 +901,7 @@ static int mixer_runtime_resume(struct device *dev)
 
 	DRM_DEBUG_KMS("resume - start\n");
 
-	mixer_resource_poweron((struct mixer_context *)ctx->ctx);
+	mixer_resource_poweron(ctx->ctx);
 
 	return 0;
 }
@@ -913,7 +912,7 @@ static int mixer_runtime_suspend(struct device *dev)
 
 	DRM_DEBUG_KMS("suspend - start\n");
 
-	mixer_resource_poweroff((struct mixer_context *)ctx->ctx);
+	mixer_resource_poweroff(ctx->ctx);
 
 	return 0;
 }
@@ -926,8 +925,7 @@ static const struct dev_pm_ops mixer_pm_ops = {
 static int __devinit mixer_resources_init(struct exynos_drm_hdmi_context *ctx,
 				 struct platform_device *pdev)
 {
-	struct mixer_context *mixer_ctx =
-			(struct mixer_context *)ctx->ctx;
+	struct mixer_context *mixer_ctx = ctx->ctx;
 	struct device *dev = &pdev->dev;
 	struct mixer_resources *mixer_res = &mixer_ctx->mixer_res;
 	struct resource *res;
@@ -1093,7 +1091,7 @@ static int mixer_remove(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct exynos_drm_hdmi_context *drm_hdmi_ctx =
 					platform_get_drvdata(pdev);
-	struct mixer_context *ctx = (struct mixer_context *)drm_hdmi_ctx->ctx;
+	struct mixer_context *ctx = drm_hdmi_ctx->ctx;
 
 	dev_info(dev, "remove successful\n");
 
-- 
1.7.5.4

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

* [PATCH 2/4] drm/exynos: remove unused codes in hdmi and mixer driver
  2012-04-05 10:23 [PATCH 0/4] code cleanup patchset of drm/exynos Joonyoung Shim
  2012-04-05 10:23 ` [PATCH 1/4] drm/exynos: remove unnecessary type conversion of hdmi and mixer Joonyoung Shim
@ 2012-04-05 10:23 ` Joonyoung Shim
  2012-04-05 10:38   ` Semwal, Sumit
  2012-04-05 10:23 ` [PATCH 3/4] drm/exynos: fix struct for operation callback functions to driver name Joonyoung Shim
  2012-04-05 10:23 ` [PATCH 4/4] drm/exynos: fix to pointer manager member of struct exynos_drm_subdrv Joonyoung Shim
  3 siblings, 1 reply; 9+ messages in thread
From: Joonyoung Shim @ 2012-04-05 10:23 UTC (permalink / raw)
  To: dri-devel; +Cc: inki.dae, kyungmin.park, sw0312.kim

Some defines and members in struct mixer_context aren't used, remove
them.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_hdmi.c  |    1 -
 drivers/gpu/drm/exynos/exynos_mixer.c |   21 +++++++++------------
 2 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 0a71317..340424f 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -40,7 +40,6 @@
 
 #include "exynos_hdmi.h"
 
-#define HDMI_OVERLAY_NUMBER	3
 #define MAX_WIDTH		1920
 #define MAX_HEIGHT		1080
 #define get_hdmi_context(dev)	platform_get_drvdata(to_platform_device(dev))
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index 495a7af..563092e 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -37,7 +37,8 @@
 #include "exynos_drm_drv.h"
 #include "exynos_drm_hdmi.h"
 
-#define HDMI_OVERLAY_NUMBER	3
+#define MIXER_WIN_NR		3
+#define MIXER_DEFAULT_WIN	0
 
 #define get_mixer_context(dev)	platform_get_drvdata(to_platform_device(dev))
 
@@ -75,16 +76,12 @@ struct mixer_resources {
 };
 
 struct mixer_context {
-	struct fb_videomode	*default_timing;
-	unsigned int		default_win;
-	unsigned int		default_bpp;
 	unsigned int		irq;
 	int			pipe;
 	bool			interlace;
-	bool			vp_enabled;
 
 	struct mixer_resources	mixer_res;
-	struct hdmi_win_data	win_data[HDMI_OVERLAY_NUMBER];
+	struct hdmi_win_data	win_data[MIXER_WIN_NR];
 };
 
 static const u8 filter_y_horiz_tap8[] = {
@@ -643,9 +640,9 @@ static void mixer_win_mode_set(void *ctx,
 
 	win = overlay->zpos;
 	if (win == DEFAULT_ZPOS)
-		win = mixer_ctx->default_win;
+		win = MIXER_DEFAULT_WIN;
 
-	if (win < 0 || win > HDMI_OVERLAY_NUMBER) {
+	if (win < 0 || win > MIXER_WIN_NR) {
 		DRM_ERROR("overlay plane[%d] is wrong\n", win);
 		return;
 	}
@@ -683,9 +680,9 @@ static void mixer_win_commit(void *ctx, int zpos)
 	DRM_DEBUG_KMS("[%d] %s, win: %d\n", __LINE__, __func__, win);
 
 	if (win == DEFAULT_ZPOS)
-		win = mixer_ctx->default_win;
+		win = MIXER_DEFAULT_WIN;
 
-	if (win < 0 || win > HDMI_OVERLAY_NUMBER) {
+	if (win < 0 || win > MIXER_WIN_NR) {
 		DRM_ERROR("overlay plane[%d] is wrong\n", win);
 		return;
 	}
@@ -706,9 +703,9 @@ static void mixer_win_disable(void *ctx, int zpos)
 	DRM_DEBUG_KMS("[%d] %s, win: %d\n", __LINE__, __func__, win);
 
 	if (win == DEFAULT_ZPOS)
-		win = mixer_ctx->default_win;
+		win = MIXER_DEFAULT_WIN;
 
-	if (win < 0 || win > HDMI_OVERLAY_NUMBER) {
+	if (win < 0 || win > MIXER_WIN_NR) {
 		DRM_ERROR("overlay plane[%d] is wrong\n", win);
 		return;
 	}
-- 
1.7.5.4

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

* [PATCH 3/4] drm/exynos: fix struct for operation callback functions to driver name
  2012-04-05 10:23 [PATCH 0/4] code cleanup patchset of drm/exynos Joonyoung Shim
  2012-04-05 10:23 ` [PATCH 1/4] drm/exynos: remove unnecessary type conversion of hdmi and mixer Joonyoung Shim
  2012-04-05 10:23 ` [PATCH 2/4] drm/exynos: remove unused codes in hdmi and mixer driver Joonyoung Shim
@ 2012-04-05 10:23 ` Joonyoung Shim
  2012-04-05 10:23 ` [PATCH 4/4] drm/exynos: fix to pointer manager member of struct exynos_drm_subdrv Joonyoung Shim
  3 siblings, 0 replies; 9+ messages in thread
From: Joonyoung Shim @ 2012-04-05 10:23 UTC (permalink / raw)
  To: dri-devel; +Cc: inki.dae, kyungmin.park, sw0312.kim

The mixer driver and hdmi driver have each operation callback functions
and they is registered to hdmi common driver. Their struct names in hdmi
common driver include display, manager and overlay. It confuses to
appear whose operation and two driver cannot register same operation
callback functions at the same time. Use their struct names to driver
name.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_hdmi.c |   92 +++++++++++++-----------------
 drivers/gpu/drm/exynos/exynos_drm_hdmi.h |   23 +++-----
 drivers/gpu/drm/exynos/exynos_hdmi.c     |   19 +++---
 drivers/gpu/drm/exynos/exynos_mixer.c    |    7 ++-
 4 files changed, 62 insertions(+), 79 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
index 14eb26b..348048b 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
@@ -30,9 +30,8 @@
 					struct drm_hdmi_context, subdrv);
 
 /* these callback points shoud be set by specific drivers. */
-static struct exynos_hdmi_display_ops *hdmi_display_ops;
-static struct exynos_hdmi_manager_ops *hdmi_manager_ops;
-static struct exynos_hdmi_overlay_ops *hdmi_overlay_ops;
+static struct exynos_hdmi_ops *hdmi_ops;
+static struct exynos_mixer_ops *mixer_ops;
 
 struct drm_hdmi_context {
 	struct exynos_drm_subdrv	subdrv;
@@ -40,31 +39,20 @@ struct drm_hdmi_context {
 	struct exynos_drm_hdmi_context	*mixer_ctx;
 };
 
-void exynos_drm_display_ops_register(struct exynos_hdmi_display_ops
-					*display_ops)
+void exynos_hdmi_ops_register(struct exynos_hdmi_ops *ops)
 {
 	DRM_DEBUG_KMS("%s\n", __FILE__);
 
-	if (display_ops)
-		hdmi_display_ops = display_ops;
+	if (ops)
+		hdmi_ops = ops;
 }
 
-void exynos_drm_manager_ops_register(struct exynos_hdmi_manager_ops
-					*manager_ops)
+void exynos_mixer_ops_register(struct exynos_mixer_ops *ops)
 {
 	DRM_DEBUG_KMS("%s\n", __FILE__);
 
-	if (manager_ops)
-		hdmi_manager_ops = manager_ops;
-}
-
-void exynos_drm_overlay_ops_register(struct exynos_hdmi_overlay_ops
-					*overlay_ops)
-{
-	DRM_DEBUG_KMS("%s\n", __FILE__);
-
-	if (overlay_ops)
-		hdmi_overlay_ops = overlay_ops;
+	if (ops)
+		mixer_ops = ops;
 }
 
 static bool drm_hdmi_is_connected(struct device *dev)
@@ -73,8 +61,8 @@ static bool drm_hdmi_is_connected(struct device *dev)
 
 	DRM_DEBUG_KMS("%s\n", __FILE__);
 
-	if (hdmi_display_ops && hdmi_display_ops->is_connected)
-		return hdmi_display_ops->is_connected(ctx->hdmi_ctx->ctx);
+	if (hdmi_ops && hdmi_ops->is_connected)
+		return hdmi_ops->is_connected(ctx->hdmi_ctx->ctx);
 
 	return false;
 }
@@ -86,9 +74,9 @@ static int drm_hdmi_get_edid(struct device *dev,
 
 	DRM_DEBUG_KMS("%s\n", __FILE__);
 
-	if (hdmi_display_ops && hdmi_display_ops->get_edid)
-		return hdmi_display_ops->get_edid(ctx->hdmi_ctx->ctx,
-				connector, edid, len);
+	if (hdmi_ops && hdmi_ops->get_edid)
+		return hdmi_ops->get_edid(ctx->hdmi_ctx->ctx, connector, edid,
+					  len);
 
 	return 0;
 }
@@ -99,9 +87,8 @@ static int drm_hdmi_check_timing(struct device *dev, void *timing)
 
 	DRM_DEBUG_KMS("%s\n", __FILE__);
 
-	if (hdmi_display_ops && hdmi_display_ops->check_timing)
-		return hdmi_display_ops->check_timing(ctx->hdmi_ctx->ctx,
-				timing);
+	if (hdmi_ops && hdmi_ops->check_timing)
+		return hdmi_ops->check_timing(ctx->hdmi_ctx->ctx, timing);
 
 	return 0;
 }
@@ -112,8 +99,8 @@ static int drm_hdmi_power_on(struct device *dev, int mode)
 
 	DRM_DEBUG_KMS("%s\n", __FILE__);
 
-	if (hdmi_display_ops && hdmi_display_ops->power_on)
-		return hdmi_display_ops->power_on(ctx->hdmi_ctx->ctx, mode);
+	if (hdmi_ops && hdmi_ops->power_on)
+		return hdmi_ops->power_on(ctx->hdmi_ctx->ctx, mode);
 
 	return 0;
 }
@@ -134,9 +121,9 @@ static int drm_hdmi_enable_vblank(struct device *subdrv_dev)
 
 	DRM_DEBUG_KMS("%s\n", __FILE__);
 
-	if (hdmi_overlay_ops && hdmi_overlay_ops->enable_vblank)
-		return hdmi_overlay_ops->enable_vblank(ctx->mixer_ctx->ctx,
-							manager->pipe);
+	if (mixer_ops && mixer_ops->enable_vblank)
+		return mixer_ops->enable_vblank(ctx->mixer_ctx->ctx,
+						manager->pipe);
 
 	return 0;
 }
@@ -147,8 +134,8 @@ static void drm_hdmi_disable_vblank(struct device *subdrv_dev)
 
 	DRM_DEBUG_KMS("%s\n", __FILE__);
 
-	if (hdmi_overlay_ops && hdmi_overlay_ops->disable_vblank)
-		return hdmi_overlay_ops->disable_vblank(ctx->mixer_ctx->ctx);
+	if (mixer_ops && mixer_ops->disable_vblank)
+		return mixer_ops->disable_vblank(ctx->mixer_ctx->ctx);
 }
 
 static void drm_hdmi_mode_fixup(struct device *subdrv_dev,
@@ -160,9 +147,9 @@ static void drm_hdmi_mode_fixup(struct device *subdrv_dev,
 
 	DRM_DEBUG_KMS("%s\n", __FILE__);
 
-	if (hdmi_manager_ops && hdmi_manager_ops->mode_fixup)
-		hdmi_manager_ops->mode_fixup(ctx->hdmi_ctx->ctx, connector,
-						mode, adjusted_mode);
+	if (hdmi_ops && hdmi_ops->mode_fixup)
+		hdmi_ops->mode_fixup(ctx->hdmi_ctx->ctx, connector, mode,
+				     adjusted_mode);
 }
 
 static void drm_hdmi_mode_set(struct device *subdrv_dev, void *mode)
@@ -171,8 +158,8 @@ static void drm_hdmi_mode_set(struct device *subdrv_dev, void *mode)
 
 	DRM_DEBUG_KMS("%s\n", __FILE__);
 
-	if (hdmi_manager_ops && hdmi_manager_ops->mode_set)
-		hdmi_manager_ops->mode_set(ctx->hdmi_ctx->ctx, mode);
+	if (hdmi_ops && hdmi_ops->mode_set)
+		hdmi_ops->mode_set(ctx->hdmi_ctx->ctx, mode);
 }
 
 static void drm_hdmi_get_max_resol(struct device *subdrv_dev,
@@ -182,9 +169,8 @@ static void drm_hdmi_get_max_resol(struct device *subdrv_dev,
 
 	DRM_DEBUG_KMS("%s\n", __FILE__);
 
-	if (hdmi_manager_ops && hdmi_manager_ops->get_max_resol)
-		hdmi_manager_ops->get_max_resol(ctx->hdmi_ctx->ctx, width,
-							height);
+	if (hdmi_ops && hdmi_ops->get_max_resol)
+		hdmi_ops->get_max_resol(ctx->hdmi_ctx->ctx, width, height);
 }
 
 static void drm_hdmi_commit(struct device *subdrv_dev)
@@ -193,8 +179,8 @@ static void drm_hdmi_commit(struct device *subdrv_dev)
 
 	DRM_DEBUG_KMS("%s\n", __FILE__);
 
-	if (hdmi_manager_ops && hdmi_manager_ops->commit)
-		hdmi_manager_ops->commit(ctx->hdmi_ctx->ctx);
+	if (hdmi_ops && hdmi_ops->commit)
+		hdmi_ops->commit(ctx->hdmi_ctx->ctx);
 }
 
 static void drm_hdmi_dpms(struct device *subdrv_dev, int mode)
@@ -209,8 +195,8 @@ static void drm_hdmi_dpms(struct device *subdrv_dev, int mode)
 	case DRM_MODE_DPMS_STANDBY:
 	case DRM_MODE_DPMS_SUSPEND:
 	case DRM_MODE_DPMS_OFF:
-		if (hdmi_manager_ops && hdmi_manager_ops->disable)
-			hdmi_manager_ops->disable(ctx->hdmi_ctx->ctx);
+		if (hdmi_ops && hdmi_ops->disable)
+			hdmi_ops->disable(ctx->hdmi_ctx->ctx);
 		break;
 	default:
 		DRM_DEBUG_KMS("unkown dps mode: %d\n", mode);
@@ -235,8 +221,8 @@ static void drm_mixer_mode_set(struct device *subdrv_dev,
 
 	DRM_DEBUG_KMS("%s\n", __FILE__);
 
-	if (hdmi_overlay_ops && hdmi_overlay_ops->win_mode_set)
-		hdmi_overlay_ops->win_mode_set(ctx->mixer_ctx->ctx, overlay);
+	if (mixer_ops && mixer_ops->win_mode_set)
+		mixer_ops->win_mode_set(ctx->mixer_ctx->ctx, overlay);
 }
 
 static void drm_mixer_commit(struct device *subdrv_dev, int zpos)
@@ -245,8 +231,8 @@ static void drm_mixer_commit(struct device *subdrv_dev, int zpos)
 
 	DRM_DEBUG_KMS("%s\n", __FILE__);
 
-	if (hdmi_overlay_ops && hdmi_overlay_ops->win_commit)
-		hdmi_overlay_ops->win_commit(ctx->mixer_ctx->ctx, zpos);
+	if (mixer_ops && mixer_ops->win_commit)
+		mixer_ops->win_commit(ctx->mixer_ctx->ctx, zpos);
 }
 
 static void drm_mixer_disable(struct device *subdrv_dev, int zpos)
@@ -255,8 +241,8 @@ static void drm_mixer_disable(struct device *subdrv_dev, int zpos)
 
 	DRM_DEBUG_KMS("%s\n", __FILE__);
 
-	if (hdmi_overlay_ops && hdmi_overlay_ops->win_disable)
-		hdmi_overlay_ops->win_disable(ctx->mixer_ctx->ctx, zpos);
+	if (mixer_ops && mixer_ops->win_disable)
+		mixer_ops->win_disable(ctx->mixer_ctx->ctx, zpos);
 }
 
 static struct exynos_drm_overlay_ops drm_hdmi_overlay_ops = {
diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.h b/drivers/gpu/drm/exynos/exynos_drm_hdmi.h
index 44497cf..f3ae192 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.h
@@ -38,15 +38,15 @@ struct exynos_drm_hdmi_context {
 	void			*ctx;
 };
 
-struct exynos_hdmi_display_ops {
+struct exynos_hdmi_ops {
+	/* display */
 	bool (*is_connected)(void *ctx);
 	int (*get_edid)(void *ctx, struct drm_connector *connector,
 			u8 *edid, int len);
 	int (*check_timing)(void *ctx, void *timing);
 	int (*power_on)(void *ctx, int mode);
-};
 
-struct exynos_hdmi_manager_ops {
+	/* manager */
 	void (*mode_fixup)(void *ctx, struct drm_connector *connector,
 				struct drm_display_mode *mode,
 				struct drm_display_mode *adjusted_mode);
@@ -57,22 +57,17 @@ struct exynos_hdmi_manager_ops {
 	void (*disable)(void *ctx);
 };
 
-struct exynos_hdmi_overlay_ops {
+struct exynos_mixer_ops {
+	/* manager */
 	int (*enable_vblank)(void *ctx, int pipe);
 	void (*disable_vblank)(void *ctx);
+
+	/* overlay */
 	void (*win_mode_set)(void *ctx, struct exynos_drm_overlay *overlay);
 	void (*win_commit)(void *ctx, int zpos);
 	void (*win_disable)(void *ctx, int zpos);
 };
 
-extern struct platform_driver hdmi_driver;
-extern struct platform_driver mixer_driver;
-
-void exynos_drm_display_ops_register(struct exynos_hdmi_display_ops
-					*display_ops);
-void exynos_drm_manager_ops_register(struct exynos_hdmi_manager_ops
-					*manager_ops);
-void exynos_drm_overlay_ops_register(struct exynos_hdmi_overlay_ops
-					*overlay_ops);
-
+void exynos_hdmi_ops_register(struct exynos_hdmi_ops *ops);
+void exynos_mixer_ops_register(struct exynos_mixer_ops *ops);
 #endif
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 340424f..b003538 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -1311,13 +1311,6 @@ static int hdmi_display_power_on(void *ctx, int mode)
 	return 0;
 }
 
-static struct exynos_hdmi_display_ops display_ops = {
-	.is_connected	= hdmi_is_connected,
-	.get_edid	= hdmi_get_edid,
-	.check_timing	= hdmi_check_timing,
-	.power_on	= hdmi_display_power_on,
-};
-
 static void hdmi_set_acr(u32 freq, u8 *acr)
 {
 	u32 n, cts;
@@ -1995,7 +1988,14 @@ static void hdmi_disable(void *ctx)
 	}
 }
 
-static struct exynos_hdmi_manager_ops manager_ops = {
+static struct exynos_hdmi_ops hdmi_ops = {
+	/* display */
+	.is_connected	= hdmi_is_connected,
+	.get_edid	= hdmi_get_edid,
+	.check_timing	= hdmi_check_timing,
+	.power_on	= hdmi_display_power_on,
+
+	/* manager */
 	.mode_fixup	= hdmi_mode_fixup,
 	.mode_set	= hdmi_mode_set,
 	.get_max_resol	= hdmi_get_max_resol,
@@ -2321,8 +2321,7 @@ static int __devinit hdmi_probe(struct platform_device *pdev)
 	hdata->irq = res->start;
 
 	/* register specific callbacks to common hdmi. */
-	exynos_drm_display_ops_register(&display_ops);
-	exynos_drm_manager_ops_register(&manager_ops);
+	exynos_hdmi_ops_register(&hdmi_ops);
 
 	hdmi_resource_poweron(hdata);
 
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index 563092e..e15438c 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -719,9 +719,12 @@ static void mixer_win_disable(void *ctx, int zpos)
 	spin_unlock_irqrestore(&res->reg_slock, flags);
 }
 
-static struct exynos_hdmi_overlay_ops overlay_ops = {
+static struct exynos_mixer_ops mixer_ops = {
+	/* manager */
 	.enable_vblank		= mixer_enable_vblank,
 	.disable_vblank		= mixer_disable_vblank,
+
+	/* overlay */
 	.win_mode_set		= mixer_win_mode_set,
 	.win_commit		= mixer_win_commit,
 	.win_disable		= mixer_win_disable,
@@ -1071,7 +1074,7 @@ static int __devinit mixer_probe(struct platform_device *pdev)
 		goto fail;
 
 	/* register specific callback point to common hdmi. */
-	exynos_drm_overlay_ops_register(&overlay_ops);
+	exynos_mixer_ops_register(&mixer_ops);
 
 	mixer_resource_poweron(ctx);
 
-- 
1.7.5.4

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

* [PATCH 4/4] drm/exynos: fix to pointer manager member of struct exynos_drm_subdrv
  2012-04-05 10:23 [PATCH 0/4] code cleanup patchset of drm/exynos Joonyoung Shim
                   ` (2 preceding siblings ...)
  2012-04-05 10:23 ` [PATCH 3/4] drm/exynos: fix struct for operation callback functions to driver name Joonyoung Shim
@ 2012-04-05 10:23 ` Joonyoung Shim
  3 siblings, 0 replies; 9+ messages in thread
From: Joonyoung Shim @ 2012-04-05 10:23 UTC (permalink / raw)
  To: dri-devel; +Cc: inki.dae, kyungmin.park, sw0312.kim

The struct exynos_drm_manager has to exist for exynos drm sub driver
using encoder and connector. If it isn't NULL to member of struct
exynos_drm_subdrv, will create encoder and connector else will not. And
the is_local member also doesn't need.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_core.c |   14 ++++++++------
 drivers/gpu/drm/exynos/exynos_drm_drv.h  |   10 +++++-----
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   20 ++++++++++++--------
 drivers/gpu/drm/exynos/exynos_drm_hdmi.c |   15 +++++++++------
 drivers/gpu/drm/exynos/exynos_drm_vidi.c |   20 ++++++++++++--------
 5 files changed, 46 insertions(+), 33 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_core.c b/drivers/gpu/drm/exynos/exynos_drm_core.c
index 411832e..eaf630d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_core.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_core.c
@@ -54,16 +54,18 @@ static int exynos_drm_subdrv_probe(struct drm_device *dev,
 		 *
 		 * P.S. note that this driver is considered for modularization.
 		 */
-		ret = subdrv->probe(dev, subdrv->manager.dev);
+		ret = subdrv->probe(dev, subdrv->dev);
 		if (ret)
 			return ret;
 	}
 
-	if (subdrv->is_local)
+	if (!subdrv->manager)
 		return 0;
 
+	subdrv->manager->dev = subdrv->dev;
+
 	/* create and initialize a encoder for this sub driver. */
-	encoder = exynos_drm_encoder_create(dev, &subdrv->manager,
+	encoder = exynos_drm_encoder_create(dev, subdrv->manager,
 			(1 << MAX_CRTC) - 1);
 	if (!encoder) {
 		DRM_ERROR("failed to create encoder\n");
@@ -186,7 +188,7 @@ int exynos_drm_subdrv_open(struct drm_device *dev, struct drm_file *file)
 
 	list_for_each_entry(subdrv, &exynos_drm_subdrv_list, list) {
 		if (subdrv->open) {
-			ret = subdrv->open(dev, subdrv->manager.dev, file);
+			ret = subdrv->open(dev, subdrv->dev, file);
 			if (ret)
 				goto err;
 		}
@@ -197,7 +199,7 @@ int exynos_drm_subdrv_open(struct drm_device *dev, struct drm_file *file)
 err:
 	list_for_each_entry_reverse(subdrv, &subdrv->list, list) {
 		if (subdrv->close)
-			subdrv->close(dev, subdrv->manager.dev, file);
+			subdrv->close(dev, subdrv->dev, file);
 	}
 	return ret;
 }
@@ -209,7 +211,7 @@ void exynos_drm_subdrv_close(struct drm_device *dev, struct drm_file *file)
 
 	list_for_each_entry(subdrv, &exynos_drm_subdrv_list, list) {
 		if (subdrv->close)
-			subdrv->close(dev, subdrv->manager.dev, file);
+			subdrv->close(dev, subdrv->dev, file);
 	}
 }
 EXPORT_SYMBOL_GPL(exynos_drm_subdrv_close);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index fbd0a23..1d81417 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -225,24 +225,25 @@ struct exynos_drm_private {
  * Exynos drm sub driver structure.
  *
  * @list: sub driver has its own list object to register to exynos drm driver.
+ * @dev: pointer to device object for subdrv device driver.
  * @drm_dev: pointer to drm_device and this pointer would be set
  *	when sub driver calls exynos_drm_subdrv_register().
- * @is_local: appear encoder and connector disrelated device.
+ * @manager: subdrv has its own manager to control a hardware appropriately
+ *	and we can access a hardware drawing on this manager.
  * @probe: this callback would be called by exynos drm driver after
  *	subdrv is registered to it.
  * @remove: this callback is used to release resources created
  *	by probe callback.
  * @open: this would be called with drm device file open.
  * @close: this would be called with drm device file close.
- * @manager: subdrv has its own manager to control a hardware appropriately
- *	and we can access a hardware drawing on this manager.
  * @encoder: encoder object owned by this sub driver.
  * @connector: connector object owned by this sub driver.
  */
 struct exynos_drm_subdrv {
 	struct list_head list;
+	struct device *dev;
 	struct drm_device *drm_dev;
-	bool is_local;
+	struct exynos_drm_manager *manager;
 
 	int (*probe)(struct drm_device *drm_dev, struct device *dev);
 	void (*remove)(struct drm_device *dev);
@@ -251,7 +252,6 @@ struct exynos_drm_subdrv {
 	void (*close)(struct drm_device *drm_dev, struct device *dev,
 			struct drm_file *file);
 
-	struct exynos_drm_manager manager;
 	struct drm_encoder *encoder;
 	struct drm_connector *connector;
 };
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index ecb6db2..29fdbfe 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -172,7 +172,7 @@ static void fimd_dpms(struct device *subdrv_dev, int mode)
 static void fimd_apply(struct device *subdrv_dev)
 {
 	struct fimd_context *ctx = get_fimd_context(subdrv_dev);
-	struct exynos_drm_manager *mgr = &ctx->subdrv.manager;
+	struct exynos_drm_manager *mgr = ctx->subdrv.manager;
 	struct exynos_drm_manager_ops *mgr_ops = mgr->ops;
 	struct exynos_drm_overlay_ops *ovl_ops = mgr->overlay_ops;
 	struct fimd_win_data *win_data;
@@ -577,6 +577,13 @@ static struct exynos_drm_overlay_ops fimd_overlay_ops = {
 	.disable = fimd_win_disable,
 };
 
+static struct exynos_drm_manager fimd_manager = {
+	.pipe		= -1,
+	.ops		= &fimd_manager_ops,
+	.overlay_ops	= &fimd_overlay_ops,
+	.display_ops	= &fimd_display_ops,
+};
+
 static void fimd_finish_pageflip(struct drm_device *drm_dev, int crtc)
 {
 	struct exynos_drm_private *dev_priv = drm_dev->dev_private;
@@ -628,7 +635,7 @@ static irqreturn_t fimd_irq_handler(int irq, void *dev_id)
 	struct fimd_context *ctx = (struct fimd_context *)dev_id;
 	struct exynos_drm_subdrv *subdrv = &ctx->subdrv;
 	struct drm_device *drm_dev = subdrv->drm_dev;
-	struct exynos_drm_manager *manager = &subdrv->manager;
+	struct exynos_drm_manager *manager = subdrv->manager;
 	u32 val;
 
 	val = readl(ctx->regs + VIDINTCON1);
@@ -744,7 +751,7 @@ static void fimd_clear_win(struct fimd_context *ctx, int win)
 static int fimd_power_on(struct fimd_context *ctx, bool enable)
 {
 	struct exynos_drm_subdrv *subdrv = &ctx->subdrv;
-	struct device *dev = subdrv->manager.dev;
+	struct device *dev = subdrv->dev;
 
 	DRM_DEBUG_KMS("%s\n", __FILE__);
 
@@ -867,13 +874,10 @@ static int __devinit fimd_probe(struct platform_device *pdev)
 
 	subdrv = &ctx->subdrv;
 
+	subdrv->dev = dev;
+	subdrv->manager = &fimd_manager;
 	subdrv->probe = fimd_subdrv_probe;
 	subdrv->remove = fimd_subdrv_remove;
-	subdrv->manager.pipe = -1;
-	subdrv->manager.ops = &fimd_manager_ops;
-	subdrv->manager.overlay_ops = &fimd_overlay_ops;
-	subdrv->manager.display_ops = &fimd_display_ops;
-	subdrv->manager.dev = dev;
 
 	mutex_init(&ctx->lock);
 
diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
index 348048b..3424463 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
@@ -117,7 +117,7 @@ static int drm_hdmi_enable_vblank(struct device *subdrv_dev)
 {
 	struct drm_hdmi_context *ctx = to_context(subdrv_dev);
 	struct exynos_drm_subdrv *subdrv = &ctx->subdrv;
-	struct exynos_drm_manager *manager = &subdrv->manager;
+	struct exynos_drm_manager *manager = subdrv->manager;
 
 	DRM_DEBUG_KMS("%s\n", __FILE__);
 
@@ -251,6 +251,12 @@ static struct exynos_drm_overlay_ops drm_hdmi_overlay_ops = {
 	.disable = drm_mixer_disable,
 };
 
+static struct exynos_drm_manager hdmi_manager = {
+	.pipe		= -1,
+	.ops		= &drm_hdmi_manager_ops,
+	.overlay_ops	= &drm_hdmi_overlay_ops,
+	.display_ops	= &drm_hdmi_display_ops,
+};
 
 static int hdmi_subdrv_probe(struct drm_device *drm_dev,
 		struct device *dev)
@@ -318,12 +324,9 @@ static int __devinit exynos_drm_hdmi_probe(struct platform_device *pdev)
 
 	subdrv = &ctx->subdrv;
 
+	subdrv->dev = dev;
+	subdrv->manager = &hdmi_manager;
 	subdrv->probe = hdmi_subdrv_probe;
-	subdrv->manager.pipe = -1;
-	subdrv->manager.ops = &drm_hdmi_manager_ops;
-	subdrv->manager.overlay_ops = &drm_hdmi_overlay_ops;
-	subdrv->manager.display_ops = &drm_hdmi_display_ops;
-	subdrv->manager.dev = dev;
 
 	platform_set_drvdata(pdev, subdrv);
 
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
index 8e1339f..7b9c153 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
@@ -199,7 +199,7 @@ static void vidi_dpms(struct device *subdrv_dev, int mode)
 static void vidi_apply(struct device *subdrv_dev)
 {
 	struct vidi_context *ctx = get_vidi_context(subdrv_dev);
-	struct exynos_drm_manager *mgr = &ctx->subdrv.manager;
+	struct exynos_drm_manager *mgr = ctx->subdrv.manager;
 	struct exynos_drm_manager_ops *mgr_ops = mgr->ops;
 	struct exynos_drm_overlay_ops *ovl_ops = mgr->overlay_ops;
 	struct vidi_win_data *win_data;
@@ -374,6 +374,13 @@ static struct exynos_drm_overlay_ops vidi_overlay_ops = {
 	.disable = vidi_win_disable,
 };
 
+static struct exynos_drm_manager vidi_manager = {
+	.pipe		= -1,
+	.ops		= &vidi_manager_ops,
+	.overlay_ops	= &vidi_overlay_ops,
+	.display_ops	= &vidi_display_ops,
+};
+
 static void vidi_finish_pageflip(struct drm_device *drm_dev, int crtc)
 {
 	struct exynos_drm_private *dev_priv = drm_dev->dev_private;
@@ -425,7 +432,7 @@ static void vidi_fake_vblank_handler(struct work_struct *work)
 	struct vidi_context *ctx = container_of(work, struct vidi_context,
 					work);
 	struct exynos_drm_subdrv *subdrv = &ctx->subdrv;
-	struct exynos_drm_manager *manager = &subdrv->manager;
+	struct exynos_drm_manager *manager = subdrv->manager;
 
 	if (manager->pipe < 0)
 		return;
@@ -471,7 +478,7 @@ static void vidi_subdrv_remove(struct drm_device *drm_dev)
 static int vidi_power_on(struct vidi_context *ctx, bool enable)
 {
 	struct exynos_drm_subdrv *subdrv = &ctx->subdrv;
-	struct device *dev = subdrv->manager.dev;
+	struct device *dev = subdrv->dev;
 
 	DRM_DEBUG_KMS("%s\n", __FILE__);
 
@@ -611,13 +618,10 @@ static int __devinit vidi_probe(struct platform_device *pdev)
 	ctx->raw_edid = (struct edid *)fake_edid_info;
 
 	subdrv = &ctx->subdrv;
+	subdrv->dev = dev;
+	subdrv->manager = &vidi_manager;
 	subdrv->probe = vidi_subdrv_probe;
 	subdrv->remove = vidi_subdrv_remove;
-	subdrv->manager.pipe = -1;
-	subdrv->manager.ops = &vidi_manager_ops;
-	subdrv->manager.overlay_ops = &vidi_overlay_ops;
-	subdrv->manager.display_ops = &vidi_display_ops;
-	subdrv->manager.dev = dev;
 
 	mutex_init(&ctx->lock);
 
-- 
1.7.5.4

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

* Re: [PATCH 2/4] drm/exynos: remove unused codes in hdmi and mixer driver
  2012-04-05 10:23 ` [PATCH 2/4] drm/exynos: remove unused codes in hdmi and mixer driver Joonyoung Shim
@ 2012-04-05 10:38   ` Semwal, Sumit
  2012-04-05 10:53     ` Joonyoung Shim
  0 siblings, 1 reply; 9+ messages in thread
From: Semwal, Sumit @ 2012-04-05 10:38 UTC (permalink / raw)
  To: Joonyoung Shim; +Cc: inki.dae, kyungmin.park, sw0312.kim, dri-devel

Hi Joonyoung,

On Thu, Apr 5, 2012 at 3:53 PM, Joonyoung Shim <jy0922.shim@samsung.com> wrote:
> Some defines and members in struct mixer_context aren't used, remove
> them.
>
> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
>  drivers/gpu/drm/exynos/exynos_hdmi.c  |    1 -
>  drivers/gpu/drm/exynos/exynos_mixer.c |   21 +++++++++------------
>  2 files changed, 9 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
> index 0a71317..340424f 100644
> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c
> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
> @@ -40,7 +40,6 @@
>
>  #include "exynos_hdmi.h"
>
> -#define HDMI_OVERLAY_NUMBER    3
>  #define MAX_WIDTH              1920
>  #define MAX_HEIGHT             1080
>  #define get_hdmi_context(dev)  platform_get_drvdata(to_platform_device(dev))
> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
> index 495a7af..563092e 100644
> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
> @@ -37,7 +37,8 @@
>  #include "exynos_drm_drv.h"
>  #include "exynos_drm_hdmi.h"
>
> -#define HDMI_OVERLAY_NUMBER    3
> +#define MIXER_WIN_NR           3
> +#define MIXER_DEFAULT_WIN      0
Patch description says 'remove unused codes...', but looks like you're
adding more codes here? I think you should do the addition / deletion
in separate patches.
>
>  #define get_mixer_context(dev) platform_get_drvdata(to_platform_device(dev))
>
> @@ -75,16 +76,12 @@ struct mixer_resources {
>  };
>
>  struct mixer_context {
> -       struct fb_videomode     *default_timing;
> -       unsigned int            default_win;
> -       unsigned int            default_bpp;
>        unsigned int            irq;
>        int                     pipe;
>        bool                    interlace;
> -       bool                    vp_enabled;
>
>        struct mixer_resources  mixer_res;
> -       struct hdmi_win_data    win_data[HDMI_OVERLAY_NUMBER];
> +       struct hdmi_win_data    win_data[MIXER_WIN_NR];
>  };
>
>  static const u8 filter_y_horiz_tap8[] = {
> @@ -643,9 +640,9 @@ static void mixer_win_mode_set(void *ctx,
>
>        win = overlay->zpos;
>        if (win == DEFAULT_ZPOS)
> -               win = mixer_ctx->default_win;
> +               win = MIXER_DEFAULT_WIN;
>
> -       if (win < 0 || win > HDMI_OVERLAY_NUMBER) {
> +       if (win < 0 || win > MIXER_WIN_NR) {
>                DRM_ERROR("overlay plane[%d] is wrong\n", win);
>                return;
>        }
> @@ -683,9 +680,9 @@ static void mixer_win_commit(void *ctx, int zpos)
>        DRM_DEBUG_KMS("[%d] %s, win: %d\n", __LINE__, __func__, win);
>
>        if (win == DEFAULT_ZPOS)
> -               win = mixer_ctx->default_win;
> +               win = MIXER_DEFAULT_WIN;
>
> -       if (win < 0 || win > HDMI_OVERLAY_NUMBER) {
> +       if (win < 0 || win > MIXER_WIN_NR) {
>                DRM_ERROR("overlay plane[%d] is wrong\n", win);
>                return;
>        }
> @@ -706,9 +703,9 @@ static void mixer_win_disable(void *ctx, int zpos)
>        DRM_DEBUG_KMS("[%d] %s, win: %d\n", __LINE__, __func__, win);
>
>        if (win == DEFAULT_ZPOS)
> -               win = mixer_ctx->default_win;
> +               win = MIXER_DEFAULT_WIN;
>
> -       if (win < 0 || win > HDMI_OVERLAY_NUMBER) {
> +       if (win < 0 || win > MIXER_WIN_NR) {
>                DRM_ERROR("overlay plane[%d] is wrong\n", win);
>                return;
>        }
> --
> 1.7.5.4
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
Best regards,
~Sumit.

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

* Re: [PATCH 2/4] drm/exynos: remove unused codes in hdmi and mixer driver
  2012-04-05 10:38   ` Semwal, Sumit
@ 2012-04-05 10:53     ` Joonyoung Shim
  2012-04-05 11:00       ` Daniel Vetter
  0 siblings, 1 reply; 9+ messages in thread
From: Joonyoung Shim @ 2012-04-05 10:53 UTC (permalink / raw)
  To: Semwal, Sumit; +Cc: inki.dae, kyungmin.park, sw0312.kim, dri-devel

On 04/05/2012 07:38 PM, Semwal, Sumit wrote:
> Hi Joonyoung,
>
> On Thu, Apr 5, 2012 at 3:53 PM, Joonyoung Shim<jy0922.shim@samsung.com>  wrote:
>> Some defines and members in struct mixer_context aren't used, remove
>> them.
>>
>> Signed-off-by: Joonyoung Shim<jy0922.shim@samsung.com>
>> Signed-off-by: Kyungmin Park<kyungmin.park@samsung.com>
>> ---
>>   drivers/gpu/drm/exynos/exynos_hdmi.c  |    1 -
>>   drivers/gpu/drm/exynos/exynos_mixer.c |   21 +++++++++------------
>>   2 files changed, 9 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
>> index 0a71317..340424f 100644
>> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c
>> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
>> @@ -40,7 +40,6 @@
>>
>>   #include "exynos_hdmi.h"
>>
>> -#define HDMI_OVERLAY_NUMBER    3
>>   #define MAX_WIDTH              1920
>>   #define MAX_HEIGHT             1080
>>   #define get_hdmi_context(dev)  platform_get_drvdata(to_platform_device(dev))
>> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
>> index 495a7af..563092e 100644
>> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
>> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
>> @@ -37,7 +37,8 @@
>>   #include "exynos_drm_drv.h"
>>   #include "exynos_drm_hdmi.h"
>>
>> -#define HDMI_OVERLAY_NUMBER    3
>> +#define MIXER_WIN_NR           3
>> +#define MIXER_DEFAULT_WIN      0
> Patch description says 'remove unused codes...', but looks like you're
> adding more codes here? I think you should do the addition / deletion
> in separate patches.

"remove unused codes" is incorrect a bit, but please think this is just code
cleanup to remove unnecessary codes.

Thanks.

>>   #define get_mixer_context(dev) platform_get_drvdata(to_platform_device(dev))
>>
>> @@ -75,16 +76,12 @@ struct mixer_resources {
>>   };
>>
>>   struct mixer_context {
>> -       struct fb_videomode     *default_timing;
>> -       unsigned int            default_win;
>> -       unsigned int            default_bpp;
>>         unsigned int            irq;
>>         int                     pipe;
>>         bool                    interlace;
>> -       bool                    vp_enabled;
>>
>>         struct mixer_resources  mixer_res;
>> -       struct hdmi_win_data    win_data[HDMI_OVERLAY_NUMBER];
>> +       struct hdmi_win_data    win_data[MIXER_WIN_NR];
>>   };
>>
>>   static const u8 filter_y_horiz_tap8[] = {
>> @@ -643,9 +640,9 @@ static void mixer_win_mode_set(void *ctx,
>>
>>         win = overlay->zpos;
>>         if (win == DEFAULT_ZPOS)
>> -               win = mixer_ctx->default_win;
>> +               win = MIXER_DEFAULT_WIN;
>>
>> -       if (win<  0 || win>  HDMI_OVERLAY_NUMBER) {
>> +       if (win<  0 || win>  MIXER_WIN_NR) {
>>                 DRM_ERROR("overlay plane[%d] is wrong\n", win);
>>                 return;
>>         }
>> @@ -683,9 +680,9 @@ static void mixer_win_commit(void *ctx, int zpos)
>>         DRM_DEBUG_KMS("[%d] %s, win: %d\n", __LINE__, __func__, win);
>>
>>         if (win == DEFAULT_ZPOS)
>> -               win = mixer_ctx->default_win;
>> +               win = MIXER_DEFAULT_WIN;
>>
>> -       if (win<  0 || win>  HDMI_OVERLAY_NUMBER) {
>> +       if (win<  0 || win>  MIXER_WIN_NR) {
>>                 DRM_ERROR("overlay plane[%d] is wrong\n", win);
>>                 return;
>>         }
>> @@ -706,9 +703,9 @@ static void mixer_win_disable(void *ctx, int zpos)
>>         DRM_DEBUG_KMS("[%d] %s, win: %d\n", __LINE__, __func__, win);
>>
>>         if (win == DEFAULT_ZPOS)
>> -               win = mixer_ctx->default_win;
>> +               win = MIXER_DEFAULT_WIN;
>>
>> -       if (win<  0 || win>  HDMI_OVERLAY_NUMBER) {
>> +       if (win<  0 || win>  MIXER_WIN_NR) {
>>                 DRM_ERROR("overlay plane[%d] is wrong\n", win);
>>                 return;
>>         }
>> --
>> 1.7.5.4
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
> Best regards,
> ~Sumit.
>

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

* Re: [PATCH 2/4] drm/exynos: remove unused codes in hdmi and mixer driver
  2012-04-05 10:53     ` Joonyoung Shim
@ 2012-04-05 11:00       ` Daniel Vetter
  2012-04-05 11:02         ` Joonyoung Shim
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Vetter @ 2012-04-05 11:00 UTC (permalink / raw)
  To: Joonyoung Shim; +Cc: inki.dae, kyungmin.park, sw0312.kim, dri-devel

On Thu, Apr 05, 2012 at 07:53:43PM +0900, Joonyoung Shim wrote:
> On 04/05/2012 07:38 PM, Semwal, Sumit wrote:
> >Hi Joonyoung,
> >
> >On Thu, Apr 5, 2012 at 3:53 PM, Joonyoung Shim<jy0922.shim@samsung.com>  wrote:
> >>Some defines and members in struct mixer_context aren't used, remove
> >>them.
> >>
> >>Signed-off-by: Joonyoung Shim<jy0922.shim@samsung.com>
> >>Signed-off-by: Kyungmin Park<kyungmin.park@samsung.com>
> >>---
> >>  drivers/gpu/drm/exynos/exynos_hdmi.c  |    1 -
> >>  drivers/gpu/drm/exynos/exynos_mixer.c |   21 +++++++++------------
> >>  2 files changed, 9 insertions(+), 13 deletions(-)
> >>
> >>diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
> >>index 0a71317..340424f 100644
> >>--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
> >>+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
> >>@@ -40,7 +40,6 @@
> >>
> >>  #include "exynos_hdmi.h"
> >>
> >>-#define HDMI_OVERLAY_NUMBER    3
> >>  #define MAX_WIDTH              1920
> >>  #define MAX_HEIGHT             1080
> >>  #define get_hdmi_context(dev)  platform_get_drvdata(to_platform_device(dev))
> >>diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
> >>index 495a7af..563092e 100644
> >>--- a/drivers/gpu/drm/exynos/exynos_mixer.c
> >>+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
> >>@@ -37,7 +37,8 @@
> >>  #include "exynos_drm_drv.h"
> >>  #include "exynos_drm_hdmi.h"
> >>
> >>-#define HDMI_OVERLAY_NUMBER    3
> >>+#define MIXER_WIN_NR           3
> >>+#define MIXER_DEFAULT_WIN      0
> >Patch description says 'remove unused codes...', but looks like you're
> >adding more codes here? I think you should do the addition / deletion
> >in separate patches.
> 
> "remove unused codes" is incorrect a bit, but please think this is just code
> cleanup to remove unnecessary codes.

Commit messages that flat-out lie in this way are bad. You need to at
least mention what additional stuff you're doing in the commit message,
besides removing unused code. Or split the patch up as Sumit suggested.

Cheers, Daniel
-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

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

* Re: [PATCH 2/4] drm/exynos: remove unused codes in hdmi and mixer driver
  2012-04-05 11:00       ` Daniel Vetter
@ 2012-04-05 11:02         ` Joonyoung Shim
  0 siblings, 0 replies; 9+ messages in thread
From: Joonyoung Shim @ 2012-04-05 11:02 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: inki.dae, kyungmin.park, sw0312.kim, dri-devel

On 04/05/2012 08:00 PM, Daniel Vetter wrote:
> On Thu, Apr 05, 2012 at 07:53:43PM +0900, Joonyoung Shim wrote:
>> On 04/05/2012 07:38 PM, Semwal, Sumit wrote:
>>> Hi Joonyoung,
>>>
>>> On Thu, Apr 5, 2012 at 3:53 PM, Joonyoung Shim<jy0922.shim@samsung.com>   wrote:
>>>> Some defines and members in struct mixer_context aren't used, remove
>>>> them.
>>>>
>>>> Signed-off-by: Joonyoung Shim<jy0922.shim@samsung.com>
>>>> Signed-off-by: Kyungmin Park<kyungmin.park@samsung.com>
>>>> ---
>>>>   drivers/gpu/drm/exynos/exynos_hdmi.c  |    1 -
>>>>   drivers/gpu/drm/exynos/exynos_mixer.c |   21 +++++++++------------
>>>>   2 files changed, 9 insertions(+), 13 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
>>>> index 0a71317..340424f 100644
>>>> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c
>>>> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
>>>> @@ -40,7 +40,6 @@
>>>>
>>>>   #include "exynos_hdmi.h"
>>>>
>>>> -#define HDMI_OVERLAY_NUMBER    3
>>>>   #define MAX_WIDTH              1920
>>>>   #define MAX_HEIGHT             1080
>>>>   #define get_hdmi_context(dev)  platform_get_drvdata(to_platform_device(dev))
>>>> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
>>>> index 495a7af..563092e 100644
>>>> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
>>>> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
>>>> @@ -37,7 +37,8 @@
>>>>   #include "exynos_drm_drv.h"
>>>>   #include "exynos_drm_hdmi.h"
>>>>
>>>> -#define HDMI_OVERLAY_NUMBER    3
>>>> +#define MIXER_WIN_NR           3
>>>> +#define MIXER_DEFAULT_WIN      0
>>> Patch description says 'remove unused codes...', but looks like you're
>>> adding more codes here? I think you should do the addition / deletion
>>> in separate patches.
>> "remove unused codes" is incorrect a bit, but please think this is just code
>> cleanup to remove unnecessary codes.
> Commit messages that flat-out lie in this way are bad. You need to at
> least mention what additional stuff you're doing in the commit message,
> besides removing unused code. Or split the patch up as Sumit suggested.
>

OK, i will do it.

Thanks.

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

end of thread, other threads:[~2012-04-05 11:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-05 10:23 [PATCH 0/4] code cleanup patchset of drm/exynos Joonyoung Shim
2012-04-05 10:23 ` [PATCH 1/4] drm/exynos: remove unnecessary type conversion of hdmi and mixer Joonyoung Shim
2012-04-05 10:23 ` [PATCH 2/4] drm/exynos: remove unused codes in hdmi and mixer driver Joonyoung Shim
2012-04-05 10:38   ` Semwal, Sumit
2012-04-05 10:53     ` Joonyoung Shim
2012-04-05 11:00       ` Daniel Vetter
2012-04-05 11:02         ` Joonyoung Shim
2012-04-05 10:23 ` [PATCH 3/4] drm/exynos: fix struct for operation callback functions to driver name Joonyoung Shim
2012-04-05 10:23 ` [PATCH 4/4] drm/exynos: fix to pointer manager member of struct exynos_drm_subdrv Joonyoung Shim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.