mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kuan-Wei Chiu <visitorckw@gmail.com>
To: austin.zheng@amd.com, jun.lei@amd.com, harry.wentland@amd.com,
	sunpeng.li@amd.com, alexander.deucher@amd.com,
	christian.koenig@amd.com, airlied@gmail.com, simona@ffwll.ch,
	siqueira@igalia.com, alex.hung@amd.com, aurabindo.pillai@amd.com
Cc: chiahsuan.chung@amd.com, nicholas.kazlauskas@amd.com,
	wenjing.liu@amd.com, jserv@ccns.ncku.edu.tw,
	amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Kuan-Wei Chiu <visitorckw@gmail.com>
Subject: [PATCH v2 0/2] drm/amd/display: optimize reserved time candidates handling
Date: Tue,  9 Sep 2025 17:20:55 +0800	[thread overview]
Message-ID: <20250909092057.473907-1-visitorckw@gmail.com> (raw)

Optimize the handling of reserved time candidates by replacing the
custom bubble sort with the kernel's standard sort() and rewriting
duplicate removal with a linear-time fast/slow pointer method. The
changes improve sorting from O(N^2) to O(N log N) and duplicate removal
from O(N^2) to O(N), reducing computational overhead and eliminating
hand-rolled implementations, while correctness has been verified with
simple unit tests.
---
Changes from v1:
- Add early return when *list_a_size = 0 to fix a corner case.

v1: https://lore.kernel.org/lkml/20250824182359.142050-1-visitorckw@gmail.com

Kuan-Wei Chiu (2):
  drm/amd/display: Optimize reserved time candidates sorting using
    standard sort()
  drm/amd/display: Optimize remove_duplicates() from O(N^2) to O(N)

 .../dml2/dml21/src/dml2_pmo/dml2_pmo_dcn3.c   | 44 ++++++++++---------
 1 file changed, 24 insertions(+), 20 deletions(-)

-- 
2.34.1


             reply	other threads:[~2025-09-09  9:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-09  9:20 Kuan-Wei Chiu [this message]
2025-09-09  9:20 ` [PATCH v2 1/2] drm/amd/display: Optimize reserved time candidates sorting using standard sort() Kuan-Wei Chiu
2025-09-09  9:20 ` [PATCH v2 2/2] drm/amd/display: Optimize remove_duplicates() from O(N^2) to O(N) Kuan-Wei Chiu
2025-09-22 18:06   ` Alex Hung

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250909092057.473907-1-visitorckw@gmail.com \
    --to=visitorckw@gmail.com \
    --cc=airlied@gmail.com \
    --cc=alex.hung@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=aurabindo.pillai@amd.com \
    --cc=austin.zheng@amd.com \
    --cc=chiahsuan.chung@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=harry.wentland@amd.com \
    --cc=jserv@ccns.ncku.edu.tw \
    --cc=jun.lei@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicholas.kazlauskas@amd.com \
    --cc=simona@ffwll.ch \
    --cc=siqueira@igalia.com \
    --cc=sunpeng.li@amd.com \
    --cc=wenjing.liu@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®