From patchwork Wed Apr 21 16:18:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 12216459 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EDBFC433B4 for ; Wed, 21 Apr 2021 16:18:10 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7643261430 for ; Wed, 21 Apr 2021 16:18:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7643261430 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CA5A889DFA; Wed, 21 Apr 2021 16:18:08 +0000 (UTC) Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2650F89DAB; Wed, 21 Apr 2021 16:18:07 +0000 (UTC) Received: by mail-oi1-x235.google.com with SMTP id n184so16917871oia.12; Wed, 21 Apr 2021 09:18:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=d5IyC7Gpwn5ArZ5GanVhyjl5d8zPk1aPolAUQ4cg0yI=; b=W8RcbjmW8ZSOG+xTgCM551bMZ/waizOAlhWCuQ1MflmMQRD/OJYhLJo79NtPBqURlg GtT2q0WhnNlwyttY/HrjDINdCBlRjQZLnJEXpTy1j3xjE5nxC8Jy120x4p45BKLy2M6T QfZxs4A/62x0ltpISQi7q2yaooQyKtibGxgf6A5bmqk0T050WaoTvPCEt8H81mhlMGy3 rQTQk3lOS7OxdyejpNV+MvnnoiFbNeCRR+qGfLYdgmTlpzCKN+CvYcwj2NLiWDO+I0ji FJmGP8qyiLtq5Fwn3QAq5mZ0afE6blYLEmlsYPV48HDvZbndHZBh+XOzFr8EcRD+dcZP XdVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=d5IyC7Gpwn5ArZ5GanVhyjl5d8zPk1aPolAUQ4cg0yI=; b=CQJTIer/KpotFT8MjJEXLMEqKD2s1domIt+fN9XkJtn/Yhn7MjZjcvYDGnvwVsnVV6 53LUmKPNi+s9I+6qY2aZM1AoUj1DyGLU2C7/og7Hmgxrhf7W6XOUU325Pg14gIyq7NHG cNPSKbG4Umy//a0E5IyDu9Wc4Qe9U70YjcomGVnfqHILMaqJol+ba/9+CHJYnSy+jAwJ fsWy58ZtkY0BAYhPjpznZgouxqNGyMosHHvi76QmhPGjGFRB8xz0GlSKnG+2eq2s2b2Z 08mzsuIJahvzGr+FAGGZPBddHiTj/34W9AUOHadZgSFHuTcJKmWa4WfieV2tkJzrdQRO XqcA== X-Gm-Message-State: AOAM531YM5iu8TFQRXytw8o1SkXx0tZ12Od7h3EAlx5BbmTX5d7P46Bg 6K9MkTBAO1FiUFcQreiMckM= X-Google-Smtp-Source: ABdhPJxLD2J7kjsRr4bQeHQNlhiyYOmBZqzEdKSHxoRd6pcHgTe1Elkjy8gyHtZydpUgPCR74pFYWw== X-Received: by 2002:aca:ad81:: with SMTP id w123mr5895267oie.113.1619021886481; Wed, 21 Apr 2021 09:18:06 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id m3sm627253otk.18.2021.04.21.09.18.05 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Apr 2021 09:18:06 -0700 (PDT) From: Guenter Roeck To: Harry Wentland Subject: [PATCH] drm/amd/display: Fix build warnings Date: Wed, 21 Apr 2021 09:18:02 -0700 Message-Id: <20210421161802.175639-1-linux@roeck-us.net> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Guenter Roeck Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Fix the following build warnings. drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c: In function ‘dm_update_mst_vcpi_slots_for_dsc’: drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:6242:46: warning: variable ‘old_con_state’ set but not used drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c: In function ‘amdgpu_dm_commit_cursors’: drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:7709:44: warning: variable ‘new_plane_state’ set but not used The variables were introduced to be used in iterators, but not used. Use other iterators which don't require the unused variables. Fixes: 8ad278062de4e ("drm/amd/display: Disable cursors before disabling planes") Fixes: 29b9ba74f6384 ("drm/amd/display: Recalculate VCPI slots for new DSC connectors") Signed-off-by: Guenter Roeck --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 573cf17262da..f9b87f1f424b 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -6239,13 +6239,13 @@ static int dm_update_mst_vcpi_slots_for_dsc(struct drm_atomic_state *state, { struct dc_stream_state *stream = NULL; struct drm_connector *connector; - struct drm_connector_state *new_con_state, *old_con_state; + struct drm_connector_state *new_con_state; struct amdgpu_dm_connector *aconnector; struct dm_connector_state *dm_conn_state; int i, j, clock, bpp; int vcpi, pbn_div, pbn = 0; - for_each_oldnew_connector_in_state(state, connector, old_con_state, new_con_state, i) { + for_each_new_connector_in_state(state, connector, new_con_state, i) { aconnector = to_amdgpu_dm_connector(connector); @@ -7706,15 +7706,14 @@ static void amdgpu_dm_handle_vrr_transition(struct dm_crtc_state *old_state, static void amdgpu_dm_commit_cursors(struct drm_atomic_state *state) { struct drm_plane *plane; - struct drm_plane_state *old_plane_state, *new_plane_state; + struct drm_plane_state *old_plane_state; int i; /* * TODO: Make this per-stream so we don't issue redundant updates for * commits with multiple streams. */ - for_each_oldnew_plane_in_state(state, plane, old_plane_state, - new_plane_state, i) + for_each_old_plane_in_state(state, plane, old_plane_state, i) if (plane->type == DRM_PLANE_TYPE_CURSOR) handle_cursor_update(plane, old_plane_state); }