From patchwork Tue Apr 9 09:11:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wang yanqing X-Patchwork-Id: 2415961 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 40557DF25A for ; Tue, 9 Apr 2013 17:03:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 229ADE6161 for ; Tue, 9 Apr 2013 10:03:09 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by gabe.freedesktop.org (Postfix) with ESMTP id 2905DE5CAC for ; Tue, 9 Apr 2013 02:12:11 -0700 (PDT) Received: by mail-pa0-f53.google.com with SMTP id bh4so3707981pad.40 for ; Tue, 09 Apr 2013 02:12:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:cc:subject:message-id:mail-followup-to :mime-version:content-type:content-disposition:user-agent; bh=6VDe7GDnslqqFSba+ANUwrs/EEoD6FSLo7hT5+LkJh0=; b=W3e9wBZwrMFNG4H47KbitTVptsNXV0rTql0d3BezRjw/fsmQpTh3JqQB6erhy9lYW+ 9HuouWXjdIpNf7Lu9hAY5KnCP0cKJ3qY0evqVF9XNz/Huo/a38hjLA6d1/TBEFURU95R tMZeVzfxAFNg2hgwG80nrUdwg7z/KXuUs/8C1NxR2rT5ZKFUZwF0Hz+nMpZQwoiFBmYi JmeB7C4KJE0BYbxSa9QaU+wQynephJaegmFmIWQBNl8ZYw8mtDIyCQMKa9T5//iQBrN/ OTVCwvHlFMpmyH6Tg6G4zLbFO1fmc00kDTbvuhK+xjZURs1EtjGzeWzYOBsolSwMaBDL OEDg== X-Received: by 10.68.253.73 with SMTP id zy9mr1474220pbc.135.1365498730899; Tue, 09 Apr 2013 02:12:10 -0700 (PDT) Received: from udknight.localhost ([27.154.55.226]) by mx.google.com with ESMTPS id wl5sm28704744pac.18.2013.04.09.02.12.03 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Apr 2013 02:12:09 -0700 (PDT) Received: from udknight.localhost (udknight.localhost [127.0.0.1]) by udknight.localhost (8.14.4/8.14.4) with ESMTP id r399BslW030809; Tue, 9 Apr 2013 17:11:54 +0800 Received: (from root@localhost) by udknight.localhost (8.14.4/8.14.4/Submit) id r399Ba2M030798; Tue, 9 Apr 2013 17:11:36 +0800 Date: Tue, 9 Apr 2013 17:11:36 +0800 From: Wang YanQing To: airlied@redhat.com Subject: [PATCH]drm: Re-add DMT modes for monitors back Message-ID: <20130409091136.GA30783@udknight> Mail-Followup-To: Wang YanQing , airlied@redhat.com, paulo.r.zanoni@intel.com, alexander.deucher@amd.com, ajax@redhat.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Mailman-Approved-At: Tue, 09 Apr 2013 10:02:11 -0700 Cc: alexander.deucher@amd.com, paulo.r.zanoni@intel.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Commit 196e077dc165a307efbd9e7569f81bbdbcf18f65 "drm: don't add inferred modes for monitors that don't support them" It remove the call add_inferred_modes when DRM_EDID_FEATURE_DEFAULT_GTF in feature support field is zero, this remove all inferred modes come from GTF or CVT range information, and also remove DMT modes, this make me lost some avaiable modes for my TV. Without this patch I get: Screen 0: minimum 320 x 200, current 2720 x 1024, maximum 32767 x 32767 VGA1 connected 1440x900+0+0 (normal left inverted right x axis y axis) 414mm x 257mm 1440x900 75.0*+ 59.9 1400x1050 60.3 1280x1024 75.0 1280x800 59.8 1152x864 75.0 1280x720 60.0 1024x768 75.1 70.1 60.0 832x624 74.6 800x600 72.2 75.0 60.3 640x480 72.8 75.0 66.7 60.0 720x400 70.1 HDMI1 connected 1280x1024+1440+0 (normal left inverted right x axis y axis) 1600mm x 900mm 1920x1080 60.0 + 50.0 1920x1080i 30.0 25.0 1280x1024 60.0* 1280x720 60.0 50.0 1440x576i 25.0 1024x768 60.0 1440x480i 30.0 800x600 60.3 720x576 50.0 720x480 59.9 640x480 60.0 59.9 DP1 disconnected (normal left inverted right x axis y axis) With this patch I get below: Screen 0: minimum 320 x 200, current 2880 x 900, maximum 32767 x 32767 VGA1 connected 1440x900+0+0 (normal left inverted right x axis y axis) 414mm x 257mm 1440x900 75.0*+ 59.9 1400x1050 60.3 1280x1024 75.0 1280x800 59.8 1152x864 75.0 1280x720 60.0 1024x768 75.1 70.1 60.0 832x624 74.6 800x600 72.2 75.0 60.3 640x480 72.8 75.0 66.7 60.0 720x400 70.1 HDMI1 connected 1440x900+1440+0 (normal left inverted right x axis y axis) 1600mm x 900mm 1440x900 59.9*+ 1920x1080 60.0 + 50.0 1920x1080i 30.0 25.0 1680x1050 59.9 1400x1050 59.9 1280x1024 60.0 1280x960 60.0 1360x768 60.0 1280x800 59.9 1280x768 60.0 1280x720 60.0 50.0 1440x576i 25.0 1024x768 60.0 1440x480i 30.0 800x600 60.3 56.2 720x576 50.0 848x480 60.0 720x480 59.9 640x480 60.0 59.9 DP1 disconnected (normal left inverted right x axis y axis) Signed-off-by: Wang YanQing --- drivers/gpu/drm/drm_edid.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index dfd9ed3..10c2147 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -1182,7 +1182,8 @@ do_inferred_modes(struct detailed_timing *timing, void *c) closure->edid, timing); - if (!version_greater(closure->edid, 1, 1)) + if (!version_greater(closure->edid, 1, 1) || + !(closure->edid->features & DRM_EDID_FEATURE_DEFAULT_GTF)) return; /* GTF not defined yet */ switch (range->flags) { @@ -2022,8 +2023,7 @@ 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); - if (edid->features & DRM_EDID_FEATURE_DEFAULT_GTF) - num_modes += add_inferred_modes(connector, edid); + 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))