From patchwork Wed Jul 11 14:28:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1183751 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 5A537DF25A for ; Wed, 11 Jul 2012 15:58:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 296D0A0E9A for ; Wed, 11 Jul 2012 08:58:54 -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 A70789E8AF for ; Wed, 11 Jul 2012 08:35:45 -0700 (PDT) Received: by mail-wi0-f177.google.com with SMTP id hm11so928073wib.12 for ; Wed, 11 Jul 2012 08:35:45 -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=dZKTAawHn3fzLcVPUz94kzh2bKsyM3+SdfVqZ1uzhl4=; b=ZFtyClOAICum+Yqy6xI5krIQjGZbc0GcVP4f7jkAMp4JwbV/Gby9kRcJ90UzrzX2YG fFBQ/RuVMZiLfiNYNiINwcCono9QJ9zrbm272XQ6ziZTni8xHtwFUIOCqKubXAvS+sHW clP0r6lHKWqLBFHhrrKkmFlLadrpxUzCt1kd0= 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=dZKTAawHn3fzLcVPUz94kzh2bKsyM3+SdfVqZ1uzhl4=; b=o/Z6k9Yrj1/hH+pNJ4tXBmcXwT/RdSp/Sj64Qwd59iQxP3CRkRdJkUSEvqXwwKav86 jtXN5ogSmjJp88amaxumWyqWHNaHDkOQuwO8pZlKbHfBUd6CoOCRyg+f6V5iUaazedso EMR7QlMgCCSm5pI8nSFuckXm2G0NFPz2IhyH9ZJrPpkwUWOjk/oE65Z913Qb+aJSKkzK b4qJBV10sukY87+jQR3vtiyuPybhY2SX/ENE6QOo3MiCDj0zuImfUTJjYybBhJh0FXMh wT+7FakapfwGXvt7ghnveHQk4vdkEXeVYm9WJZ7Fw0ZQi7/NC/S3dKEtcDVGNoR2kktQ 218A== Received: by 10.180.94.163 with SMTP id dd3mr4946230wib.10.1342020945423; Wed, 11 Jul 2012 08:35:45 -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 bc2sm5777080wib.0.2012.07.11.08.35.44 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 11 Jul 2012 08:35:44 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Wed, 11 Jul 2012 16:28:11 +0200 Message-Id: <1342016944-23395-29-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1342016944-23395-1-git-send-email-daniel.vetter@ffwll.ch> References: <1342016944-23395-1-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQn8P5xh8+C/UCHbKg5GkIg9ks/ly5bRGF9vU5elTJoWzl8cpccluR0IvMbk3kBWvEGEYEJj Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 28/81] 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 28a5ba0..451dbba 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -6644,7 +6644,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; @@ -6660,7 +6660,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; @@ -6753,17 +6752,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; } } @@ -6780,11 +6773,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)