From patchwork Mon May 29 07:18:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 100127 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1335346vqr; Mon, 29 May 2023 00:29:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4WCRqQIZYG7n8rOr51tc/NsmcLfcVVKW16tfKz/xJYSi0cfms4hmSxzaP6ujD9dpLmtYPh X-Received: by 2002:a05:6a00:98a:b0:64d:5c1d:353 with SMTP id u10-20020a056a00098a00b0064d5c1d0353mr13752926pfg.19.1685345381848; Mon, 29 May 2023 00:29:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685345381; cv=none; d=google.com; s=arc-20160816; b=WlUjfXWDn+3P+bbYcN2j8ze/Owl1wEJvkfANhomJ/IAWVlrys6YbR+/+R3z0VucINP mR0It/aqg201qh+bZIMxSajPhjZs4cREYpIIE12b79X5ZPOJfZz4Y/Bw1l7IT9e1MkzM IJHzYSJtFbrjek6XBJjyySNkQ+sYDYY34EE9o2AJpRjlvdao/gRQbpglepu5J2xUVbmN OmLEl3pE7VQjoq01CC1Uaz9cO0kPzediTB/hqPRLoUSAKt52AxcgVgxWvzeDfFeG/GGa IQsAZCDAbpDQzaiQ9yCvtLaH9lLNeaTbIhaiLLDOmMFfzi2kJbIVQAPcHQJBVa8lj/Ji nSgA== 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=ToQuNxvWCS00We22b4WvFzbjWsFm90sAaGVlSiXzZ6A=; b=TlUOBCXlfvxhitJ69s2w1M8dQHHc9TyPpJ9zeOKB/G58NFwFWZZdNWX2kPm4MXW5Ct AdF4JEMmGgnGb3aY4WRkwoHJejuK9eKRsN3b3sRA0/4vSehuRUYYBg8o9rQR2JR2syFF 1GuGG+2oKio1FEhu8pIzr34220tEsYlwTio2l00EjdUydXY09sdaTn8kfKq86ocqizbH tXyV3bgTrMPsRYkIiPSzyXyks9sm28Pjo6OPXD6QEfWnKBD/PEi6yRhHID9yY5n+Am8F MKKCKQdPLyQdvhEz3uej7MLNPung5/d3AxDL5NPM8B3wxjK1tl71s4y08Hk5Sx4x+Gpa +YFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=N0OGot8X; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g12-20020aa79f0c000000b0064a35829154si9681329pfr.343.2023.05.29.00.29.27; Mon, 29 May 2023 00:29:41 -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=@wanadoo.fr header.s=t20230301 header.b=N0OGot8X; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229570AbjE2HTG (ORCPT + 99 others); Mon, 29 May 2023 03:19:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229521AbjE2HTE (ORCPT ); Mon, 29 May 2023 03:19:04 -0400 Received: from smtp.smtpout.orange.fr (smtp-30.smtpout.orange.fr [80.12.242.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99660A4 for ; Mon, 29 May 2023 00:19:02 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id 3X9eqYgEzMDzt3X9eq4QMn; Mon, 29 May 2023 09:19:00 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1685344740; bh=ToQuNxvWCS00We22b4WvFzbjWsFm90sAaGVlSiXzZ6A=; h=From:To:Cc:Subject:Date; b=N0OGot8XgN/sgaRBBPtv8sAmxBbjCRQT9O8f739VgP6/PefDcz4qn4+sQQ4buhqA8 fAc/X2jePdXNNBWmTWvgbUp9Ryp8kHWEDgJmdzV8ZHE8c1YY413djR6ZWGI8tjM7GY fQLYY7JVDeWvBPzsWhh3RHmI0aLvzF0lmu23syr3EuHsiPzq+pwh17fxnJCmfsb7/j iuwSEeqSG/cl3+zCv29bZ+NSC0beKhU3a8viZBb92BUsu6ZKRr/ioSKfkXVgzCf4ft vipwGXayXPCFv1AUaJfDRHr8JmJ2AbFb3IS6GFQko1QKSbRwVykQrP2aT2+cJnfe+V vbfQ3xCVLrLbQ== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 29 May 2023 09:19:00 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 1/3] drm/amd/display: Fix an erroneous sanity check in get_dmif_switch_time_us() Date: Mon, 29 May 2023 09:18:54 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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?1767212718925827246?= X-GMAIL-MSGID: =?utf-8?q?1767212718925827246?= It is likely that there is a typo in the sanity check for 'v_total'. If it is 0, then 'pixels_per_frame' will also be 0, and in this case, we also return 'single_frame_time_multiplier * min_single_frame_time_us'. So test for !v_total which looks much more logical. Fixes: 4562236b3bc0 ("drm/amd/dc: Add dc display driver (v2)") Signed-off-by: Christophe JAILLET --- drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c b/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c index 4cdd4dacb761..091f0d68a045 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c @@ -683,7 +683,7 @@ static uint32_t get_dmif_switch_time_us( /*return double of frame time*/ const uint32_t single_frame_time_multiplier = 2; - if (!h_total || v_total || !pix_clk_khz) + if (!h_total || !v_total || !pix_clk_khz) return single_frame_time_multiplier * min_single_frame_time_us; /*TODO: should we use pixel format normalized pixel clock here?*/ From patchwork Mon May 29 07:18:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 100129 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1335535vqr; Mon, 29 May 2023 00:30:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6gpE6+FaYBbYjkoE9hTlqqdmz+lQUHg42/RHJx+xBj0OBtLesql2pIybOELknqp8R/5Tni X-Received: by 2002:a17:903:230c:b0:1af:9c18:a160 with SMTP id d12-20020a170903230c00b001af9c18a160mr11010906plh.17.1685345410077; Mon, 29 May 2023 00:30:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685345410; cv=none; d=google.com; s=arc-20160816; b=qxTbU5A/wuuD1wOiqlwFjQijH9ake31AoV+aTNUgKw9SSOyiuoPva5Txqy3rfeIotJ PDxGhSgT/IKU2a2Fw3NUBbalIXfc91iFh9zJa+TZ3rIPjklcpm0gJFHf3lUtONbqnSvz c3YvT/SzuoRU5Q6eOOWU3cwVOkaYcRN8eJ/I5LrhH9Jq2kJvjxFYlUZxjufzl/DakKUa XRQjrmYoYwMmZCN9ajR5C4BhV69kzUtuadybY3VkNtcIZcz/bjOGM4mAqpnpw4s5B6WP m1Ttc6BzZqAYcuXuhsBH8oyQtE6o03j/bXSimTOujNqGX1aa4InfJVsACczIQXJmPmD5 /thA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=E29VI58F9t8lbiMbudotJ9ysUUBZknzo+5bxInVW578=; b=LLqZGFAjA9y5kv0FgnYg/6UjmlvdjZWiareyJzdp9eeMUjrRRd6+AWjIq5vut3BD2d ukcxJADcvDXRzaahAJrKFD6X8D1W3Vx0jM2qi9fLPyyQBGpmoBG5N9Sm8+tGQx5FRejW sko/waFnIpDup1zhLtbF/GFf+U4svn7EXDsMue0bpps92hN51z8MqwsZ1uMuC0nDqvLu L/vy+hc96xP35BIbNUtHgorYpJFM0SkV+S95yrny8Tc8zySngtWCHjoKHdtfyPB1hNr7 cx5U72QamYvKd8pRxYkGq5bboaHZJfEXm8F1jQfUXoNI9act7Y/zCnfWenr/QxMiVg71 pOOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b="qN2RdXC/"; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i6-20020a1709026ac600b001ae38227983si5079754plt.199.2023.05.29.00.29.56; Mon, 29 May 2023 00:30:10 -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=@wanadoo.fr header.s=t20230301 header.b="qN2RdXC/"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231350AbjE2HTP (ORCPT + 99 others); Mon, 29 May 2023 03:19:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230512AbjE2HTL (ORCPT ); Mon, 29 May 2023 03:19:11 -0400 Received: from smtp.smtpout.orange.fr (smtp-30.smtpout.orange.fr [80.12.242.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10C8DA6 for ; Mon, 29 May 2023 00:19:09 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id 3X9eqYgEzMDzt3X9oq4QNQ; Mon, 29 May 2023 09:19:08 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1685344748; bh=E29VI58F9t8lbiMbudotJ9ysUUBZknzo+5bxInVW578=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=qN2RdXC/1SfqjAN9PDebvToRpP+JJUk8Q6FA4M43mFXtgHgv0S+f9x8BrEfyJZ44v mtS4PdX+9TjiYH+BNk64ndNK/Ckh2i5e6HYPe7JvC5eyR7vhJiDCWSCrkLW6IRGsti 4SbpZPIOkkBBr7xntU7liZnyPVJiF7mWgIksIwA3ms5JM7fsRK4Z5j0IJuIuFPi4rB rfVPxOjaTrYe/94URzYk1vwNsONPBvEQ7qOSB8Ik7Tz2YlnOHjqwVnq437SS7RmZeL xBlZ05K7U4aOtAjKzaQnJdRGcfQaCyE1b6xVOIiTFfCpG6wSLH9XXT4nbw/XPv1Y+L PT7MiJgsJiDfQ== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 29 May 2023 09:19:08 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 2/3] drm/amd/display: Simplify get_dmif_switch_time_us() Date: Mon, 29 May 2023 09:18:55 +0200 Message-Id: <1ab1210048a4b485247cccba6721f1885c986331.1685342739.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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?1767212749084183601?= X-GMAIL-MSGID: =?utf-8?q?1767212749084183601?= Thanks to the sanity check a few lines above: if (!h_total || !v_total || !pix_clk_khz) and the computation done afterwards on these non 0 values, we know that 'pixels_per_second', 'pixels_per_frame' and 'refresh_rate' are not 0 The code can be simplified accordingly. Signed-off-by: Christophe JAILLET --- NOT compile tested. Because of some BROKEN in KConfig files. --- drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c b/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c index 091f0d68a045..eafe8561e55e 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c @@ -690,21 +690,8 @@ static uint32_t get_dmif_switch_time_us( pixels_per_second = pix_clk_khz * 1000; pixels_per_frame = h_total * v_total; - if (!pixels_per_second || !pixels_per_frame) { - /* avoid division by zero */ - ASSERT(pixels_per_frame); - ASSERT(pixels_per_second); - return single_frame_time_multiplier * min_single_frame_time_us; - } - refresh_rate = pixels_per_second / pixels_per_frame; - if (!refresh_rate) { - /* avoid division by zero*/ - ASSERT(refresh_rate); - return single_frame_time_multiplier * min_single_frame_time_us; - } - frame_time = us_in_sec / refresh_rate; if (frame_time < min_single_frame_time_us) From patchwork Mon May 29 07:18:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 100126 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1335120vqr; Mon, 29 May 2023 00:29:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5znvYoUZ7jcaHpBFenqlEUsS8kxJmOxj+xw6UCCj1+tgBhfrgkLzZ3PV5Q195p+dubp4Rm X-Received: by 2002:a05:6a00:2313:b0:645:834c:f521 with SMTP id h19-20020a056a00231300b00645834cf521mr7512036pfh.17.1685345346377; Mon, 29 May 2023 00:29:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685345346; cv=none; d=google.com; s=arc-20160816; b=cZtQtz+QxBrw/dxJASIZXQ6roPBmvcVWaGCj74/usyOizKMaGZjoi2zChWA3TiYwqh O/vV8dSjB7VKBD6PfWwx51it4D7VahmtSHcCzqyLHhac9cNln/Xlw0KZRAtMS/buF99/ Ffu5DXkiy6I9THO/E7TJQVRVbOpiCBHiIbQlgxt6nqhTQJAS54z/WBTiBocsteVxVfrm wtHEo1MS2/OgtuUoLcX3Fp6LdK/Q18g/dJKUV9CiRN+KeZLpJaW+OTlzZ7aStgDX9jkL h85jqp8l6qJ6jxxTbc1CDtbyAIt5URHVPFRXqYsGcFFswVa0ChlFlqe1FhXMCWt94Q+k zX6w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QHA/Y0t0+ZEe+OD0y5zfwImt3ZyVK3OrMC3Z9s2pa1M=; b=UPj7U29ANKH7wrPqxHe/0g/tUvCf4bvF+ANTmkfKXiKeT6bs+hjb+TRpbK/KpLNIbo gc0Tl2YhIhDGD57iuOkyOHMipmKXTf3n11owlboqQAIhPog37qeNtlC3h5UNq81U9oFC 4SY5R5VUXq6fdMdUk5FaVaJBKCboFON2ljg0hnlYekAc6bk8bcFlGbGyrKSWeXP7DOZZ HdmP8iHq6sRZr9lZxG9HZ2g6yTQwavcNtM9zben05IZsxiAcdm4y8YfjE36/t1YQw5CY XeRqUBna3KbVrBtYRNOEGicbAbykV0GxM5erTCTZE0AFo1trPMvKW8WrGQ82hVnA2iqA rVnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=W7r6xtOw; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b74-20020a63344d000000b005346c49e06csi8875426pga.834.2023.05.29.00.28.52; Mon, 29 May 2023 00:29:06 -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=@wanadoo.fr header.s=t20230301 header.b=W7r6xtOw; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231438AbjE2HTX (ORCPT + 99 others); Mon, 29 May 2023 03:19:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231447AbjE2HTU (ORCPT ); Mon, 29 May 2023 03:19:20 -0400 Received: from smtp.smtpout.orange.fr (smtp-30.smtpout.orange.fr [80.12.242.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25D67AF for ; Mon, 29 May 2023 00:19:17 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id 3X9eqYgEzMDzt3X9vq4QNv; Mon, 29 May 2023 09:19:15 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1685344755; bh=QHA/Y0t0+ZEe+OD0y5zfwImt3ZyVK3OrMC3Z9s2pa1M=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=W7r6xtOwhhzprrKfnZGh0T9qW6D98nODcTPYdrrsDy8UKp9fEcacSAXQkx7QVuWsz vE44t8MRi8+dK7gLek1AWrWxPl2qATJxc8HrbjAGOwLvfuSOuHMg8DP6xMcVD+Q/hF /zkkum9tvQek+TK7Z7XtphlqTNEWEXI55kvwobij7TzAVfmh+PJgyMsTYhyjUXYimY Evlsvd/Mq++SUL8fVPRhVdmAdbSLzHn0uzjvyRgyt9LioGM/9JBO4zihT7xxKHZ/If NW7ybU0zzERVByEtGA9ueYwMHYxdLYXlp9F7FUWyRqUTynkURq6ySZq3E7kKqkpFHx sSecbvRt+wSiw== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 29 May 2023 09:19:15 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 3/3] drm/amd/display: Use USEC_PER_SEC Date: Mon, 29 May 2023 09:18:56 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE 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?1767212682019717660?= X-GMAIL-MSGID: =?utf-8?q?1767212682019717660?= Use USEC_PER_SEC instead of defining an equivalent local 'us_in_sec'. Signed-off-by: Christophe JAILLET --- NOT compile tested. Because of some BROKEN in KConfig files. Some header may be missing for USEC_PER_SEC! --- drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c b/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c index eafe8561e55e..9b82ee3e06d0 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c @@ -678,7 +678,6 @@ static uint32_t get_dmif_switch_time_us( uint32_t pixels_per_second; uint32_t pixels_per_frame; uint32_t refresh_rate; - const uint32_t us_in_sec = 1000000; const uint32_t min_single_frame_time_us = 30000; /*return double of frame time*/ const uint32_t single_frame_time_multiplier = 2; @@ -691,8 +690,7 @@ static uint32_t get_dmif_switch_time_us( pixels_per_frame = h_total * v_total; refresh_rate = pixels_per_second / pixels_per_frame; - - frame_time = us_in_sec / refresh_rate; + frame_time = USEC_PER_SEC / refresh_rate; if (frame_time < min_single_frame_time_us) frame_time = min_single_frame_time_us;