From patchwork Wed Jul 15 22:11:25 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Barnes X-Patchwork-Id: 35780 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6FMBV5T000311 for ; Wed, 15 Jul 2009 22:11:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752488AbZGOWLa (ORCPT ); Wed, 15 Jul 2009 18:11:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752750AbZGOWL3 (ORCPT ); Wed, 15 Jul 2009 18:11:29 -0400 Received: from outbound-mail-109.bluehost.com ([69.89.22.9]:58395 "HELO outbound-mail-109.bluehost.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752488AbZGOWL3 (ORCPT ); Wed, 15 Jul 2009 18:11:29 -0400 Received: (qmail 14722 invoked by uid 0); 15 Jul 2009 22:11:29 -0000 Received: from unknown (HELO box514.bluehost.com) (74.220.219.114) by outboundproxy3.bluehost.com with SMTP; 15 Jul 2009 22:11:29 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=virtuousgeek.org; h=Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References:X-Identified-User; b=dLi4YUIvST4VhgXIvapP2lHmOBSVCzkqUG+2vKMTYA9i/NKvu24WCoq5kg9r9mTzFRzseaiFlqWhbJ81d3/R0MNMcHk7RVJoHBjxCpLb6lQvIG2hpuk4nRTpucPhhoji; Received: from [75.111.28.251] (helo=localhost.localdomain) by box514.bluehost.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1MRChE-0007ii-TI; Wed, 15 Jul 2009 16:11:29 -0600 From: Jesse Barnes To: intel-gfx@lists.freedesktop.org, linux-acpi@vger.kernel.org Cc: Jesse Barnes Subject: [PATCH 3/4] drm/i915: use ACPI LID status for LVDS ->detect hook Date: Wed, 15 Jul 2009 15:11:25 -0700 Message-Id: <1247695886-18432-4-git-send-email-jbarnes@virtuousgeek.org> X-Mailer: git-send-email 1.6.0.4 In-Reply-To: <1247695886-18432-1-git-send-email-jbarnes@virtuousgeek.org> References: <1247695886-18432-1-git-send-email-jbarnes@virtuousgeek.org> X-Identified-User: {10642:box514.bluehost.com:virtuous:virtuousgeek.org} {sentby:smtp auth 75.111.28.251 authed with jbarnes@virtuousgeek.org} Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org We can't load or hotplug detect LVDS like we can other outputs, but if there's a lid device present we can use it as a proxy. This allows the LFP state to be determined at ->detect time, making configurations requiring manual intervention today "just work" assuming the lid device status is correct. Signed-off-by: Jesse Barnes --- drivers/gpu/drm/i915/intel_lvds.c | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index 1d0d30a..57c86fd 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c @@ -599,12 +599,18 @@ static void intel_lvds_mode_set(struct drm_encoder *encoder, /** * Detect the LVDS connection. * - * This always returns CONNECTOR_STATUS_CONNECTED. This connector should only have - * been set up if the LVDS was actually connected anyway. + * Since LVDS doesn't have hotlug, we use the lid as a proxy. Open means + * connected and closed means disconnected. We also send hotplug events as + * needed, using lid status notification from the input layer. */ static enum drm_connector_status intel_lvds_detect(struct drm_connector *connector) { - return connector_status_connected; + enum drm_connector_status status = connector_status_connected; + + if (!acpi_lid_open()) + status = connector_status_disconnected; + + return status; } /**