summaryrefslogtreecommitdiff
path: root/scripts/cleanpatch
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2025-01-31 12:21:14 +0300
committerThomas Zimmermann <tzimmermann@suse.de>2025-02-03 16:01:15 +0300
commit6af7e16c4d818c0d019c0cdb4eb12da6dc720b57 (patch)
tree19628f749f5e3972b01b90e5e3a7d4ae98bc35c0 /scripts/cleanpatch
parentd86f6beed067309eeea8bf7c91d967f310db98df (diff)
downloadlinux-6af7e16c4d818c0d019c0cdb4eb12da6dc720b57.tar.xz
drm/ast: astdp: Look up mode index from table
Replace the large switch statement with a look-up table when selecting the mode index. Makes the code easier to read. The table is sorted by resolutions; if run-time overhead from traversal becomes significant, binary search would be a possible optimization. The mode index requires a refresh-rate index to be added or subtracted, which still requires a minimal switch. In the original code, some of the indices did not contain this computation. Those cases would have been equivalent to adding 0, so they are now all subsumed in the switch's default branch. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Suggested-by: Jocelyn Falempe <jfalempe@redhat.com> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> v3: - explain the semantics of the new switch statement (Jocelyn) Link: https://patchwork.freedesktop.org/patch/msgid/20250131092257.115596-15-tzimmermann@suse.de
Diffstat (limited to 'scripts/cleanpatch')
0 files changed, 0 insertions, 0 deletions