diff mbox

[17/23] drm/exynos: Add mode_set manager operation

Message ID 1381451436-10089-18-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 mode_set callback to the manager operations which
sets the crtc's current mode to the manager driver.

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

Patch

diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
index 517a3b2..576754d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
@@ -115,6 +115,7 @@  exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode,
 			  struct drm_framebuffer *old_fb)
 {
 	struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
+	struct exynos_drm_manager *manager = exynos_crtc->manager;
 	struct drm_plane *plane = exynos_crtc->plane;
 	unsigned int crtc_w;
 	unsigned int crtc_h;
@@ -129,6 +130,9 @@  exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode,
 	crtc_w = crtc->fb->width - x;
 	crtc_h = crtc->fb->height - y;
 
+	if (manager->ops->mode_set)
+		manager->ops->mode_set(manager->ctx, &crtc->mode);
+
 	ret = exynos_plane_mode_set(plane, crtc, crtc->fb, 0, 0, crtc_w, crtc_h,
 				    x, y, crtc_w, crtc_h);
 	if (ret)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index e82234e..3a86473 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_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.
  * @disable_vblank: specific driver callback for disabling vblank interrupt.
@@ -193,6 +194,7 @@  struct exynos_drm_manager_ops {
 	void (*remove)(void *ctx);
 	void (*dpms)(void *ctx, int mode);
 	void (*apply)(void *ctx);
+	void (*mode_set)(void *ctx, const struct drm_display_mode *mode);
 	void (*commit)(void *ctx);
 	int (*enable_vblank)(void *ctx);
 	void (*disable_vblank)(void *ctx);