util: store number of colors for indexed formats
authorGeert Uytterhoeven <geert@linux-m68k.org>
Thu, 30 Jun 2022 13:21:57 +0000 (15:21 +0200)
committerGeert Uytterhoeven <geert@linux-m68k.org>
Tue, 24 Oct 2023 07:44:21 +0000 (09:44 +0200)
commit8134deb31f5220922f8dd5ea9a0e0bfb6f85a487
treeacca64bd5bd05d478381a9188475febc96b3e969
parent236766b0b3eda0271fd378af52afc19d6f8e1531
util: store number of colors for indexed formats

Store the number of available colors for color-indexed frame
buffer formats in the format_info[] array.  This avoids the need of test
code for having to use switch statements all the time to obtain the
number of colors, or to check if a mode is color-indexed or not.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
v5:
  - Add Reviewed-by,

v4:
  - No changes,

v3:
  - Add Acked-by,

v2:
  - New.
tests/util/format.c
tests/util/format.h