diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2025-01-31 10:21:14 +0100 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2025-02-03 14:01:15 +0100 |
commit | 6af7e16c4d818c0d019c0cdb4eb12da6dc720b57 (patch) | |
tree | 19628f749f5e3972b01b90e5e3a7d4ae98bc35c0 /tools/perf/scripts/python/export-to-sqlite.py | |
parent | d86f6beed067309eeea8bf7c91d967f310db98df (diff) |
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 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions