From patchwork Mon Jun 13 21:13:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 876362 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5DLE19c027385 for ; Mon, 13 Jun 2011 21:14:21 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 032509F37B for ; Mon, 13 Jun 2011 14:14:01 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-vx0-f177.google.com (mail-vx0-f177.google.com [209.85.220.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 913F39E734 for ; Mon, 13 Jun 2011 14:13:48 -0700 (PDT) Received: by vxd2 with SMTP id 2so5131579vxd.36 for ; Mon, 13 Jun 2011 14:13:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer; bh=PyuJDI96GCpAySV8sROAeu7rL3Ib1Oi+ugbCnsPnjzM=; b=m87s9JhRzr0Mswk6XTYpUfHBJEAltNsF/v7P1Ql0mZgMqCfUtxW8rt4bUvZMQ+kl32 XVOYpsHPvVQ9lp7P/zRw/rqf7pffCVsfm6XcY+1u40mGK1NhfCRlgXk4MkF4fN7bJSuJ 0XFcNwl4akPDucS3cHeKFnXeY5Yge8FN+7kpA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=BHLk6Su0oNmZbHM9Rb9JmX41I3jjzj7fqZS3sc9fUb18P4RerZHdtEcC1C/kLaGGdu 6XRwJamc2jRubBIOLE03eGqsm/hGmLSoP67Yg03jqW7qiSmyYQ3lBQ8FDioV3Z7ZiGj+ YlL+S8Ud6BQ0MZBbJtrss2dn7l9HMF2fkf2s8= Received: by 10.52.100.106 with SMTP id ex10mr665997vdb.170.1307999627978; Mon, 13 Jun 2011 14:13:47 -0700 (PDT) Received: from localhost.localdomain (static-74-96-105-7.washdc.fios.verizon.net [74.96.105.7]) by mx.google.com with ESMTPS id bl1sm4055801vbb.17.2011.06.13.14.13.46 (version=SSLv3 cipher=OTHER); Mon, 13 Jun 2011 14:13:47 -0700 (PDT) From: Alex Deucher To: airlied@gmail.com, dri-devel@lists.freedesktop.org Subject: [PATCH 1/6] drm/radeon/kms: rework atombios_get_encoder_mode() Date: Mon, 13 Jun 2011 17:13:31 -0400 Message-Id: <1307999616-6252-1-git-send-email-alexdeucher@gmail.com> X-Mailer: git-send-email 1.7.1.1 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 13 Jun 2011 21:14:26 +0000 (UTC) This should give us more reliable results if the table is called before an active device is set. Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon_encoders.c | 23 +++++++++-------------- 1 files changed, 9 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index 03f124d..39fa225 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c @@ -660,21 +660,16 @@ atombios_get_encoder_mode(struct drm_encoder *encoder) if (radeon_encoder_is_dp_bridge(encoder)) return ATOM_ENCODER_MODE_DP; + /* DVO is always DVO */ + if (radeon_encoder->encoder_id == ATOM_ENCODER_MODE_DVO) + return ATOM_ENCODER_MODE_DVO; + connector = radeon_get_connector_for_encoder(encoder); - if (!connector) { - switch (radeon_encoder->encoder_id) { - case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: - case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1: - case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2: - case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_LVTMA: - case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1: - return ATOM_ENCODER_MODE_DVI; - case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC1: - case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC2: - default: - return ATOM_ENCODER_MODE_CRT; - } - } + /* if we don't have an active device yet, just use one of + * the connectors tied to the encoder. + */ + if (!connector) + connector = radeon_get_connector_for_encoder_init(encoder); radeon_connector = to_radeon_connector(connector); switch (connector->connector_type) {