From patchwork Thu Jul 26 18:48:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1244901 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id F18CA3FC33 for ; Thu, 26 Jul 2012 20:19:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BAFDFA0ECE for ; Thu, 26 Jul 2012 13:19:15 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by gabe.freedesktop.org (Postfix) with ESMTP id D103B9E9D9 for ; Thu, 26 Jul 2012 12:56:38 -0700 (PDT) Received: by mail-wi0-f171.google.com with SMTP id hq4so5480612wib.12 for ; Thu, 26 Jul 2012 12:56:38 -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=joAOs2s1a6gVOzSitNqPb1eXtINJ90a40FWZhrLw5QU=; b=fnVI+JrJWb3oL2w5/oP4O9wD0Tqi4/WLD0VbX5SBID/BO1Toj9DYWBK/jZj/iABOGS vIk9b0bSW76BJ5lf7PVmdmioMpuKCzA9lXO38HGnT0OqNfTLFDgv6ryPWnRXcHHi767t n8EKklS/l8RAv+gnIpKuFeNM8uDH0O2BSIJr0= 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=joAOs2s1a6gVOzSitNqPb1eXtINJ90a40FWZhrLw5QU=; b=lvQYoL3JblRwAfJT6X3K1RpDJreNN1k6lLQeuvpzwU0pDYCPBgX3auu2gIdmswHPfD 03UB2hU3+19ydAaLMvPWIEYfnDKu9MYzy7Y23Sa3xuxQ5aFnlvCOx72FRfduDFPPQ1P2 rm/6zKs5RbZZVqIj6sAhX9K/sv9oNNFOHJXfW7c5BTxEXXdGZ1umQgeWkcsYY2twIfnF WX6kpIVqEvmOMM3U98gkrv70F159PGsoHRvnSB0F8EJHjQ8+syP7/qYZ19BXaprwK9Pj dGWLAcXAEypR1pD1i4qgt+++ZUPbic0rxyeV8PMt6nGIhcNWAtvOt5DLrwyaCcEc5Beo sRUQ== Received: by 10.180.94.164 with SMTP id dd4mr16150005wib.1.1343332598617; Thu, 26 Jul 2012 12:56:38 -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 fr4sm391403wib.8.2012.07.26.12.56.36 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 Jul 2012 12:56:37 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Thu, 26 Jul 2012 20:48:49 +0200 Message-Id: <1343328581-2324-25-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1343328581-2324-1-git-send-email-daniel.vetter@ffwll.ch> References: <1343328581-2324-1-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQl2snTTL0FaZlARVdosPetXWI6l2Z09zxERb92tgFGS43mrwo6PxC0e3BNV2Fs3kfZcLmM2 Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 24/76] 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 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 941d0d1..fe89254 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -6571,7 +6571,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; @@ -6587,7 +6587,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; @@ -6680,17 +6679,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; } } @@ -6707,11 +6700,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)