<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 29, 2013 at 10:04 AM, 김승우 <span dir="ltr"><<a href="mailto:sw0312.kim@samsung.com" target="_blank">sw0312.kim@samsung.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hello Rahul,<br>
<br>
I agree with basic idea of this patch.<br>
<br>
However, to avoid confusion, how do you think about fixing all<br>
check_timing as check_mode and its second parameter as mode including<br>
struct exynos_drm_display_ops?<br>
<br></blockquote><div>Thanks Seung-Woo,<div><br></div><div>I agree with you. After replacment, it will look like:</div></div><div><br></div><div><div><span class="" style="white-space:pre"> </span>int (*check_mode)(struct device *dev, <span style="color:rgb(80,0,80)">struct drm_display_mode *mode</span>);</div>
</div><div><br></div><div>Regards,<br>Rahul Sharma,<br>email to: <a href="mailto:rahul.sharma@samsung.com" target="_blank">rahul.sharma@samsung.com</a><br>Samsung Research India, Bangalore.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Regards,<br>
- Seung-Woo Kim<br>
<div><div class="h5"><br>
On 2013년 04월 26일 23:03, Rahul Sharma wrote:<br>
> Exynos hdmi driver is using drm_display_mode for setting timing values<br>
> for a supported resolution. Conversion to fb_videomode and then comparing<br>
> with the mixer/hdmi/phy limits is not required. Instead, drm_display_mode<br>
> fields cane be directly compared.<br>
><br>
> v2:<br>
> 1) Removed convert_to_video_timing().<br>
> 2) Corrected DRM_DEBUG_KMS to print the resolution properly.<br>
><br>
> Signed-off-by: Rahul Sharma <<a href="mailto:rahul.sharma@samsung.com">rahul.sharma@samsung.com</a>><br>
> ---<br>
> drivers/gpu/drm/exynos/exynos_drm_connector.c | 36 +------------------------<br>
> drivers/gpu/drm/exynos/exynos_drm_hdmi.h | 6 ++---<br>
> drivers/gpu/drm/exynos/exynos_hdmi.c | 15 +++++------<br>
> drivers/gpu/drm/exynos/exynos_mixer.c | 13 ++++-----<br>
> 4 files changed, 18 insertions(+), 52 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.c b/drivers/gpu/drm/exynos/exynos_drm_connector.c<br>
> index 8bcc13a..7259fff 100644<br>
> --- a/drivers/gpu/drm/exynos/exynos_drm_connector.c<br>
> +++ b/drivers/gpu/drm/exynos/exynos_drm_connector.c<br>
> @@ -58,37 +58,6 @@ convert_to_display_mode(struct drm_display_mode *mode,<br>
> mode->flags |= DRM_MODE_FLAG_DBLSCAN;<br>
> }<br>
><br>
> -/* convert drm_display_mode to exynos_video_timings */<br>
> -static inline void<br>
> -convert_to_video_timing(struct fb_videomode *timing,<br>
> - struct drm_display_mode *mode)<br>
> -{<br>
> - DRM_DEBUG_KMS("%s\n", __FILE__);<br>
> -<br>
> - memset(timing, 0, sizeof(*timing));<br>
> -<br>
> - timing->pixclock = mode->clock * 1000;<br>
> - timing->refresh = drm_mode_vrefresh(mode);<br>
> -<br>
> - timing->xres = mode->hdisplay;<br>
> - timing->right_margin = mode->hsync_start - mode->hdisplay;<br>
> - timing->hsync_len = mode->hsync_end - mode->hsync_start;<br>
> - timing->left_margin = mode->htotal - mode->hsync_end;<br>
> -<br>
> - timing->yres = mode->vdisplay;<br>
> - timing->lower_margin = mode->vsync_start - mode->vdisplay;<br>
> - timing->vsync_len = mode->vsync_end - mode->vsync_start;<br>
> - timing->upper_margin = mode->vtotal - mode->vsync_end;<br>
> -<br>
> - if (mode->flags & DRM_MODE_FLAG_INTERLACE)<br>
> - timing->vmode = FB_VMODE_INTERLACED;<br>
> - else<br>
> - timing->vmode = FB_VMODE_NONINTERLACED;<br>
> -<br>
> - if (mode->flags & DRM_MODE_FLAG_DBLSCAN)<br>
> - timing->vmode |= FB_VMODE_DOUBLE;<br>
> -}<br>
> -<br>
> static int exynos_drm_connector_get_modes(struct drm_connector *connector)<br>
> {<br>
> struct exynos_drm_connector *exynos_connector =<br>
> @@ -168,15 +137,12 @@ static int exynos_drm_connector_mode_valid(struct drm_connector *connector,<br>
> to_exynos_connector(connector);<br>
> struct exynos_drm_manager *manager = exynos_connector->manager;<br>
> struct exynos_drm_display_ops *display_ops = manager->display_ops;<br>
> - struct fb_videomode timing;<br>
> int ret = MODE_BAD;<br>
><br>
> DRM_DEBUG_KMS("%s\n", __FILE__);<br>
><br>
> - convert_to_video_timing(&timing, mode);<br>
> -<br>
> if (display_ops && display_ops->check_timing)<br>
> - if (!display_ops->check_timing(manager->dev, (void *)&timing))<br>
> + if (!display_ops->check_timing(manager->dev, (void *)mode))<br>
> ret = MODE_OK;<br>
><br>
> return ret;<br>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.h b/drivers/gpu/drm/exynos/exynos_drm_hdmi.h<br>
> index 6b70944..fd2ff9f 100644<br>
> --- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.h<br>
> +++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.h<br>
> @@ -32,11 +32,11 @@ struct exynos_hdmi_ops {<br>
> bool (*is_connected)(void *ctx);<br>
> struct edid *(*get_edid)(void *ctx,<br>
> struct drm_connector *connector);<br>
> - int (*check_timing)(void *ctx, struct fb_videomode *timing);<br>
> + int (*check_timing)(void *ctx, struct drm_display_mode *mode);<br>
> int (*power_on)(void *ctx, int mode);<br>
><br>
> /* manager */<br>
> - void (*mode_set)(void *ctx, void *mode);<br>
> + void (*mode_set)(void *ctx, struct drm_display_mode *mode);<br>
> void (*get_max_resol)(void *ctx, unsigned int *width,<br>
> unsigned int *height);<br>
> void (*commit)(void *ctx);<br>
> @@ -57,7 +57,7 @@ struct exynos_mixer_ops {<br>
> void (*win_disable)(void *ctx, int zpos);<br>
><br>
> /* display */<br>
> - int (*check_timing)(void *ctx, struct fb_videomode *timing);<br>
> + int (*check_timing)(void *ctx, struct drm_display_mode *mode);<br>
> };<br>
><br>
> void exynos_hdmi_drv_attach(struct exynos_drm_hdmi_context *ctx);<br>
> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c<br>
> index 93b70e9..aeca603 100644<br>
> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c<br>
> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c<br>
> @@ -796,18 +796,17 @@ static int hdmi_find_phy_conf(struct hdmi_context *hdata, u32 pixel_clock)<br>
> return -EINVAL;<br>
> }<br>
><br>
> -static int hdmi_check_timing(void *ctx, struct fb_videomode *timing)<br>
> +static int hdmi_check_timing(void *ctx, struct drm_display_mode *mode)<br>
> {<br>
> struct hdmi_context *hdata = ctx;<br>
> int ret;<br>
><br>
> - DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);<br>
> -<br>
> - DRM_DEBUG_KMS("[%d]x[%d] [%d]Hz [%x]\n", timing->xres,<br>
> - timing->yres, timing->refresh,<br>
> - timing->vmode);<br>
> + DRM_DEBUG_KMS("[WxH@HzI/P at Pixel Clk]: %dx%d@%d%s at %d\n",<br>
> + mode->hdisplay, mode->vdisplay, mode->vrefresh,<br>
> + (mode->flags & DRM_MODE_FLAG_INTERLACE) ? "I" : "P",<br>
> + mode->clock * 1000);<br>
><br>
> - ret = hdmi_find_phy_conf(hdata, timing->pixclock);<br>
> + ret = hdmi_find_phy_conf(hdata, mode->clock * 1000);<br>
> if (ret < 0)<br>
> return ret;<br>
> return 0;<br>
> @@ -1643,7 +1642,7 @@ static void hdmi_v14_mode_set(struct hdmi_context *hdata,<br>
> hdmi_set_reg(tg->tg_3d, 1, 0x0);<br>
> }<br>
><br>
> -static void hdmi_mode_set(void *ctx, void *mode)<br>
> +static void hdmi_mode_set(void *ctx, struct drm_display_mode *mode)<br>
> {<br>
> struct hdmi_context *hdata = ctx;<br>
> struct drm_display_mode *m = mode;<br>
> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c<br>
> index f08e251..67c4fd8 100644<br>
> --- a/drivers/gpu/drm/exynos/exynos_mixer.c<br>
> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c<br>
> @@ -818,17 +818,17 @@ static void mixer_win_disable(void *ctx, int win)<br>
> mixer_ctx->win_data[win].enabled = false;<br>
> }<br>
><br>
> -static int mixer_check_timing(void *ctx, struct fb_videomode *timing)<br>
> +static int mixer_check_timing(void *ctx, struct drm_display_mode *mode)<br>
> {<br>
> u32 w, h;<br>
><br>
> - w = timing->xres;<br>
> - h = timing->yres;<br>
> + w = mode->hdisplay;<br>
> + h = mode->vdisplay;<br>
><br>
> DRM_DEBUG_KMS("%s : xres=%d, yres=%d, refresh=%d, intl=%d\n",<br>
> - __func__, timing->xres, timing->yres,<br>
> - timing->refresh, (timing->vmode &<br>
> - FB_VMODE_INTERLACED) ? true : false);<br>
> + __func__, mode->hdisplay, mode->vdisplay,<br>
> + mode->vrefresh, (mode->flags &<br>
> + DRM_MODE_FLAG_INTERLACE) ? true : false);<br>
><br>
> if ((w >= 464 && w <= 720 && h >= 261 && h <= 576) ||<br>
> (w >= 1024 && w <= 1280 && h >= 576 && h <= 720) ||<br>
> @@ -837,6 +837,7 @@ static int mixer_check_timing(void *ctx, struct fb_videomode *timing)<br>
><br>
> return -EINVAL;<br>
> }<br>
> +<br>
> static void mixer_wait_for_vblank(void *ctx)<br>
> {<br>
> struct mixer_context *mixer_ctx = ctx;<br>
><br>
<br>
--<br>
</div></div>Seung-Woo Kim<br>
Samsung Software R&D Center<br>
--<br>
<br>
_______________________________________________<br>
dri-devel mailing list<br>
<a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/dri-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br></div></div>