diff mbox

[18/23] drm/exynos: Implement mode_fixup manager operation

Message ID 1381451436-10089-19-git-send-email-seanpaul@chromium.org (mailing list archive)
State New, archived
Headers show

Commit Message

Sean Paul Oct. 11, 2013, 12:30 a.m. UTC
This patch adds a new manager callback for mode_fixup and pipes it
through exynos_drm_crtc.

Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
 drivers/gpu/drm/exynos/exynos_drm_crtc.c | 8 +++++++-
 drivers/gpu/drm/exynos/exynos_drm_drv.h  | 3 +++
 2 files changed, 10 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
index 576754d..083e1e3 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
@@ -105,7 +105,13 @@  exynos_drm_crtc_mode_fixup(struct drm_crtc *crtc,
 			    const struct drm_display_mode *mode,
 			    struct drm_display_mode *adjusted_mode)
 {
-	/* drm framework doesn't check NULL */
+	struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
+	struct exynos_drm_manager *manager = exynos_crtc->manager;
+
+	if (manager->ops->mode_fixup)
+		return manager->ops->mode_fixup(manager->ctx, mode,
+				adjusted_mode);
+
 	return true;
 }
 
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index 3a86473..0a956d0 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -178,6 +178,7 @@  struct exynos_drm_display {
  * @remove: cleans up the manager for removal
  * @dpms: control device power.
  * @apply: set timing, vblank and overlay data to registers.
+ * @mode_fixup: fix mode data before applying it
  * @mode_set: set the given mode to the manager
  * @commit: set current hw specific display mode to hw.
  * @enable_vblank: specific driver callback for enabling vblank interrupt.
@@ -194,6 +195,8 @@  struct exynos_drm_manager_ops {
 	void (*remove)(void *ctx);
 	void (*dpms)(void *ctx, int mode);
 	void (*apply)(void *ctx);
+	bool (*mode_fixup)(void *ctx, const struct drm_display_mode *mode,
+				struct drm_display_mode *adjusted_mode);
 	void (*mode_set)(void *ctx, const struct drm_display_mode *mode);
 	void (*commit)(void *ctx);
 	int (*enable_vblank)(void *ctx);