From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 1/9] drm/edid: don't modify EDID while parsing
Date: Fri, 25 Mar 2022 14:40:57 +0200 [thread overview]
Message-ID: <Yj24Wb9oinu+AhHI@intel.com> (raw)
In-Reply-To: <aafe62385024e5975b811a90a0906d4b52058785.1648210803.git.jani.nikula@intel.com>
On Fri, Mar 25, 2022 at 02:25:23PM +0200, Jani Nikula wrote:
> We'll want to keep the EDID immutable while parsing. Stop modifying the
> EDID because of the quirks.
>
> In theory, this does have userspace implications, but the userspace is
> supposed to use the modes exposed via KMS API, not by parsing the EDID
> directly.
>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/drm_edid.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index cc7bd58369df..1b552fe54f38 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -2740,9 +2740,9 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev,
> return NULL;
>
> if (quirks & EDID_QUIRK_135_CLOCK_TOO_HIGH)
> - timing->pixel_clock = cpu_to_le16(1088);
> -
> - mode->clock = le16_to_cpu(timing->pixel_clock) * 10;
> + mode->clock = 1088 * 10;
> + else
> + mode->clock = le16_to_cpu(timing->pixel_clock) * 10;
>
> mode->hdisplay = hactive;
> mode->hsync_start = mode->hdisplay + hsync_offset;
> @@ -2763,14 +2763,14 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev,
> drm_mode_do_interlace_quirk(mode, pt);
>
> if (quirks & EDID_QUIRK_DETAILED_SYNC_PP) {
> - pt->misc |= DRM_EDID_PT_HSYNC_POSITIVE | DRM_EDID_PT_VSYNC_POSITIVE;
> + mode->flags |= DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC;
> + } else {
> + mode->flags |= (pt->misc & DRM_EDID_PT_HSYNC_POSITIVE) ?
> + DRM_MODE_FLAG_PHSYNC : DRM_MODE_FLAG_NHSYNC;
> + mode->flags |= (pt->misc & DRM_EDID_PT_VSYNC_POSITIVE) ?
> + DRM_MODE_FLAG_PVSYNC : DRM_MODE_FLAG_NVSYNC;
> }
>
> - mode->flags |= (pt->misc & DRM_EDID_PT_HSYNC_POSITIVE) ?
> - DRM_MODE_FLAG_PHSYNC : DRM_MODE_FLAG_NHSYNC;
> - mode->flags |= (pt->misc & DRM_EDID_PT_VSYNC_POSITIVE) ?
> - DRM_MODE_FLAG_PVSYNC : DRM_MODE_FLAG_NVSYNC;
> -
> set_size:
> mode->width_mm = pt->width_mm_lo | (pt->width_height_mm_hi & 0xf0) << 4;
> mode->height_mm = pt->height_mm_lo | (pt->width_height_mm_hi & 0xf) << 8;
> --
> 2.30.2
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2022-03-25 12:41 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-25 12:25 [Intel-gfx] [PATCH 0/9] drm/edid: constify EDID parsing Jani Nikula
2022-03-25 12:25 ` [Intel-gfx] [PATCH 1/9] drm/edid: don't modify EDID while parsing Jani Nikula
2022-03-25 12:40 ` Ville Syrjälä [this message]
2022-03-25 12:25 ` [Intel-gfx] [PATCH 2/9] drm/edid: pass a timing pointer to is_display_descriptor() Jani Nikula
2022-03-25 12:49 ` Ville Syrjälä
2022-03-25 12:25 ` [Intel-gfx] [PATCH 3/9] drm/edid: use struct detailed_timing member access in is_rb() Jani Nikula
2022-03-25 13:06 ` Ville Syrjälä
2022-03-25 12:25 ` [Intel-gfx] [PATCH 4/9] drm/edid: use struct detailed_timing member access in gtf2 functions Jani Nikula
2022-03-25 12:25 ` [Intel-gfx] [PATCH 5/9] drm/edid: constify struct detailed_timing in lower level parsing Jani Nikula
2022-03-25 12:25 ` [Intel-gfx] [PATCH 6/9] drm/edid: constify struct detailed_timing in parsing callbacks Jani Nikula
2022-03-25 12:25 ` [Intel-gfx] [PATCH 7/9] drm/edid: constify struct edid passed to detailed blocks Jani Nikula
2022-03-25 12:25 ` [Intel-gfx] [PATCH 8/9] drm/edid: constify struct edid passed around in callbacks and closure Jani Nikula
2022-03-25 12:25 ` [Intel-gfx] [PATCH 9/9] drm/edid: add more general struct edid constness in the interfaces Jani Nikula
2022-03-25 13:19 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/edid: constify EDID parsing Patchwork
2022-03-25 13:26 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2022-03-25 13:46 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-03-25 15:54 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
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=Yj24Wb9oinu+AhHI@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@intel.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