From patchwork Tue Jul 3 09:28:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1150381 Return-Path: X-Original-To: patchwork-intel-gfx@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 14E3CDFF72 for ; Tue, 3 Jul 2012 10:56:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 055FEA024A for ; Tue, 3 Jul 2012 03:56:23 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 5BBCB9F6F7 for ; Tue, 3 Jul 2012 03:35:02 -0700 (PDT) Received: by mail-wi0-f177.google.com with SMTP id hm11so2984141wib.12 for ; Tue, 03 Jul 2012 03:35:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=c66Wz9kcjBQd2Yimt0ZdqbWr9GT0YQ5SLJhxyISWDto=; b=em4Yptc+uA2IR/pSShhqqqAu90h4Sx4TgbvzXNspHUvB1cjhzgfyNU2dnYXLY79OR/ 8+LhuiaeM3XJv7vjyDYymiJJBxVpP43PRXHjRl1m1vGYoz91zkVoTRRx4vvzIF94oVAZ jOCGDfBJLTp3yfq98i+1uEsqRz7HYVNJERzTc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=c66Wz9kcjBQd2Yimt0ZdqbWr9GT0YQ5SLJhxyISWDto=; b=OCoEQePOyOaLwO79sxg8XGu7Nmo2df8ni7GIovGa+tYfwSeGxoMDHNh8k6Zub/xWmv TsFQAtZS//yeiRFR3QAiFfaFrLiPM4G+zfp/hABNnBHt38U798pdonGRFCcVq+bF0d8z zb1mixgKjU2cp/NUgQYX0AqXrIu1gZJyT/9Bjkp+UWCdAhZH8fh9AC89rn+EnVAHVBON DffCiHIfVM/Lin62h91LvD9ezbDrGQit3Qsx2vntQjgC/9u6t9TljINw8zEnlwKi6bn2 coSlbG6Z4TfbUBCNwr7URjMc3Y2X5Qmhq8FApCKvn+96CPUuwS89IHsz2rWE6w/XVF1i bldw== Received: by 10.180.86.106 with SMTP id o10mr4508210wiz.22.1341311702063; Tue, 03 Jul 2012 03:35:02 -0700 (PDT) Received: from wespe.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPS id e9sm14845138wiw.10.2012.07.03.03.35.00 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 Jul 2012 03:35:01 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Tue, 3 Jul 2012 11:28:20 +0200 Message-Id: <1341307715-3886-29-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1341307715-3886-1-git-send-email-daniel.vetter@ffwll.ch> References: <1341307715-3886-1-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQkZSyOwSJGuqxmKs2OZU0Cu/4zit0NqZ/xVXdnAth0p4QLpAI9+G75KeEfDESpLO4e958U4 Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 28/43] drm/i915: inline intel_best_encoder X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 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+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Also kill the error-path, we have a fixed connector-encoder mapping. Unfortunately we can't rip out all the ->best_encoder callbacks, these are all still used by the fb_helper. Neat helper layering violation there. Signed-off-by: Daniel Vetter --- drivers/gpu/drm/i915/intel_display.c | 18 +++--------------- 1 files changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 0fd9085..0c15960 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -6606,7 +6606,7 @@ static int intel_crtc_set_config(struct drm_mode_set *set) bool mode_changed = false; /* if true do a full mode set */ bool fb_changed = false; /* if true and !mode_changed just do a flip */ struct drm_connector *save_connectors, *connector; - int count = 0, ro, fail = 0; + int count = 0, ro; struct drm_mode_set save_set; int ret; int i; @@ -6622,7 +6622,6 @@ static int intel_crtc_set_config(struct drm_mode_set *set) if (!set->crtc->helper_private) return -EINVAL; - if (!set->mode) set->fb = NULL; @@ -6715,17 +6714,11 @@ static int intel_crtc_set_config(struct drm_mode_set *set) /* a) traverse passed in connector list and get encoders for them */ count = 0; list_for_each_entry(connector, &dev->mode_config.connector_list, head) { - struct drm_connector_helper_funcs *connector_funcs = - connector->helper_private; new_encoder = connector->encoder; for (ro = 0; ro < set->num_connectors; ro++) { if (set->connectors[ro] == connector) { - new_encoder = connector_funcs->best_encoder(connector); - /* if we can't get an encoder for a connector - we are setting now - then fail */ - if (new_encoder == NULL) - /* don't break so fail path works correct */ - fail = 1; + new_encoder = + &intel_attached_encoder(connector)->base; break; } } @@ -6742,11 +6735,6 @@ static int intel_crtc_set_config(struct drm_mode_set *set) } } - if (fail) { - ret = -EINVAL; - goto fail; - } - count = 0; list_for_each_entry(connector, &dev->mode_config.connector_list, head) { if (!connector->encoder)