drm/exynos: Fix fb_videomode <-> drm_mode_modeinfo conversion
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Fri, 9 Mar 2012 00:45:21 +0000 (09:45 +0900)
committerInki Dae <inki.dae@samsung.com>
Thu, 15 Mar 2012 02:39:00 +0000 (11:39 +0900)
commitf7d86075fa6c082f7dc4d289a69162b13d2db924
treea68f7eb304fe47fae54cc6d51715dc1970d1bbba
parent0d8ce3ae37e9bcfacbbc750cabf892fa00bb720e
drm/exynos: Fix fb_videomode <-> drm_mode_modeinfo conversion

The fb_videomode structure stores the front porch and back porch in the
right_margin and left_margin fields respectively. right_margin should
thus be computed with hsync_start - hdisplay, and left_margin with
htotal - hsync_end. The same holds for the vertical direction.

       Active               Front           Sync            Back
       Region               Porch                           Porch
<-------------------><----------------><-------------><---------------->

  //////////////////|
 ////////////////// |
//////////////////  |..................               ..................
                                       _______________

<------ xres -------><- right_margin -><- hsync_len -><- left_margin -->

<---- hdisplay ----->
<------------ hsync_start ------------>
<--------------------- hsync_end -------------------->
<--------------------------------- htotal ----------------------------->

Fix the fb_videomode <-> drm_mode_modeinfo conversion functions
accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
drivers/gpu/drm/exynos/exynos_drm_connector.c