From patchwork Thu May 11 19:10:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 9722779 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 D4F7460236 for ; Thu, 11 May 2017 19:11:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C674828702 for ; Thu, 11 May 2017 19:11:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB7EE28704; Thu, 11 May 2017 19:11:16 +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 861F428702 for ; Thu, 11 May 2017 19:11:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 385E56E5C3; Thu, 11 May 2017 19:11:15 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-f193.google.com (mail-qk0-f193.google.com [209.85.220.193]) by gabe.freedesktop.org (Postfix) with ESMTPS id 53AE66E5CF for ; Thu, 11 May 2017 19:11:13 +0000 (UTC) Received: by mail-qk0-f193.google.com with SMTP id k74so4959746qke.2 for ; Thu, 11 May 2017 12:11:13 -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=eaQ4GL3lR0VzzsnO1bnxlNUZrDZLFTbFtOxxIs0Zpkg=; b=RsnX07koY5jz5y0OtuGekLwGjptgtWjwH3xhcCtDK0/j1K/Bd8WwlpWlqyjKXSAnz4 5p6/m6TdlZd8NEJdbQ3SGY5IKgUbA123zdCxcOPdXC3pTVYiBq95oWEjcVT69pDrgHF9 ps4Qfev4m9c9x3VvFMQYF5W4qpHtGDEWg3+SPPWOtY4JJIHlux/ur+hXY8NffiailrKK VwwV+JghnDBgyJfhhFDDACcU1mXoUDwhz199aI4igLWDXRSmTOyFjVaHpjudglI7LpuE S298/jTSed4HfEVCwV8oJfIh2ZVG5P/KGXdS+vHnP6c5zuCbQ8eXlNxZWgBCtN45bGi2 N79A== X-Gm-Message-State: AODbwcD7CZ91ucoNd2xu0Z3/nTTVf3MWogl9gk6wOJbx0XmDe7kX+X/3 kM9vHAAfKSFyS19X/hA= X-Received: by 10.55.209.3 with SMTP id s3mr99289qki.256.1494529872362; Thu, 11 May 2017 12:11:12 -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.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 May 2017 12:11:11 -0700 (PDT) From: Gustavo Padovan To: dri-devel@lists.freedesktop.org Subject: [PATCH 5/8] drm/nouveau: use drm_for_each_connector_iter() Date: Thu, 11 May 2017 16:10:46 -0300 Message-Id: <20170511191049.28944-6-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 , Ben Skeggs 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: Ben Skeggs Signed-off-by: Gustavo Padovan Signed-off-by: Daniel Vetter --- only built-tested! --- drivers/gpu/drm/nouveau/nv50_display.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index 0e58537..8790bdc 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c @@ -2871,17 +2871,20 @@ nv50_msto_enable(struct drm_encoder *encoder) struct nv50_mstc *mstc = NULL; struct nv50_mstm *mstm = NULL; struct drm_connector *connector; + struct drm_connector_list_iter conn_iter; u8 proto, depth; int slots; bool r; - drm_for_each_connector(connector, encoder->dev) { + drm_connector_list_iter_begin(encoder->dev, &conn_iter); + drm_for_each_connector_iter(connector, &conn_iter) { if (connector->state->best_encoder == &msto->encoder) { mstc = nv50_mstc(connector); mstm = mstc->mstm; break; } } + drm_connector_list_iter_end(&conn_iter); if (WARN_ON(!mstc)) return;