diff mbox

drm: don't add inferred modes for monitors that don't support them

Message ID 1360942587-3621-1-git-send-email-przanoni@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Paulo Zanoni Feb. 15, 2013, 3:36 p.m. UTC
From: Paulo Zanoni <paulo.r.zanoni@intel.com>

If bit 0 of the features byte (0x18) is set to 0, then, according to
the EDID spec, "the display is non-continuous frequency (multi-mode)
and is only specified to accept the video timing formats that are
listed in Base EDID and certain Extension Blocks".

For more information, please see the EDID spec, check the notes of the
table that explains the "Feature Support" byte (18h) and also the
notes on the tables of the section that explains "Display Range Limits
& Additional Timing Description Definition (tag #FDh)".

Cc: Adam Jackson <ajax@redhat.com>
Cc: stable@vger.kernel.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45729
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/drm_edid.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

I still need to ask some specific people to test the patch, but I
believe it is correct.

Comments

Alex Deucher Feb. 15, 2013, 3:55 p.m. UTC | #1
On Fri, Feb 15, 2013 at 10:36 AM, Paulo Zanoni <przanoni@gmail.com> wrote:
> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
>
> If bit 0 of the features byte (0x18) is set to 0, then, according to
> the EDID spec, "the display is non-continuous frequency (multi-mode)
> and is only specified to accept the video timing formats that are
> listed in Base EDID and certain Extension Blocks".
>
> For more information, please see the EDID spec, check the notes of the
> table that explains the "Feature Support" byte (18h) and also the
> notes on the tables of the section that explains "Display Range Limits
> & Additional Timing Description Definition (tag #FDh)".
>
> Cc: Adam Jackson <ajax@redhat.com>
> Cc: stable@vger.kernel.org
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45729
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>

I fixed this same bug years ago in the X server in the pre-KMS days.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/drm_edid.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> I still need to ask some specific people to test the patch, but I
> believe it is correct.
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index a3a3b61..6a003b6 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -2053,7 +2053,8 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
>         num_modes += add_cvt_modes(connector, edid);
>         num_modes += add_standard_modes(connector, edid);
>         num_modes += add_established_modes(connector, edid);
> -       num_modes += add_inferred_modes(connector, edid);
> +       if (edid->features & DRM_EDID_FEATURE_DEFAULT_GTF)
> +               num_modes += add_inferred_modes(connector, edid);
>         num_modes += add_cea_modes(connector, edid);
>
>         if (quirks & (EDID_QUIRK_PREFER_LARGE_60 | EDID_QUIRK_PREFER_LARGE_75))
> --
> 1.7.10.4
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
Adam Jackson Feb. 15, 2013, 5:27 p.m. UTC | #2
On Fri, 2013-02-15 at 13:36 -0200, Paulo Zanoni wrote:
> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> 
> If bit 0 of the features byte (0x18) is set to 0, then, according to
> the EDID spec, "the display is non-continuous frequency (multi-mode)
> and is only specified to accept the video timing formats that are
> listed in Base EDID and certain Extension Blocks".
> 
> For more information, please see the EDID spec, check the notes of the
> table that explains the "Feature Support" byte (18h) and also the
> notes on the tables of the section that explains "Display Range Limits
> & Additional Timing Description Definition (tag #FDh)".

Seems sane.

Reviewed-by: Adam Jackson <ajax@redhat.com>

- ajax
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index a3a3b61..6a003b6 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -2053,7 +2053,8 @@  int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
 	num_modes += add_cvt_modes(connector, edid);
 	num_modes += add_standard_modes(connector, edid);
 	num_modes += add_established_modes(connector, edid);
-	num_modes += add_inferred_modes(connector, edid);
+	if (edid->features & DRM_EDID_FEATURE_DEFAULT_GTF)
+		num_modes += add_inferred_modes(connector, edid);
 	num_modes += add_cea_modes(connector, edid);
 
 	if (quirks & (EDID_QUIRK_PREFER_LARGE_60 | EDID_QUIRK_PREFER_LARGE_75))