From patchwork Sun Aug 19 19:12:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1344891 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 D330DDF264 for ; Sun, 19 Aug 2012 20:32:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CB492A1046 for ; Sun, 19 Aug 2012 13:32:04 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 7DCCCA1038 for ; Sun, 19 Aug 2012 13:20:35 -0700 (PDT) Received: by mail-wg0-f43.google.com with SMTP id dr1so4210645wgb.12 for ; Sun, 19 Aug 2012 13:20:35 -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=n2gD6uZFYg5VSsc02iu+s7npFsMwDeP379Qs8GzmcT0=; b=gKEbYSgS91KQfW7qzCWX2UJLSawm+QVtobE7BpvbDKdtFxr78hLK/4te0nAfMsOQsS GZc7ksfbB1gXHeOUA2W6r0l/oWGUv1S/PrsM0aXaDmg2DounuimVC3/WHRpxJmCuQFNW nGrJd7YPYbNsRmHXwzdMprtO7mjae5QSljgD8= 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=n2gD6uZFYg5VSsc02iu+s7npFsMwDeP379Qs8GzmcT0=; b=ULmIkB3RE+t+gncRiy48O63I2yoVK5fQ4rixsF6JqFEpIiyOxTzlEx0jvBh7sLMG8p QzNwB3yUezgEModmq+quL3eGfKYFNB1lraZRD7H1vWH9E0lId/l4RaWAxpc5/mh2H751 pNbB+AFoxS4D+ZZVhk2lw4Jg+RuBlIo2N8UldI6gTZ4tOHNp209HDyNZBjOh8dy4lT9G 4NhBTcdK6EMb5HGf3l6GOP/BnVGjnuuS9RMJMrqeUCeqptbjWQxRzFxzkjHc7yoFawwR rulojIj+oMlS98qo06kuA3c4RZPumpkjN/emCEJGvPKJyC/RrEXhMaKHAuPSGrA8euNr yATg== Received: by 10.180.93.8 with SMTP id cq8mr22871446wib.16.1345407635035; Sun, 19 Aug 2012 13:20:35 -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 fu8sm24194367wib.5.2012.08.19.13.20.33 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 19 Aug 2012 13:20:34 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Sun, 19 Aug 2012 21:12:33 +0200 Message-Id: <1345403595-9678-17-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.11.2 In-Reply-To: <1345403595-9678-1-git-send-email-daniel.vetter@ffwll.ch> References: <1345403595-9678-1-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQn4irtYGKsUuzjN0dQoCbh+oDiZ/KKUO7shEBwB/jtmWADrdcbeZ94xHlzagsIbd57rnE6+ Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 16/58] 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 Reviewed-by: Jesse Barnes --- drivers/gpu/drm/i915/intel_display.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 5dbe03a..9d5c575 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)