diff --git a/src/ctl/wfd.c b/src/ctl/wfd.c index 90eda97..1d9fb49 100644 --- a/src/ctl/wfd.c +++ b/src/ctl/wfd.c @@ -23,82 +23,76 @@ #include "ctl.h" -struct resolution_bitmap { - int index; - int hres; - int vres; - int fps; -}; /* * CEA resolutions and refrash rate bitmap/index table * also used in native resolution field */ -struct resolution_bitmap resolutions_cea[] = { - {0, 640, 480, 60}, /* p60 */ - {1, 720, 480, 60}, /* p60 */ - {2, 720, 480, 60}, /* i60 */ - {3, 720, 576, 50}, /* p50 */ - {4, 720, 576, 50}, /* i50 */ - {5, 1280, 720, 30}, /* p30 */ - {6, 1280, 720, 60}, /* p60 */ - {7, 1920, 1080, 30}, /* p30 */ - {8, 1920, 1080, 60}, /* p60 */ - {9, 1920, 1080, 60}, /* i60 */ - {10, 1280, 720, 25}, /* p25 */ - {11, 1280, 720, 50}, /* p50 */ - {12, 1920, 1080, 25}, /* p25 */ - {13, 1920, 1080, 50}, /* p50 */ - {14, 1920, 1080, 50}, /* i50 */ - {15, 1280, 720, 24}, /* p24 */ - {16, 1920, 1080, 24}, /* p24 */ +static const struct wfd_resolution resolutions_cea[] = { + {0, 640, 480, 60, 1}, /* p60 */ + {1, 720, 480, 60, 1}, /* p60 */ + {2, 720, 480, 60, 0}, /* i60 */ + {3, 720, 576, 50, 1}, /* p50 */ + {4, 720, 576, 50, 0}, /* i50 */ + {5, 1280, 720, 30, 1}, /* p30 */ + {6, 1280, 720, 60, 1}, /* p60 */ + {7, 1920, 1080, 30, 1}, /* p30 */ + {8, 1920, 1080, 60, 1}, /* p60 */ + {9, 1920, 1080, 60, 0}, /* i60 */ + {10, 1280, 720, 25, 1}, /* p25 */ + {11, 1280, 720, 50, 1}, /* p50 */ + {12, 1920, 1080, 25, 1}, /* p25 */ + {13, 1920, 1080, 50, 1}, /* p50 */ + {14, 1920, 1080, 50, 0}, /* i50 */ + {15, 1280, 720, 24, 1}, /* p24 */ + {16, 1920, 1080, 24, 1}, /* p24 */ }; -struct resolution_bitmap resolutions_vesa[] = { - {0, 800, 600, 30}, /* p30 */ - {1, 800, 600, 60}, /* p60 */ - {2, 1024, 768, 30}, /* p30 */ - {3, 1024, 768, 60}, /* p60 */ - {4, 1152, 854, 30}, /* p30 */ - {5, 1152, 854, 60}, /* p60 */ - {6, 1280, 768, 30}, /* p30 */ - {7, 1280, 768, 60}, /* p60 */ - {8, 1280, 800, 30}, /* p30 */ - {9, 1280, 800, 60}, /* p60 */ - {10, 1360, 768, 30}, /* p30 */ - {11, 1360, 768, 60}, /* p60 */ - {12, 1366, 768, 30}, /* p30 */ - {13, 1366, 768, 60}, /* p60 */ - {14, 1280, 1024, 30}, /* p30 */ - {15, 1280, 1024, 60}, /* p60 */ - {16, 1440, 1050, 30}, /* p30 */ - {17, 1440, 1050, 60}, /* p60 */ - {18, 1440, 900, 30}, /* p30 */ - {19, 1440, 900, 60}, /* p60 */ - {20, 1600, 900, 30}, /* p30 */ - {21, 1600, 900, 60}, /* p60 */ - {22, 1600, 1200, 30}, /* p30 */ - {23, 1600, 1200, 60}, /* p60 */ - {24, 1680, 1024, 30}, /* p30 */ - {25, 1680, 1024, 60}, /* p60 */ - {26, 1680, 1050, 30}, /* p30 */ - {27, 1680, 1050, 60}, /* p60 */ - {28, 1920, 1200, 30}, /* p30 */ +static const struct wfd_resolution resolutions_vesa[] = { + {0, 800, 600, 30, 1}, /* p30 */ + {1, 800, 600, 60, 1}, /* p60 */ + {2, 1024, 768, 30, 1}, /* p30 */ + {3, 1024, 768, 60, 1}, /* p60 */ + {4, 1152, 854, 30, 1}, /* p30 */ + {5, 1152, 854, 60, 1}, /* p60 */ + {6, 1280, 768, 30, 1}, /* p30 */ + {7, 1280, 768, 60, 1}, /* p60 */ + {8, 1280, 800, 30, 1}, /* p30 */ + {9, 1280, 800, 60, 1}, /* p60 */ + {10, 1360, 768, 30, 1}, /* p30 */ + {11, 1360, 768, 60, 1}, /* p60 */ + {12, 1366, 768, 30, 1}, /* p30 */ + {13, 1366, 768, 60, 1}, /* p60 */ + {14, 1280, 1024, 30, 1}, /* p30 */ + {15, 1280, 1024, 60, 1}, /* p60 */ + {16, 1440, 1050, 30, 1}, /* p30 */ + {17, 1440, 1050, 60, 1}, /* p60 */ + {18, 1440, 900, 30, 1}, /* p30 */ + {19, 1440, 900, 60, 1}, /* p60 */ + {20, 1600, 900, 30, 1}, /* p30 */ + {21, 1600, 900, 60, 1}, /* p60 */ + {22, 1600, 1200, 30, 1}, /* p30 */ + {23, 1600, 1200, 60, 1}, /* p60 */ + {24, 1680, 1024, 30, 1}, /* p30 */ + {25, 1680, 1024, 60, 1}, /* p60 */ + {26, 1680, 1050, 30, 1}, /* p30 */ + {27, 1680, 1050, 60, 1}, /* p60 */ + {28, 1920, 1200, 30, 1}, /* p30 */ }; -struct resolution_bitmap resolutions_hh[] = { - {0, 800, 480, 30}, /* p30 */ - {1, 800, 480, 60}, /* p60 */ - {2, 854, 480, 30}, /* p30 */ - {3, 854, 480, 60}, /* p60 */ - {4, 864, 480, 30}, /* p30 */ - {5, 864, 480, 60}, /* p60 */ - {6, 640, 360, 30}, /* p30 */ - {7, 640, 360, 60}, /* p60 */ - {8, 960, 540, 30}, /* p30 */ - {9, 960, 540, 60}, /* p60 */ - {10, 848, 480, 30}, /* p30 */ - {11, 848, 480, 60}, /* p60 */ +static const struct wfd_resolution resolutions_hh[] = { + {0, 800, 480, 30, 1}, /* p30 */ + {1, 800, 480, 60, 1}, /* p60 */ + {2, 854, 480, 30, 1}, /* p30 */ + {3, 854, 480, 60, 1}, /* p60 */ + {4, 864, 480, 30, 1}, /* p30 */ + {5, 864, 480, 60, 1}, /* p60 */ + {6, 640, 360, 30, 1}, /* p30 */ + {7, 640, 360, 60, 1}, /* p60 */ + {8, 960, 540, 30, 1}, /* p30 */ + {9, 960, 540, 60, 1}, /* p60 */ + {10, 848, 480, 30, 1}, /* p30 */ + {11, 848, 480, 60, 1}, /* p60 */ }; void wfd_print_resolutions(void) diff --git a/src/ctl/wfd.h b/src/ctl/wfd.h index 2d85111..bf23f3b 100644 --- a/src/ctl/wfd.h +++ b/src/ctl/wfd.h @@ -21,6 +21,15 @@ #ifndef WFD_H #define WFD_H +struct wfd_resolution +{ + uint16_t index; + uint16_t hres; + uint16_t vres; + uint16_t fps; + bool progressive: 1; +}; + void wfd_print_resolutions(void); int vfd_get_cea_resolution(uint32_t mask, int *hres, int *vres); int vfd_get_vesa_resolution(uint32_t mask, int *hres, int *vres);