drm/exynos: Add mode_set manager operation

This patch adds a mode_set callback to the manager operations which
sets the crtc's current mode to the manager driver. This will allow the
fimd  driver to set its mode using values from drm, instead of the dt.

Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
This commit is contained in:
Sean Paul 2014-01-30 16:19:18 -05:00 committed by Inki Dae
parent a9c4cd2139
commit cd706aa8df
2 changed files with 7 additions and 0 deletions

View File

@ -115,6 +115,7 @@ exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode,
struct drm_framebuffer *old_fb) struct drm_framebuffer *old_fb)
{ {
struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); 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; struct drm_plane *plane = exynos_crtc->plane;
unsigned int crtc_w; unsigned int crtc_w;
unsigned int crtc_h; 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_w = crtc->fb->width - x;
crtc_h = crtc->fb->height - y; crtc_h = crtc->fb->height - y;
if (manager->ops->mode_set)
manager->ops->mode_set(manager, &crtc->mode);
ret = exynos_plane_mode_set(plane, crtc, crtc->fb, 0, 0, crtc_w, crtc_h, ret = exynos_plane_mode_set(plane, crtc, crtc->fb, 0, 0, crtc_w, crtc_h,
x, y, crtc_w, crtc_h); x, y, crtc_w, crtc_h);
if (ret) if (ret)

View File

@ -184,6 +184,7 @@ struct exynos_drm_display {
* @initialize: initializes the manager with drm_dev * @initialize: initializes the manager with drm_dev
* @remove: cleans up the manager for removal * @remove: cleans up the manager for removal
* @dpms: control device power. * @dpms: control device power.
* @mode_set: set the given mode to the manager
* @commit: set current hw specific display mode to hw. * @commit: set current hw specific display mode to hw.
* @enable_vblank: specific driver callback for enabling vblank interrupt. * @enable_vblank: specific driver callback for enabling vblank interrupt.
* @disable_vblank: specific driver callback for disabling vblank interrupt. * @disable_vblank: specific driver callback for disabling vblank interrupt.
@ -200,6 +201,8 @@ struct exynos_drm_manager_ops {
struct drm_device *drm_dev, int pipe); struct drm_device *drm_dev, int pipe);
void (*remove)(struct exynos_drm_manager *mgr); void (*remove)(struct exynos_drm_manager *mgr);
void (*dpms)(struct exynos_drm_manager *mgr, int mode); void (*dpms)(struct exynos_drm_manager *mgr, int mode);
void (*mode_set)(struct exynos_drm_manager *mgr,
const struct drm_display_mode *mode);
void (*commit)(struct exynos_drm_manager *mgr); void (*commit)(struct exynos_drm_manager *mgr);
int (*enable_vblank)(struct exynos_drm_manager *mgr); int (*enable_vblank)(struct exynos_drm_manager *mgr);
void (*disable_vblank)(struct exynos_drm_manager *mgr); void (*disable_vblank)(struct exynos_drm_manager *mgr);