123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- typedef struct {
- uint16_t width;
- uint16_t height;
- } RES_TABLE;
- typedef struct {
- uint8_t ratio; /* 0 -> 16:10, 1 -> 4:3, 2 -> 5:4, 3 -> 16:9 */
- uint8_t matrix[17];
- } TABLE_A;
- typedef struct {
- uint8_t ratio;
- uint8_t matrix[9];
- } TABLE_B;
- typedef struct {
- uint8_t ratio;
- uint8_t matrix[13];
- } TABLE_D;
- typedef struct {
- uint8_t ratio;
- uint8_t matrix[5];
- } TABLE_LIMIT;
- static const uint8_t nv_pattern[4] = {0x44, 0x01, 0x04, 0x00};
- static const uint8_t nv_string[4] = "NVID";
- #define NV_TOTAL_RESOLUTIONS 11
- static const RES_TABLE nv_resolution[NV_TOTAL_RESOLUTIONS] = {
- {1280, 720}, {1280, 800}, {1360, 768}, {1400, 1050}, {1440, 900},
- {1600, 900}, {1600, 1200}, {1680, 1050}, {1920, 1080}, {1920, 1200},
- {2048, 1536}
- };
- static const uint8_t nv_sample0[] = {
- 0x34, 0x2d, 0x27, 0x28, 0x90, 0x2b, 0xa0, 0xbf, 0x9c, 0x8f, 0x96,
- 0xb9, 0x8e, 0x1f, 0x00, 0x00, 0x00
- };
- static const TABLE_A nv_key0[] = {
- {3, {0x16, 0xCB, 0x9F, 0x9F, 0x8F, 0xA7, 0x17, 0xEA, 0xD2, 0xCF, 0xCF, 0xEB, 0x47, 0xE0, 0xC0, 0x00, 0x01}},
- {0, {0x12, 0xCD, 0x9F, 0x9F, 0x91, 0xA9, 0x1A, 0x3A, 0x21, 0x1F, 0x1F, 0x3B, 0x44, 0xFE, 0xC0, 0x00, 0x01}},
- {3, {0x16, 0xB9, 0xA9, 0x9F, 0x8F, 0xB2, 0x16, 0x14, 0x01, 0xFF, 0xCF, 0xEB, 0x46, 0xEA, 0xC0, 0x00, 0x01}},
- {1, {0x12, 0xE6, 0xAE, 0xAE, 0x8A, 0xBB, 0x8E, 0x3D, 0x1B, 0x19, 0x19, 0x3E, 0x0E, 0x00, 0xC0, 0x24, 0x12}},
- {0, {0x12, 0xE9, 0xB3, 0xB3, 0x8D, 0xBF, 0x92, 0xA3, 0x85, 0x83, 0x83, 0xA4, 0x48, 0xFE, 0xC0, 0x00, 0x00}},
- {3, {0x1A, 0xD7, 0xC7, 0xC7, 0x9B, 0xCD, 0x11, 0x9C, 0x86, 0x83, 0x83, 0x9D, 0x4B, 0xFE, 0xC0, 0x00, 0x00}},
- {1, {0x12, 0x03, 0xC7, 0xC7, 0x87, 0xD1, 0x09, 0xE0, 0xB1, 0xAF, 0xAF, 0xE1, 0x04, 0x00, 0x01, 0x24, 0x13}},
- {0, {0x12, 0x15, 0xD1, 0xD1, 0x99, 0xE0, 0x17, 0x3D, 0x1B, 0x19, 0x19, 0x3E, 0x0E, 0x00, 0x01, 0x24, 0x13}},
- {3, {0x16, 0x0E, 0xEF, 0x9F, 0x8F, 0xFD, 0x02, 0x63, 0x3B, 0x37, 0xCF, 0xEB, 0x40, 0x00, 0xC1, 0x24, 0x02}},
- {0, {0x12, 0x3F, 0xEF, 0xEF, 0x83, 0x01, 0x1B, 0xD8, 0xB1, 0xAF, 0xAF, 0xD9, 0x04, 0x00, 0x41, 0x25, 0x12}},
- {1, {0x12, 0x63, 0xFF, 0xFF, 0x9D, 0x12, 0x0E, 0x34, 0x01, 0x00, 0x00, 0x35, 0x44, 0xE0, 0x41, 0x25, 0x13}}
- };
- static uint8_t nv_sample1[] =
- {0x28, 0x00, 0x19, 0x00, 0x28, 0x18, 0x08, 0x08, 0x05};
- static const TABLE_B nv_key1[] = {
- {3, {0x00, 0x05, 0xD0, 0x02, 0xA0, 0x2C, 0x10, 0x07, 0x05}},
- {0, {0x00, 0x05, 0x20, 0x03, 0xA0, 0x32, 0x10, 0x23, 0x05}},
- {3, {0x50, 0x05, 0x00, 0x03, 0xAA, 0x2F, 0x10, 0x07, 0x05}},
- {1, {0x78, 0x05, 0x1A, 0x04, 0xAF, 0x4A, 0x0E, 0x21, 0x05}},
- {0, {0xA0, 0x05, 0x84, 0x03, 0xB4, 0x38, 0x10, 0x24, 0x05}},
- {3, {0x40, 0x06, 0x84, 0x03, 0xC8, 0x38, 0x10, 0x27, 0x05}},
- {1, {0x40, 0x06, 0xB0, 0x04, 0xC8, 0x4A, 0x10, 0x19, 0x05}},
- {0, {0x90, 0x06, 0x1A, 0x04, 0xD2, 0x41, 0x10, 0x25, 0x05}},
- {3, {0x80, 0x07, 0x38, 0x04, 0xF0, 0x42, 0x10, 0x07, 0x05}},
- {0, {0x80, 0x07, 0xB0, 0x04, 0xF0, 0x4B, 0x10, 0x26, 0x05}},
- {1, {0x00, 0x08, 0x00, 0x06, 0x00, 0x60, 0x10, 0x22, 0x05}}
- };
- static const uint8_t nv_sample2[] =
- {0x82, 0x0f, 0x03, 0x01, 0x00, 0x00, 0x08, 0x04, 0x14, 0x00, 0x00, 0x08, 0x17};
- static const TABLE_D nv_key2[] = {
- {3, {0x7B, 0x01, 0x03, 0x7B, 0x01, 0x08, 0x01, 0x20, 0x80, 0x02, 0xFF, 0xFF, 0x20}},
- {0, {0x61, 0x01, 0x03, 0x61, 0x01, 0x08, 0x01, 0x20, 0x80, 0x02, 0xFF, 0xFF, 0x20}},
- {3, {0x4D, 0x01, 0x03, 0x4D, 0x01, 0x08, 0x01, 0x20, 0xA8, 0x02, 0xFF, 0xFF, 0x20}},
- {1, {0x49, 0x01, 0x03, 0x49, 0x01, 0x08, 0x01, 0x20, 0xBC, 0x02, 0xFF, 0xFF, 0x20}},
- {0, {0x65, 0x01, 0x03, 0x65, 0x01, 0x08, 0x01, 0x20, 0xD0, 0x02, 0xFF, 0xFF, 0x20}},
- {3, {0x67, 0x01, 0x03, 0x67, 0x01, 0x08, 0x01, 0x20, 0x20, 0x03, 0xFF, 0xFF, 0x20}},
- {1, {0x4A, 0x01, 0x03, 0x4A, 0x01, 0x08, 0x01, 0x20, 0x20, 0x03, 0xFF, 0xFF, 0x20}},
- {0, {0x69, 0x01, 0x03, 0x69, 0x01, 0x08, 0x01, 0x20, 0x48, 0x03, 0xFF, 0xFF, 0x20}},
- {3, {0x4D, 0x01, 0x03, 0x4D, 0x01, 0x08, 0x01, 0x20, 0xC0, 0x03, 0xFF, 0xFF, 0x20}},
- {0, {0x7D, 0x01, 0x03, 0x7D, 0x01, 0x08, 0x01, 0x20, 0xC0, 0x03, 0xFF, 0xFF, 0x20}},
- {1, {0x7A, 0x01, 0x03, 0x52, 0x01, 0x08, 0x01, 0x20, 0x00, 0x04, 0xFF, 0xFF, 0x20}}
- };
- static const uint8_t nv_sample3[] = {0x40, 0x06, 0xba, 0xb0, 0x04};
- static const TABLE_LIMIT nv_key3[] = {
- {3, {0x00, 0x05, 0xBA, 0xD0, 0x02}},
- {0, {0x00, 0x05, 0xBA, 0x20, 0x03}},
- {3, {0x50, 0x05, 0xBA, 0x00, 0x03}},
- {1, {0x78, 0x05, 0xBA, 0x1A, 0x04}},
- {0, {0xA0, 0x05, 0xBA, 0x84, 0x03}},
- {3, {0x40, 0x06, 0xBA, 0x84, 0x03}},
- {1, {0x40, 0x06, 0xBA, 0xB0, 0x04}},
- {0, {0x90, 0x06, 0xBA, 0x1A, 0x04}},
- {3, {0x80, 0x07, 0xBA, 0x38, 0x04}},
- {0, {0x80, 0x07, 0xBA, 0xB0, 0x04}},
- {1, {0x00, 0x08, 0xBA, 0x00, 0x06}}
- };
- typedef struct {
- int16_t reserved1;
- int16_t reserved2;
- int16_t reserved3;
- } NV_RESERVED;
- typedef struct {
- uint8_t major;
- uint8_t minor;
- uint8_t rev;
- uint8_t size;
- } NV_COMMON_TABLE_HEADER;
- typedef struct {
- uint16_t pixel_clock;
- uint16_t h_active;
- NV_RESERVED reserved1;
- uint16_t h_sync_start;
- uint16_t h_sync_end;
- uint16_t h_total;
- uint16_t v_active;
- NV_RESERVED reserved2;
- uint16_t v_sync_start;
- uint16_t v_sync_end;
- uint16_t v_total;
- uint16_t reserved3;
- } NV_MODELINE;
- typedef struct {
- NV_COMMON_TABLE_HEADER header;
- NV_MODELINE * modelines;
- } NV_VESA_TABLE;
- #define OFFSET_TO_VESA_TABLE_INDEX 2
|