From: Jani Nikula <jani.nikula@linux.intel.com>
To: dri-devel@lists.freedesktop.org
Cc: Vitaly Prosyak <vitaly.prosyak@amd.com>
Subject: Re: [PATCH] drm/edid : calculate vsync and hsync from range limits block according to the EDID 1.4
Date: Wed, 04 May 2016 17:31:43 +0300 [thread overview]
Message-ID: <87shxxnbcg.fsf@intel.com> (raw)
In-Reply-To: <1462287925-2668-2-git-send-email-vitaly.prosyak@amd.com>
On Tue, 03 May 2016, Vitaly Prosyak <vitaly.prosyak@amd.com> wrote:
> Do calculation of vsync and hsync from range limits
> EDID block according to the spec. EDID 1.4.
>
> Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
> ---
> drivers/gpu/drm/drm_edid.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 7e49962..601152b 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -1977,11 +1977,11 @@ mode_in_hsync_range(const struct drm_display_mode *mode,
> int hsync, hmin, hmax;
>
> hmin = t[7];
> - if (edid->revision >= 4)
> - hmin += ((t[4] & 0x04) ? 255 : 0);
> + if (edid->revision >= 4 && ((t[4] & 0x0c) == 0x0c))
> + hmin += 255 ;
> hmax = t[8];
> - if (edid->revision >= 4)
> - hmax += ((t[4] & 0x08) ? 255 : 0);
> + if (edid->revision >= 4 && (t[4] & 0x08))
> + hmax += 255;
> hsync = drm_mode_hsync(mode);
>
> return (hsync <= hmax && hsync >= hmin);
> @@ -1994,11 +1994,11 @@ mode_in_vsync_range(const struct drm_display_mode *mode,
> int vsync, vmin, vmax;
>
> vmin = t[5];
> - if (edid->revision >= 4)
> - vmin += ((t[4] & 0x01) ? 255 : 0);
> + if (edid->revision >= 4 && ((t[4] & 0x03) == 0x03))
> + vmin += 255;
> vmax = t[6];
> - if (edid->revision >= 4)
> - vmax += ((t[4] & 0x02) ? 255 : 0);
> + if (edid->revision >= 4 && (t[4] & 0x02))
> + vmax += 255;
Please fix the indentation to use tabs on the lines you change while
you're at it.
BR,
Jani.
> vsync = drm_mode_vrefresh(mode);
>
> return (vsync <= vmax && vsync >= vmin);
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2016-05-04 14:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-03 15:05 [PATCH] drm/edid : cache edid range limits in drm connector Vitaly Prosyak
2016-05-03 15:05 ` [PATCH] drm/edid : calculate vsync and hsync from range limits block according to the EDID 1.4 Vitaly Prosyak
2016-05-03 20:26 ` Daniel Vetter
2016-05-04 13:42 ` Prosyak, Vitaly
2016-05-03 20:26 ` Daniel Vetter
2016-05-04 14:31 ` Jani Nikula [this message]
2016-05-03 20:23 ` [PATCH] drm/edid : cache edid range limits in drm connector Daniel Vetter
2016-05-03 20:45 ` Prosyak, Vitaly
2016-05-03 21:01 ` Prosyak, Vitaly
2016-05-04 7:10 ` Jani Nikula
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=87shxxnbcg.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=vitaly.prosyak@amd.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox