summaryrefslogblamecommitdiffstats
path: root/qemu-edid.c
blob: 1db3372b982cf33d672669f66e4386e4ec0b872e (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11






                                                                            



                            



                                               




























                                                                      
                       











































                                                                          
                                                           

























                                                              


                                                          






                                                  
/*
 * QEMU EDID test tool.
 *
 * This work is licensed under the terms of the GNU GPL, version 2 or later.
 * See the COPYING file in the top-level directory.
 */
#include "qemu/osdep.h"
#include "qemu/bswap.h"
#include "qemu/cutils.h"
#include "hw/display/edid.h"

static qemu_edid_info info = (qemu_edid_info) {
    .prefx = 1024,
    .prefy = 768,
};

static void usage(FILE *out)
{
    fprintf(out,
            "\n"
            "This is a test tool for the qemu edid generator.\n"
            "\n"
            "Typically you'll pipe the output into edid-decode\n"
            "to check if the generator works correctly.\n"
            "\n"
            "usage: qemu-edid <options>\n"
            "options:\n"
            "    -h             print this text\n"
            "    -o <file>      set output file (stdout by default)\n"
            "    -v <vendor>    set monitor vendor (three letters)\n"
            "    -n <name>      set monitor name\n"
            "    -s <serial>    set monitor serial\n"
            "    -d <dpi>       set display resolution\n"
            "    -x <prefx>     set preferred width\n"
            "    -y <prefy>     set preferred height\n"
            "    -X <maxx>      set maximum width\n"
            "    -Y <maxy>      set maximum height\n"
            "\n");
}

int main(int argc, char *argv[])
{
    FILE *outfile = NULL;
    uint8_t blob[256];
    uint32_t dpi = 100;
    int rc;

    for (;;) {
        rc = getopt(argc, argv, "ho:x:y:X:Y:d:v:n:s:");
        if (rc == -1) {
            break;
        }
        switch (rc) {
        case 'o':
            if (outfile) {
                fprintf(stderr, "outfile specified twice\n");
                exit(1);
            }
            outfile = fopen(optarg, "w");
            if (outfile == NULL) {
                fprintf(stderr, "open %s: %s\n", optarg, strerror(errno));
                exit(1);
            }
            break;
        case 'x':
            if (qemu_strtoui(optarg, NULL, 10, &info.prefx) < 0) {
                fprintf(stderr, "not a number: %s\n", optarg);
                exit(1);
            }
            break;
        case 'y':
            if (qemu_strtoui(optarg, NULL, 10, &info.prefy) < 0) {
                fprintf(stderr, "not a number: %s\n", optarg);
                exit(1);
            }
            break;
        case 'X':
            if (qemu_strtoui(optarg, NULL, 10, &info.maxx) < 0) {
                fprintf(stderr, "not a number: %s\n", optarg);
                exit(1);
            }
            break;
        case 'Y':
            if (qemu_strtoui(optarg, NULL, 10, &info.maxy) < 0) {
                fprintf(stderr, "not a number: %s\n", optarg);
                exit(1);
            }
            break;
        case 'd':
            if (qemu_strtoui(optarg, NULL, 10, &dpi) < 0) {
                fprintf(stderr, "not a number: %s\n", optarg);
                exit(1);
            }
            break;
        case 'v':
            info.vendor = optarg;
            break;
        case 'n':
            info.name = optarg;
            break;
        case 's':
            info.serial = optarg;
            break;
        case 'h':
            usage(stdout);
            exit(0);
        default:
            usage(stderr);
            exit(1);
        }
    }

    if (outfile == NULL) {
        outfile = stdout;
    }

    info.width_mm = qemu_edid_dpi_to_mm(dpi, info.prefx);
    info.height_mm = qemu_edid_dpi_to_mm(dpi, info.prefy);

    memset(blob, 0, sizeof(blob));
    qemu_edid_generate(blob, sizeof(blob), &info);
    fwrite(blob, sizeof(blob), 1, outfile);
    fflush(outfile);

    exit(0);
}
lp/qemu.git/commit/Makefile?id=3dff199cca2702846a23d7193dbd447064b60d0d'>3dff199cca ^
0c0c1fd973 ^
0ab8ed18a6 ^










3dff199cca ^



0ab8ed18a6 ^


8755b4afbd ^


0ab8ed18a6 ^

57b7bdf426 ^
0ab8ed18a6 ^







57b7bdf426 ^
0ab8ed18a6 ^







57b7bdf426 ^
0ab8ed18a6 ^






















57b7bdf426 ^
0ab8ed18a6 ^







57b7bdf426 ^
0ab8ed18a6 ^







57b7bdf426 ^
0ab8ed18a6 ^







57b7bdf426 ^
0ab8ed18a6 ^







57b7bdf426 ^
0ab8ed18a6 ^



















927128222b ^



2ec78706d1 ^
bcd5ac9bcb ^
ab8f9d49d6 ^


5a15e6b1ca ^
bcd5ac9bcb ^
e709a61a8f ^
bcd5ac9bcb ^
ed7b2624f2 ^
2ec78706d1 ^





656282d245 ^
927128222b ^

3dff199cca ^
927128222b ^


6809df1df0 ^
927128222b ^









26ce90fde5 ^



d9ace8b384 ^




bd3f5706d1 ^
7c3d1917fd ^
0cb3fb1e30 ^
fec90ff0bd ^
8c462f8ff5 ^
3e2e0e6ba8 ^
67c0f08d16 ^
d52c454aad ^


206d1b9c38 ^
7b93fadf3a ^
57589bc497 ^
d52c454aad ^


d52c454aad ^
2405f3c0d1 ^
81bfc42dcf ^
315616ed50 ^
81bfc42dcf ^

b53c54c63f ^










cc8ae6de58 ^
87c0868f46 ^


acab923dce ^
d59157ea05 ^

2544e9e4aa ^
22108f333d ^
983eef5ad7 ^
a2d8f1beb1 ^
983eef5ad7 ^
62dd1048c0 ^


cc8ae6de58 ^


aa05ae6fec ^
8cc357b5a8 ^
e0e312f352 ^

1f3d3c8fd7 ^
8bdd3d499f ^
b7c11e5749 ^
0bdb12c7c5 ^
8bdd3d499f ^
b7c11e5749 ^
bb585a784e ^


0bdb12c7c5 ^
8bdd3d499f ^
1f3d3c8fd7 ^
bd9141bb2e ^

e0e312f352 ^

f349474920 ^
bb768f71eb ^
e0e312f352 ^







21c6b0c87e ^
e0e312f352 ^
d6c1bd4a22 ^

e0e312f352 ^
b6011caff1 ^

e0e312f352 ^



12ccfec968 ^
904fe1fbd1 ^
bd9141bb2e ^

012f087923 ^





b98a3bae25 ^
012f087923 ^

a992fe3d0f ^
012f087923 ^

0bdb12c7c5 ^
a992fe3d0f ^



992aeb8eb5 ^

ba1183da9a ^



5b76dd132c ^
32d955a422 ^
ba1183da9a ^

3fa2d384c2 ^
a75eb03b9f ^

81bfc42dcf ^
a5d2f6f877 ^
7b2e5c65f4 ^
49cc0340f8 ^
406d2aa2cc ^
06914c97d3 ^
d52c454aad ^
577a67234d ^
ba1183da9a ^
cc47569881 ^
fb37726db7 ^
0c7012e055 ^
666a3af9c8 ^
cc47569881 ^
0ab8ed18a6 ^
675b9b5368 ^
ba1183da9a ^
46e7b70699 ^
992aeb8eb5 ^
d52c454aad ^
b9dea4fbc6 ^
67a1de0d19 ^

57b49737ae ^

7e563bfb8a ^
d9e73d32a8 ^




67a1de0d19 ^
1215c6e761 ^

077de81a4c ^
0bdb12c7c5 ^
1215c6e761 ^
1338a4b726 ^
916359f66f ^
1338a4b726 ^






05dfa22b5b ^
1338a4b726 ^
05dfa22b5b ^
cec7d0b6e1 ^
1338a4b726 ^




4aa4253115 ^
a540f158db ^
965f486c21 ^

a540f158db ^
3b8593eeaa ^

965f486c21 ^
a540f158db ^
00525864f2 ^
814e1110d5 ^
a540f158db ^
e219c499e9 ^











3b8593eeaa ^

9f81aeb5da ^
e219c499e9 ^
3b8593eeaa ^

daa79d9a65 ^




675b9b5368 ^
3b8593eeaa ^





1338a4b726 ^
b8d89ba83b ^
add16157d7 ^
3b8593eeaa ^
1338a4b726 ^
a9c87304b7 ^
1338a4b726 ^


c05ac895cb ^
8d358a5ea0 ^
1338a4b726 ^


47ae060e75 ^
83f6409109 ^
c17a18ef30 ^
0bdb12c7c5 ^
5354e4d242 ^
c17a18ef30 ^
3bc2f570ec ^

8a090705b4 ^
3bc2f570ec ^
ebedb37c8d ^
5f9ff1eff3 ^
3bc2f570ec ^
4fb240a495 ^

ebedb37c8d ^
0ab8ed18a6 ^
3c089e15b6 ^
153859be1a ^
5b76dd132c ^


0a8e1acd4d ^
0ab8ed18a6 ^
7b93fadf3a ^
6a021536e2 ^

72d277a70e ^

0ab8ed18a6 ^
17bff52b62 ^
5b76dd132c ^
fe8fc5ae5c ^


b855f8d175 ^
077de81a4c ^
0bdb12c7c5 ^
153859be1a ^
957f1f99f2 ^
54c2e50205 ^
640e540446 ^
6a021536e2 ^


e6c42b96b9 ^




fb0bc835e5 ^
e6c42b96b9 ^

fb0bc835e5 ^
e6c42b96b9 ^


fb0bc835e5 ^

fb0bc835e5 ^



eb815e248f ^
00ca24ff9e ^
fb0bc835e5 ^


0d6b93deee ^
fb0bc835e5 ^


e3d4d25206 ^
bf582c3461 ^



fb0bc835e5 ^
0d6b93deee ^
eb815e248f ^
fb0bc835e5 ^

e3193601c8 ^
00ca24ff9e ^
7a0b7eba4b ^
957f1f99f2 ^
0ab8ed18a6 ^
fafcaf1d74 ^
48ff7a625b ^
9dacf32d2c ^


0a18750f29 ^
9dacf32d2c ^
fafcaf1d74 ^
9dacf32d2c ^
9dacf32d2c ^

decdfbd28d ^

0bdb12c7c5 ^
9dacf32d2c ^

15b19ed85f ^
9dacf32d2c ^

fafcaf1d74 ^




1b9d35f33c ^
3fa2d384c2 ^

b1449edb79 ^
0ab8ed18a6 ^
a75eb03b9f ^
0ab8ed18a6 ^
a75eb03b9f ^
b1449edb79 ^
d59a031c7e ^
49cc0340f8 ^
406d2aa2cc ^

0f645ba16c ^

a5d2f6f877 ^

a75eb03b9f ^
4f8bde99c1 ^
2405f3c0d1 ^
81bfc42dcf ^



d52c454aad ^


06914c97d3 ^









0c0c1fd973 ^


0bdb12c7c5 ^
0c0c1fd973 ^
990e6a2754 ^







1338a4b726 ^
2d80ae8987 ^
25be210f69 ^
df2943ba3c ^
9dacf32d2c ^
23858f4092 ^




26ce90fde5 ^
0814465ab8 ^
b855f8d175 ^
07b44ce99e ^
d98bc0b654 ^
3dff199cca ^
eac236ea7b ^

3dff199cca ^
fb0bc835e5 ^
54c2e50205 ^
e92af6ec85 ^
31e31b8a24 ^
34bb443ee7 ^






5f71eac06e ^
1290e6711f ^

5f71eac06e ^

7d13299d07 ^
2cd8af2d44 ^
2038f8c877 ^
ae21935924 ^
e92af6ec85 ^
ae21935924 ^
fc8e320ef5 ^
bd3f5706d1 ^
7a734b8f68 ^

d5e85105f6 ^
26fffe29c0 ^
793553acb3 ^
67ed96f9f2 ^
d59157ea05 ^





2544e9e4aa ^
81f33401ef ^
5f71eac06e ^

0783a732f9 ^
0928523a12 ^
2b1f35b9a8 ^
bc1b050d85 ^
76bc683820 ^
d9840e2592 ^
fb8597bb65 ^
7d13299d07 ^
06e7772fbd ^
fed4a9adc0 ^
26b1cbf8b6 ^
3751e72246 ^
fed4a9adc0 ^
777553406d ^
32eb2da326 ^
7a4dfd1e4a ^
0a87fd693d ^
9eb08a435a ^
5ee8ad71e1 ^

9fd02979d7 ^

45027808cd ^
b3ce38dcf9 ^
4b387f9ee1 ^
2785dc7b17 ^
6c5359e161 ^
744a928cce ^
0c6ab8c988 ^
82e65fe01e ^
43ad25643a ^
26ce90fde5 ^
91f3a2f0ce ^



26ce90fde5 ^


777553406d ^

26ce90fde5 ^
777553406d ^

336cfef495 ^
27a296fce9 ^

5f71eac06e ^