All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joonyoung Shim <jy0922.shim@samsung.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Inki Dae <inki.dae@samsung.com>,
	linux-fbdev@vger.kernel.org,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm: exynos: Fix fb_videomode <-> drm_mode_modeinfo conversion
Date: Thu, 08 Mar 2012 13:05:50 +0000	[thread overview]
Message-ID: <4F58AEAE.4080601@samsung.com> (raw)
In-Reply-To: <1331206495-3853-1-git-send-email-laurent.pinchart@ideasonboard.com>

On 03/08/2012 08:34 PM, Laurent Pinchart wrote:
> 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>
> ---
>   drivers/gpu/drm/exynos/exynos_drm_connector.c |   16 ++++++++--------
>   1 files changed, 8 insertions(+), 8 deletions(-)
>
> While trying to understand how the fb_videomode and drm_mode_modeinfo fields
> map to each other, I found what might be a bug in the Exynos DRM driver. Could
> you please check and confirm that my understanding is correct ?

Good catch. You can refer Documentation/fb/framebuffer.txt to know in 
detail.

Acked-by: Joonyoung Shim <jy0922.shim@samsung.com>

Thanks.

> diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.c b/drivers/gpu/drm/exynos/exynos_drm_connector.c
> index d620b07..7bb1dca 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_connector.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_connector.c
> @@ -52,14 +52,14 @@ convert_to_display_mode(struct drm_display_mode *mode,
>   	mode->vrefresh = timing->refresh;
>
>   	mode->hdisplay = timing->xres;
> -	mode->hsync_start = mode->hdisplay + timing->left_margin;
> +	mode->hsync_start = mode->hdisplay + timing->right_margin;
>   	mode->hsync_end = mode->hsync_start + timing->hsync_len;
> -	mode->htotal = mode->hsync_end + timing->right_margin;
> +	mode->htotal = mode->hsync_end + timing->left_margin;
>
>   	mode->vdisplay = timing->yres;
> -	mode->vsync_start = mode->vdisplay + timing->upper_margin;
> +	mode->vsync_start = mode->vdisplay + timing->lower_margin;
>   	mode->vsync_end = mode->vsync_start + timing->vsync_len;
> -	mode->vtotal = mode->vsync_end + timing->lower_margin;
> +	mode->vtotal = mode->vsync_end + timing->upper_margin;
>
>   	if (timing->vmode&  FB_VMODE_INTERLACED)
>   		mode->flags |= DRM_MODE_FLAG_INTERLACE;
> @@ -81,14 +81,14 @@ convert_to_video_timing(struct fb_videomode *timing,
>   	timing->refresh = drm_mode_vrefresh(mode);
>
>   	timing->xres = mode->hdisplay;
> -	timing->left_margin = mode->hsync_start - mode->hdisplay;
> +	timing->right_margin = mode->hsync_start - mode->hdisplay;
>   	timing->hsync_len = mode->hsync_end - mode->hsync_start;
> -	timing->right_margin = mode->htotal - mode->hsync_end;
> +	timing->left_margin = mode->htotal - mode->hsync_end;
>
>   	timing->yres = mode->vdisplay;
> -	timing->upper_margin = mode->vsync_start - mode->vdisplay;
> +	timing->lower_margin = mode->vsync_start - mode->vdisplay;
>   	timing->vsync_len = mode->vsync_end - mode->vsync_start;
> -	timing->lower_margin = mode->vtotal - mode->vsync_end;
> +	timing->upper_margin = mode->vtotal - mode->vsync_end;
>
>   	if (mode->flags&  DRM_MODE_FLAG_INTERLACE)
>   		timing->vmode = FB_VMODE_INTERLACED;


WARNING: multiple messages have this Message-ID (diff)
From: Joonyoung Shim <jy0922.shim@samsung.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Inki Dae <inki.dae@samsung.com>,
	linux-fbdev@vger.kernel.org,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm: exynos: Fix fb_videomode <-> drm_mode_modeinfo conversion
Date: Thu, 08 Mar 2012 22:05:50 +0900	[thread overview]
Message-ID: <4F58AEAE.4080601@samsung.com> (raw)
In-Reply-To: <1331206495-3853-1-git-send-email-laurent.pinchart@ideasonboard.com>

On 03/08/2012 08:34 PM, Laurent Pinchart wrote:
> 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>
> ---
>   drivers/gpu/drm/exynos/exynos_drm_connector.c |   16 ++++++++--------
>   1 files changed, 8 insertions(+), 8 deletions(-)
>
> While trying to understand how the fb_videomode and drm_mode_modeinfo fields
> map to each other, I found what might be a bug in the Exynos DRM driver. Could
> you please check and confirm that my understanding is correct ?

Good catch. You can refer Documentation/fb/framebuffer.txt to know in 
detail.

Acked-by: Joonyoung Shim <jy0922.shim@samsung.com>

Thanks.

> diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.c b/drivers/gpu/drm/exynos/exynos_drm_connector.c
> index d620b07..7bb1dca 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_connector.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_connector.c
> @@ -52,14 +52,14 @@ convert_to_display_mode(struct drm_display_mode *mode,
>   	mode->vrefresh = timing->refresh;
>
>   	mode->hdisplay = timing->xres;
> -	mode->hsync_start = mode->hdisplay + timing->left_margin;
> +	mode->hsync_start = mode->hdisplay + timing->right_margin;
>   	mode->hsync_end = mode->hsync_start + timing->hsync_len;
> -	mode->htotal = mode->hsync_end + timing->right_margin;
> +	mode->htotal = mode->hsync_end + timing->left_margin;
>
>   	mode->vdisplay = timing->yres;
> -	mode->vsync_start = mode->vdisplay + timing->upper_margin;
> +	mode->vsync_start = mode->vdisplay + timing->lower_margin;
>   	mode->vsync_end = mode->vsync_start + timing->vsync_len;
> -	mode->vtotal = mode->vsync_end + timing->lower_margin;
> +	mode->vtotal = mode->vsync_end + timing->upper_margin;
>
>   	if (timing->vmode&  FB_VMODE_INTERLACED)
>   		mode->flags |= DRM_MODE_FLAG_INTERLACE;
> @@ -81,14 +81,14 @@ convert_to_video_timing(struct fb_videomode *timing,
>   	timing->refresh = drm_mode_vrefresh(mode);
>
>   	timing->xres = mode->hdisplay;
> -	timing->left_margin = mode->hsync_start - mode->hdisplay;
> +	timing->right_margin = mode->hsync_start - mode->hdisplay;
>   	timing->hsync_len = mode->hsync_end - mode->hsync_start;
> -	timing->right_margin = mode->htotal - mode->hsync_end;
> +	timing->left_margin = mode->htotal - mode->hsync_end;
>
>   	timing->yres = mode->vdisplay;
> -	timing->upper_margin = mode->vsync_start - mode->vdisplay;
> +	timing->lower_margin = mode->vsync_start - mode->vdisplay;
>   	timing->vsync_len = mode->vsync_end - mode->vsync_start;
> -	timing->lower_margin = mode->vtotal - mode->vsync_end;
> +	timing->upper_margin = mode->vtotal - mode->vsync_end;
>
>   	if (mode->flags&  DRM_MODE_FLAG_INTERLACE)
>   		timing->vmode = FB_VMODE_INTERLACED;

  reply	other threads:[~2012-03-08 13:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-08 11:34 [PATCH] drm: exynos: Fix fb_videomode <-> drm_mode_modeinfo conversion Laurent Pinchart
2012-03-08 11:34 ` Laurent Pinchart
2012-03-08 13:05 ` Joonyoung Shim [this message]
2012-03-08 13:05   ` Joonyoung Shim
2012-03-08 15:31   ` Laurent Pinchart
2012-03-08 15:31     ` Laurent Pinchart
2012-03-08 15:36     ` Sascha Hauer
2012-03-08 15:36       ` Sascha Hauer
2012-03-08 16:57 ` James Simmons
2012-03-08 16:57   ` James Simmons
2012-03-08 18:02   ` Corbin Simpson
2012-03-08 18:02     ` Corbin Simpson
2012-03-08 18:08   ` Laurent Pinchart
2012-03-08 18:08     ` Laurent Pinchart
2012-03-09  0:56 ` Inki Dae
2012-03-09  0:56   ` Inki Dae

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F58AEAE.4080601@samsung.com \
    --to=jy0922.shim@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=inki.dae@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=sw0312.kim@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.