From patchwork Thu May 11 19:10:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 9722775 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8730660236 for ; Thu, 11 May 2017 19:11:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78CEF28701 for ; Thu, 11 May 2017 19:11:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DD2B28703; Thu, 11 May 2017 19:11:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E749128701 for ; Thu, 11 May 2017 19:11:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7F2686E5C4; Thu, 11 May 2017 19:11:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-f195.google.com (mail-qk0-f195.google.com [209.85.220.195]) by gabe.freedesktop.org (Postfix) with ESMTPS id 32F936E5C4 for ; Thu, 11 May 2017 19:11:08 +0000 (UTC) Received: by mail-qk0-f195.google.com with SMTP id y128so4945081qka.3 for ; Thu, 11 May 2017 12:11:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6xSixOGyTyHMeoATDylTMTTJMkm/y1IPDf14Gw9sbCY=; b=J7uPysoZf2NtNRtIXMcBjjcAe9D9Cb6em1Ad3EQl67iAx51gRxeBkdRqCP2+vqoPRl gyb33kmtvUME8raZrbLyH/6A0+viv7wPGAfXHZi1TQwhGb61HVTUJFDiX0AcGCbcaYN7 J3oWuYejyjMuy9Kx6QogxpIU4c+fMcDSvC7IiD5ZJSK80G3oJN7BnEjQZkRXgXWj5SNe VJ0GXZ4plD78rlC+a5dc29TEkFtPwR/IZE4XQktYmM1r+yQOduVKjmLU5M0wcgwXeKmh /MY7t+/vzzve1LCaRIO7gOEG23czh4bRiDzn4FtDNVHF54960z/s6r93bLT5Hgtj/1mQ eh2w== X-Gm-Message-State: AODbwcD/HEZ/XIU9N1koftpuss/U4fvlK6UC/zT1USrMwTERV3iVJwL+ OlHiivcq0OIM8w== X-Received: by 10.55.178.5 with SMTP id b5mr99732qkf.258.1494529867063; Thu, 11 May 2017 12:11:07 -0700 (PDT) Received: from localhost.localdomain (177.205.87.164.dynamic.adsl.gvt.net.br. [177.205.87.164]) by smtp.gmail.com with ESMTPSA id z43sm726708qtz.9.2017.05.11.12.11.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 May 2017 12:11:06 -0700 (PDT) From: Gustavo Padovan To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/8] drm/i915: use drm_for_each_connector_iter() Date: Thu, 11 May 2017 16:10:44 -0300 Message-Id: <20170511191049.28944-4-gustavo@padovan.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170511191049.28944-1-gustavo@padovan.org> References: <20170511191049.28944-1-gustavo@padovan.org> Cc: Gustavo Padovan , Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Gustavo Padovan Drop legacy drm_for_each_connector() in favor of the race-free drm_for_each_connector_iter(). Cc: Daniel Vetter Cc: Jani Nikula Signed-off-by: Gustavo Padovan Reviewed-by: Daniel Vetter --- drivers/gpu/drm/i915/intel_display.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 3617927..207f144 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -11216,6 +11216,7 @@ static bool check_digital_port_conflicts(struct drm_atomic_state *state) { struct drm_device *dev = state->dev; struct drm_connector *connector; + struct drm_connector_list_iter conn_iter; unsigned int used_ports = 0; unsigned int used_mst_ports = 0; @@ -11224,7 +11225,8 @@ static bool check_digital_port_conflicts(struct drm_atomic_state *state) * list to detect the problem on ddi platforms * where there's just one encoder per digital port. */ - drm_for_each_connector(connector, dev) { + drm_connector_list_iter_begin(dev, &conn_iter); + drm_for_each_connector_iter(connector, &conn_iter) { struct drm_connector_state *connector_state; struct intel_encoder *encoder; @@ -11263,6 +11265,7 @@ static bool check_digital_port_conflicts(struct drm_atomic_state *state) break; } } + drm_connector_list_iter_end(&conn_iter); /* can't mix MST and SST/HDMI on the same port */ if (used_ports & used_mst_ports)