From patchwork Thu Sep 10 05:47:05 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenyu Wang X-Patchwork-Id: 46672 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 n8AMD1Wi007356 for ; Thu, 10 Sep 2009 22:13:01 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 00FB89E835; Wed, 9 Sep 2009 22:47:11 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from orsmga101.jf.intel.com (mga06.intel.com [134.134.136.21]) by gabe.freedesktop.org (Postfix) with ESMTP id BCA2C9E81C for ; Wed, 9 Sep 2009 22:47:08 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 09 Sep 2009 22:33:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.44,362,1249282800"; d="asc'?scan'208";a="447277543" Received: from zhen-devel.sh.intel.com (HELO zhen-devel) ([10.239.13.150]) by orsmga002.jf.intel.com with ESMTP; 09 Sep 2009 22:53:16 -0700 Date: Thu, 10 Sep 2009 13:47:05 +0800 From: Zhenyu Wang To: Linus Torvalds Message-ID: <20090910054705.GA1014@zhen-devel.sh.intel.com> Mail-Followup-To: Linus Torvalds , Eric Anholt , mailing54 , Linux Kernel Mailing List , Dave Airlie , dri-devel@lists.sourceforge.net, Ma Ling , Jesse Barnes , "Zhao, Yakui" , Keith Packard , intel-gfx References: <4A941E8B.8080902@plzk.org> <4A94599F.9020508@plzk.org> <1251239637.26348.20.camel@gaiman.anholt.net> <20090826015127.GA1402@zhen-devel.sh.intel.com> <20090826035840.GA16894@zhen-devel.sh.intel.com> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: mailing54 , Ma Ling , intel-gfx , Linux Kernel Mailing List , Dave Airlie , dri-devel@lists.sourceforge.net Subject: Re: [Intel-gfx] Linux 2.6.31-rc7 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.9 Precedence: list Reply-To: Zhenyu Wang 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 On 2009.08.25 21:20:18 -0700, Linus Torvalds wrote: > > And how about MacBook 2.1, which apparently also goes black? > Linus, sorry for reply this old thread. I just handed on one MacBook with 945GM, and tried to find out the reason of black screen. It is TV detection that caused it. MacBook routes integrated TV DAC to mini-DVI port too, like for VGA. Our TV detect does load detect, which trys to set a mode onto TV port and checked back its status. This TV load-detect makes the LVDS black on MacBook. It looks our load detect function has problem that when we pick up one crtc, we don't check if its has a fb. During first TV detect, choosed crtc obviously has no fb, it would fail in modesetting when setting plane surface. This might have effect on the purpose of load- detect process. I'll see how it should be fixed. But even if I hacked plane setting with all zeros, screen still goes black on my MacBook, although TV detect return is right that there's none found. So this blank issue is within detect process, if you try to load fbcon or X later, setting mode is fine on LVDS. That's why build fbcon in kernel might workaround this issue. I don't know much about our TV detect method details, but looks like here we should check current TV status when system start. Otherwise it seems we can't stopping blank the screen...So I did a temp hacking like, which makes LVDS working, but I haven't tested with mini-DVI <-> S-Video. I'm not sure if this is ideal enough for this, but first get port states in system startup for initial setup, and userspace could check and set required config later seems sane to me, as you have also suggested to do. This patch doesn't aim to be upstream, we may set the state in priv struct to check boot state, but I'd like to hear others' comment about this. thanks. diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c index 5b1c9e9..f3ecbaa 100644 --- a/drivers/gpu/drm/i915/intel_tv.c +++ b/drivers/gpu/drm/i915/intel_tv.c @@ -1451,8 +1451,18 @@ intel_tv_detect(struct drm_connector *connector) struct intel_output *intel_output = to_intel_output(connector); struct intel_tv_priv *tv_priv = intel_output->dev_priv; struct drm_encoder *encoder = &intel_output->enc; + struct drm_i915_private *dev_priv = connector->dev->dev_private; int dpms_mode; int type = tv_priv->type; + static int first_detect = 1; + + if (first_detect) { + first_detect = 0; + if (!(I915_READ(TV_CTL) & TV_ENC_ENABLE)) + return connector_status_disconnected; + else + return connector_status_connected; + } mode = reported_modes[0]; drm_mode_set_crtcinfo(&mode, CRTC_INTERLACE_HALVE_V);