From patchwork Fri Mar 31 00:10:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rix X-Patchwork-Id: 77488 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp227323vqo; Thu, 30 Mar 2023 17:29:56 -0700 (PDT) X-Google-Smtp-Source: AKy350Zxm+goySNjLoWkKUm1LQOdpQh7AZd4HYFsVXbpcF8LR2XwJnVmUukdUxSOowvxZoEl+fi0 X-Received: by 2002:a17:907:6d9c:b0:8b1:3483:e3d5 with SMTP id sb28-20020a1709076d9c00b008b13483e3d5mr34463802ejc.48.1680222596393; Thu, 30 Mar 2023 17:29:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680222596; cv=none; d=google.com; s=arc-20160816; b=vzn3rGSE5o3B9vdm26hFnjDKSmE7l5Qno7MPEvm/eJ8+LgPxKGtkaly5zWmcehyDRD 40V1D03P4JCQ6LnHyqmnXtQB9Suz1aRYkkT5WkUsLhJqeQC81QBH3DnjiLfMNaDvzCgy hajrku9pYxaIBAvKebsTP5dFQIVYpktCTDpBzq8ml4MM1PjV5a1F9NUogOTYdufLAggD 6hvOsqRCs0sgv8gl1NqQnOBM/LWgkm/pt8hHfl9/uUzYE687mLIR6saZgBwIXx4Ys7F/ BTXd1BRcsHgZnS9NfrkGgsJ6TOWKu0mfIZzf1r3aZP5mrF9fKl08Qs3rSWOEwgnTlaeM I3CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=sxdUBC3+7/+FoRE3AV8lIbZMqGBJVuxDsooJhZM+Js0=; b=sOEKr/ygnGrh4IIf7q6vqAaQviv0e4rjN/pDEXxPFuOAsyeMRVZQe2tyJtoWgWXKiQ XOX3ECTtqqZTMTe45KjiHeSHaZyoPf9UoMgTGO3e1KJJ5nq5wnCho5x2+v/+M8SyeFj0 p/wZxrm+olaaEzj7e72zL/Y/q+Ri/btsaks7mz4F22Ja38q2tx0UaUqpPIAvYJPKgBN4 yrnKIgT0QWmOv3JZrVIj+Bp5dzXYc5b+WKo8lecGhWr1sTxJdjyNC8D6QT29qPlSlKku bYZrRMvGDRH55F+W4iFxKfemAA9Lo13m/lzGgnH03SrGRm2FP0oCxPKI5GuZltcX0qLr vBUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KmBAlkm3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id my51-20020a1709065a7300b009351546e521si715703ejc.706.2023.03.30.17.29.31; Thu, 30 Mar 2023 17:29:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KmBAlkm3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229538AbjCaARl (ORCPT + 99 others); Thu, 30 Mar 2023 20:17:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbjCaARj (ORCPT ); Thu, 30 Mar 2023 20:17:39 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2ABFDBC6 for ; Thu, 30 Mar 2023 17:15:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680221628; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=sxdUBC3+7/+FoRE3AV8lIbZMqGBJVuxDsooJhZM+Js0=; b=KmBAlkm3y91WOQsmI55pFOF+VetxGU4yTjEGz/ipZtC3QuJ5cXDmikdIokpRGLNZNRgqxv W1GR+f9HPAJvNDn702Y6IV5Wd3Rq0r9m7CRf+BWjqsKIDGKCSCg4CY5Jixw5OJUSJkN9GW 8EpQxjQWOmXTUQIeS5311/Km9cNiStU= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-606-kl5TJukgPsaRFJTdGrhGJg-1; Thu, 30 Mar 2023 20:10:36 -0400 X-MC-Unique: kl5TJukgPsaRFJTdGrhGJg-1 Received: by mail-qv1-f72.google.com with SMTP id y19-20020ad445b3000000b005a5123cb627so9031441qvu.20 for ; Thu, 30 Mar 2023 17:10:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680221436; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sxdUBC3+7/+FoRE3AV8lIbZMqGBJVuxDsooJhZM+Js0=; b=P3knfyPr2ShkgnQK33rB/fKYOBWL0e24yu7BruiVhv/VpaKi/+V+C3wVH7LNPwHFTN 0bO8orDON3FDQIE1pr0mBLNEVS+QUxKY2O1KpjoHUf9Ow0MpTV4Br9o7ViKAULs7uG+U 3ZYne1XIa9qiNNQFevpA+FB8ThkVZ94XEdVGTYiFmLtrx5OG8xQNruFtBzhmI/iyFs98 zGNae82cd6TqDs6gBnYCB9Xyc/b8eiTteLpD5l7fEEhPHr4L4ajUhKH/ESSlxuguw1S2 wSfLpvSuyqHsxMhF+1yWDCApfIukqYNvZSvajQvw2YEX55qbVxM/yonhy2rojYWcWB7Y tA7w== X-Gm-Message-State: AAQBX9cg8f9NY465IYuLTbBKhp4i48c8z5YCfEiqUHbvGsZgfP7jHHTR zVvsFXipZE4aBI7RiCADjqIoVwP8yD2GnSLwb3SsH9ZCZa0DU5X3nXVHPQxpWJlPMU7rapGaZrY cM8/ykhzYisyBHzYSaoKz5Pw3 X-Received: by 2002:ac8:5b01:0:b0:3e6:3851:b949 with SMTP id m1-20020ac85b01000000b003e63851b949mr5097002qtw.18.1680221436262; Thu, 30 Mar 2023 17:10:36 -0700 (PDT) X-Received: by 2002:ac8:5b01:0:b0:3e6:3851:b949 with SMTP id m1-20020ac85b01000000b003e63851b949mr5096964qtw.18.1680221436015; Thu, 30 Mar 2023 17:10:36 -0700 (PDT) Received: from dell-per740-01.7a2m.lab.eng.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id e14-20020ac8670e000000b003e38d6c013dsm223281qtp.60.2023.03.30.17.10.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 17:10:35 -0700 (PDT) From: Tom Rix To: harry.wentland@amd.com, sunpeng.li@amd.com, Rodrigo.Siqueira@amd.com, alexander.deucher@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, nathan@kernel.org, ndesaulniers@google.com, aric.cyr@amd.com, HaoPing.Liu@amd.com, Anthony.Koo@amd.com, hanghong.ma@amd.com, Angus.Wang@amd.com, Dillon.Varone@amd.com Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Tom Rix Subject: [PATCH] drm/amd/display: remove unused average_render_time_in_us and i variables Date: Thu, 30 Mar 2023 20:10:32 -0400 Message-Id: <20230331001032.1846456-1-trix@redhat.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761840997624342701?= X-GMAIL-MSGID: =?utf-8?q?1761841089032267589?= clang with W=1 reports drivers/gpu/drm/amd/amdgpu/../display/modules/freesync/freesync.c:1132:15: error: variable 'average_render_time_in_us' set but not used [-Werror,-Wunused-but-set-variable] unsigned int average_render_time_in_us = 0; ^ This variable is not used so remove it, which caused i to be unused so remove that as well. Signed-off-by: Tom Rix --- .../drm/amd/display/modules/freesync/freesync.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c index 315da61ee897..5c41a4751db4 100644 --- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c +++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c @@ -1129,7 +1129,6 @@ void mod_freesync_handle_preflip(struct mod_freesync *mod_freesync, { struct core_freesync *core_freesync = NULL; unsigned int last_render_time_in_us = 0; - unsigned int average_render_time_in_us = 0; if (mod_freesync == NULL) return; @@ -1138,7 +1137,6 @@ void mod_freesync_handle_preflip(struct mod_freesync *mod_freesync, if (in_out_vrr->supported && in_out_vrr->state == VRR_STATE_ACTIVE_VARIABLE) { - unsigned int i = 0; unsigned int oldest_index = plane->time.index + 1; if (oldest_index >= DC_PLANE_UPDATE_TIMES_MAX) @@ -1147,18 +1145,6 @@ void mod_freesync_handle_preflip(struct mod_freesync *mod_freesync, last_render_time_in_us = curr_time_stamp_in_us - plane->time.prev_update_time_in_us; - /* Sum off all entries except oldest one */ - for (i = 0; i < DC_PLANE_UPDATE_TIMES_MAX; i++) { - average_render_time_in_us += - plane->time.time_elapsed_in_us[i]; - } - average_render_time_in_us -= - plane->time.time_elapsed_in_us[oldest_index]; - - /* Add render time for current flip */ - average_render_time_in_us += last_render_time_in_us; - average_render_time_in_us /= DC_PLANE_UPDATE_TIMES_MAX; - if (in_out_vrr->btr.btr_enabled) { apply_below_the_range(core_freesync, stream,