From patchwork Wed Dec 2 06:51:19 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhao, Yakui" X-Patchwork-Id: 64160 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nB26qWg3006706 for ; Wed, 2 Dec 2009 06:52:32 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 309219E827; Tue, 1 Dec 2009 22:52:32 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 361619E748 for ; Tue, 1 Dec 2009 22:52:29 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 01 Dec 2009 22:46:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.47,327,1257148800"; d="scan'208";a="751999175" Received: from yakui_zhao.sh.intel.com (HELO localhost.localdomain) ([10.239.13.6]) by fmsmga001.fm.intel.com with ESMTP; 01 Dec 2009 22:52:27 -0800 From: yakui.zhao@intel.com To: cworth@cworth.org, zhenyuw@linux.intel.com Date: Wed, 2 Dec 2009 14:51:19 +0800 Message-Id: <1259736679-28448-1-git-send-email-yakui.zhao@intel.com> X-Mailer: git-send-email 1.5.4.5 Cc: intel-gfx@lists.freedesktop.org Subject: [Intel-gfx] [PATCH] gfx: Add the default modes for LVDS when no DS_RANGE block is found X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org diff --git a/src/drmmode_display.c b/src/drmmode_display.c index a469f6c..58435bf 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -721,6 +721,13 @@ static int drmmode_output_lvds_edid(xf86OutputPtr output, ranges->max_v = 200; ranges->min_h = 0; ranges->max_h = 200; + } else { + /* When DS_RANGE block is not found, we will to add the + * default mode list in our driver. + * In such case we will clear the GTF flag to avoid + * that xorg adds the default mode list again. + */ + edid_mon->features.msc &= ~(0x01); } return 0; } @@ -796,6 +803,7 @@ drmmode_output_get_modes(xf86OutputPtr output) drmModePropertyPtr props; struct fixed_panel_lvds *p_lvds; drmModeModeInfo *mode_ptr; + xf86MonPtr edid_mon = NULL; /* look for an EDID property */ for (i = 0; i < koutput->count_props; i++) { @@ -855,6 +863,14 @@ drmmode_output_get_modes(xf86OutputPtr output) xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, "Incorrect KMS mode.\n"); drmmode_output_lvds_edid(output, p_lvds); + edid_mon = output->MonInfo; + if ((edid_mon->features.msc & 0x01) == 0) { + /* If the GTF flag is not set, it means that DS_RANGE + * block is found. And we had better add the default + * mode list. + */ + Modes = xf86ModesAdd(Modes, xf86GetDefaultModes()); + } } return Modes; }