From patchwork Thu May 11 19:10:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 9722773 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 B1DF260236 for ; Thu, 11 May 2017 19:11:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A3C2C28701 for ; Thu, 11 May 2017 19:11:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9860A28703; Thu, 11 May 2017 19:11:07 +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 A4CD528701 for ; Thu, 11 May 2017 19:11:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 26D926E5BD; Thu, 11 May 2017 19:11:06 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-f196.google.com (mail-qk0-f196.google.com [209.85.220.196]) by gabe.freedesktop.org (Postfix) with ESMTPS id F34806E5BD for ; Thu, 11 May 2017 19:11:04 +0000 (UTC) Received: by mail-qk0-f196.google.com with SMTP id o85so4961858qkh.0 for ; Thu, 11 May 2017 12:11:04 -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=BUWvROV7WwGAPS8LThToFxpcwDE1h9iBcuVvnYqAvAc=; b=YQdIfAxX2xxL132YWbtHQ8bzjU0joUslM2ykbzgEbvnezEv6KEfdxfNqVaKVIz5tTL p9GGU97Se5ffd9omcmblNrzE8RhY5gkD8QWwMNWEextX8qyiPAOZdo5EUDM1VVC6Dejk 54mA3MN65fjLmREPOdWwW/FORe1sUQbDg2j9FDWcAmVOSQAvTIh5ET9aSLnEq3Rh8fId YC4qRuTOSggSRpfRSDfkdZmg+LlhP3/7gnbXB5OA8fHRLARJXlmIUWf9t2IhUFe1CWd2 1hOME1m3ExY6oXp8j9Uegl/lqet2Pf0XwJdtHYU/kj962vq3JVApqzVjx5pZPwuQN+4f FOPg== X-Gm-Message-State: AODbwcBFtdjwdk9G3yv92Kmg6wo9dDAO5RVSScrCynHnpjtogZ9K/mmd a9uKibEdAHGJ3w== X-Received: by 10.233.223.196 with SMTP id t187mr86257qkf.31.1494529864078; Thu, 11 May 2017 12:11:04 -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.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 May 2017 12:11:03 -0700 (PDT) From: Gustavo Padovan To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/8] drm/rockchip: use drm_for_each_connector_iter() Date: Thu, 11 May 2017 16:10:43 -0300 Message-Id: <20170511191049.28944-3-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 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: Mark Yao Signed-off-by: Gustavo Padovan Reviewed-by: Daniel Vetter --- only built-tested! --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index 40a5e6e..4f042ab 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -1118,16 +1118,16 @@ static void vop_crtc_destroy_state(struct drm_crtc *crtc, #ifdef CONFIG_DRM_ANALOGIX_DP static struct drm_connector *vop_get_edp_connector(struct vop *vop) { - struct drm_crtc *crtc = &vop->crtc; struct drm_connector *connector; + struct drm_connector_list_iter conn_iter; - mutex_lock(&crtc->dev->mode_config.mutex); - drm_for_each_connector(connector, crtc->dev) + drm_connector_list_iter_begin(vop->drm_dev, &conn_iter); + drm_for_each_connector_iter(connector, &conn_iter) { if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { - mutex_unlock(&crtc->dev->mode_config.mutex); + drm_connector_list_iter_end(&conn_iter); return connector; } - mutex_unlock(&crtc->dev->mode_config.mutex); + drm_connector_list_iter_end(&conn_iter); return NULL; }