author | Sam Lantinga <slouken@libsdl.org> |
Mon, 11 Feb 2013 18:22:32 -0800 | |
changeset 6853 | 4f26c9dfe50f |
parent 6851 | a58fc7ff4a0f |
child 6992 | e7c2c85bcf69 |
permissions | -rw-r--r-- |
6796
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
1 |
/* |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
2 |
* Copyright 2007 Red Hat, Inc. |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
3 |
* |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
4 |
* Permission is hereby granted, free of charge, to any person obtaining a |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
5 |
* copy of this software and associated documentation files (the "Software"), |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
6 |
* to deal in the Software without restriction, including without limitation |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
7 |
* on the rights to use, copy, modify, merge, publish, distribute, sub |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
8 |
* license, and/or sell copies of the Software, and to permit persons to whom |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
9 |
* the Software is furnished to do so, subject to the following conditions: |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
10 |
* |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
11 |
* The above copyright notice and this permission notice (including the next |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
12 |
* paragraph) shall be included in all copies or substantial portions of the |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
13 |
* Software. |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
14 |
* |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
15 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
16 |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
17 |
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
18 |
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
19 |
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
20 |
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
21 |
*/ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
22 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
23 |
/* Author: Soren Sandmann <sandmann@redhat.com> */ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
24 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
25 |
#include "edid.h" |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
26 |
#include <stdlib.h> |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
27 |
#include <string.h> |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
28 |
#include <math.h> |
6797
8a818a373436
Fixed compiler warnings in edid-parse.c
Sam Lantinga <slouken@libsdl.org>
parents:
6796
diff
changeset
|
29 |
#include <stdio.h> |
6796
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
30 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
31 |
#define TRUE 1 |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
32 |
#define FALSE 0 |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
33 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
34 |
static int |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
35 |
get_bit (int in, int bit) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
36 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
37 |
return (in & (1 << bit)) >> bit; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
38 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
39 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
40 |
static int |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
41 |
get_bits (int in, int begin, int end) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
42 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
43 |
int mask = (1 << (end - begin + 1)) - 1; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
44 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
45 |
return (in >> begin) & mask; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
46 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
47 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
48 |
static int |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
49 |
decode_header (const uchar *edid) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
50 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
51 |
if (memcmp (edid, "\x00\xff\xff\xff\xff\xff\xff\x00", 8) == 0) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
52 |
return TRUE; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
53 |
return FALSE; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
54 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
55 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
56 |
static int |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
57 |
decode_vendor_and_product_identification (const uchar *edid, MonitorInfo *info) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
58 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
59 |
int is_model_year; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
60 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
61 |
/* Manufacturer Code */ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
62 |
info->manufacturer_code[0] = get_bits (edid[0x08], 2, 6); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
63 |
info->manufacturer_code[1] = get_bits (edid[0x08], 0, 1) << 3; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
64 |
info->manufacturer_code[1] |= get_bits (edid[0x09], 5, 7); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
65 |
info->manufacturer_code[2] = get_bits (edid[0x09], 0, 4); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
66 |
info->manufacturer_code[3] = '\0'; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
67 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
68 |
info->manufacturer_code[0] += 'A' - 1; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
69 |
info->manufacturer_code[1] += 'A' - 1; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
70 |
info->manufacturer_code[2] += 'A' - 1; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
71 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
72 |
/* Product Code */ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
73 |
info->product_code = edid[0x0b] << 8 | edid[0x0a]; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
74 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
75 |
/* Serial Number */ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
76 |
info->serial_number = |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
77 |
edid[0x0c] | edid[0x0d] << 8 | edid[0x0e] << 16 | edid[0x0f] << 24; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
78 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
79 |
/* Week and Year */ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
80 |
is_model_year = FALSE; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
81 |
switch (edid[0x10]) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
82 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
83 |
case 0x00: |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
84 |
info->production_week = -1; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
85 |
break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
86 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
87 |
case 0xff: |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
88 |
info->production_week = -1; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
89 |
is_model_year = TRUE; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
90 |
break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
91 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
92 |
default: |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
93 |
info->production_week = edid[0x10]; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
94 |
break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
95 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
96 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
97 |
if (is_model_year) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
98 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
99 |
info->production_year = -1; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
100 |
info->model_year = 1990 + edid[0x11]; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
101 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
102 |
else |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
103 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
104 |
info->production_year = 1990 + edid[0x11]; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
105 |
info->model_year = -1; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
106 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
107 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
108 |
return TRUE; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
109 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
110 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
111 |
static int |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
112 |
decode_edid_version (const uchar *edid, MonitorInfo *info) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
113 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
114 |
info->major_version = edid[0x12]; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
115 |
info->minor_version = edid[0x13]; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
116 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
117 |
return TRUE; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
118 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
119 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
120 |
static int |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
121 |
decode_display_parameters (const uchar *edid, MonitorInfo *info) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
122 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
123 |
/* Digital vs Analog */ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
124 |
info->is_digital = get_bit (edid[0x14], 7); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
125 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
126 |
if (info->is_digital) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
127 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
128 |
int bits; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
129 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
130 |
static const int bit_depth[8] = |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
131 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
132 |
-1, 6, 8, 10, 12, 14, 16, -1 |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
133 |
}; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
134 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
135 |
static const Interface interfaces[6] = |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
136 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
137 |
UNDEFINED, DVI, HDMI_A, HDMI_B, MDDI, DISPLAY_PORT |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
138 |
}; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
139 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
140 |
bits = get_bits (edid[0x14], 4, 6); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
141 |
info->digital.bits_per_primary = bit_depth[bits]; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
142 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
143 |
bits = get_bits (edid[0x14], 0, 3); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
144 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
145 |
if (bits <= 5) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
146 |
info->digital.interface = interfaces[bits]; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
147 |
else |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
148 |
info->digital.interface = UNDEFINED; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
149 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
150 |
else |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
151 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
152 |
int bits = get_bits (edid[0x14], 5, 6); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
153 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
154 |
static const double levels[][3] = |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
155 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
156 |
{ 0.7, 0.3, 1.0 }, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
157 |
{ 0.714, 0.286, 1.0 }, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
158 |
{ 1.0, 0.4, 1.4 }, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
159 |
{ 0.7, 0.0, 0.7 }, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
160 |
}; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
161 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
162 |
info->analog.video_signal_level = levels[bits][0]; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
163 |
info->analog.sync_signal_level = levels[bits][1]; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
164 |
info->analog.total_signal_level = levels[bits][2]; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
165 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
166 |
info->analog.blank_to_black = get_bit (edid[0x14], 4); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
167 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
168 |
info->analog.separate_hv_sync = get_bit (edid[0x14], 3); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
169 |
info->analog.composite_sync_on_h = get_bit (edid[0x14], 2); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
170 |
info->analog.composite_sync_on_green = get_bit (edid[0x14], 1); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
171 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
172 |
info->analog.serration_on_vsync = get_bit (edid[0x14], 0); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
173 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
174 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
175 |
/* Screen Size / Aspect Ratio */ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
176 |
if (edid[0x15] == 0 && edid[0x16] == 0) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
177 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
178 |
info->width_mm = -1; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
179 |
info->height_mm = -1; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
180 |
info->aspect_ratio = -1.0; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
181 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
182 |
else if (edid[0x16] == 0) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
183 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
184 |
info->width_mm = -1; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
185 |
info->height_mm = -1; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
186 |
info->aspect_ratio = 100.0 / (edid[0x15] + 99); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
187 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
188 |
else if (edid[0x15] == 0) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
189 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
190 |
info->width_mm = -1; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
191 |
info->height_mm = -1; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
192 |
info->aspect_ratio = 100.0 / (edid[0x16] + 99); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
193 |
info->aspect_ratio = 1/info->aspect_ratio; /* portrait */ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
194 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
195 |
else |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
196 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
197 |
info->width_mm = 10 * edid[0x15]; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
198 |
info->height_mm = 10 * edid[0x16]; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
199 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
200 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
201 |
/* Gamma */ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
202 |
if (edid[0x17] == 0xFF) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
203 |
info->gamma = -1.0; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
204 |
else |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
205 |
info->gamma = (edid[0x17] + 100.0) / 100.0; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
206 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
207 |
/* Features */ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
208 |
info->standby = get_bit (edid[0x18], 7); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
209 |
info->suspend = get_bit (edid[0x18], 6); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
210 |
info->active_off = get_bit (edid[0x18], 5); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
211 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
212 |
if (info->is_digital) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
213 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
214 |
info->digital.rgb444 = TRUE; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
215 |
if (get_bit (edid[0x18], 3)) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
216 |
info->digital.ycrcb444 = 1; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
217 |
if (get_bit (edid[0x18], 4)) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
218 |
info->digital.ycrcb422 = 1; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
219 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
220 |
else |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
221 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
222 |
int bits = get_bits (edid[0x18], 3, 4); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
223 |
ColorType color_type[4] = |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
224 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
225 |
MONOCHROME, RGB, OTHER_COLOR, UNDEFINED_COLOR |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
226 |
}; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
227 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
228 |
info->analog.color_type = color_type[bits]; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
229 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
230 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
231 |
info->srgb_is_standard = get_bit (edid[0x18], 2); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
232 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
233 |
/* In 1.3 this is called "has preferred timing" */ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
234 |
info->preferred_timing_includes_native = get_bit (edid[0x18], 1); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
235 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
236 |
/* FIXME: In 1.3 this indicates whether the monitor accepts GTF */ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
237 |
info->continuous_frequency = get_bit (edid[0x18], 0); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
238 |
return TRUE; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
239 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
240 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
241 |
static double |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
242 |
decode_fraction (int high, int low) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
243 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
244 |
double result = 0.0; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
245 |
int i; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
246 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
247 |
high = (high << 2) | low; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
248 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
249 |
for (i = 0; i < 10; ++i) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
250 |
result += get_bit (high, i) * pow (2, i - 10); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
251 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
252 |
return result; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
253 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
254 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
255 |
static int |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
256 |
decode_color_characteristics (const uchar *edid, MonitorInfo *info) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
257 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
258 |
info->red_x = decode_fraction (edid[0x1b], get_bits (edid[0x19], 6, 7)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
259 |
info->red_y = decode_fraction (edid[0x1c], get_bits (edid[0x19], 5, 4)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
260 |
info->green_x = decode_fraction (edid[0x1d], get_bits (edid[0x19], 2, 3)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
261 |
info->green_y = decode_fraction (edid[0x1e], get_bits (edid[0x19], 0, 1)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
262 |
info->blue_x = decode_fraction (edid[0x1f], get_bits (edid[0x1a], 6, 7)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
263 |
info->blue_y = decode_fraction (edid[0x20], get_bits (edid[0x1a], 4, 5)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
264 |
info->white_x = decode_fraction (edid[0x21], get_bits (edid[0x1a], 2, 3)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
265 |
info->white_y = decode_fraction (edid[0x22], get_bits (edid[0x1a], 0, 1)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
266 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
267 |
return TRUE; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
268 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
269 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
270 |
static int |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
271 |
decode_established_timings (const uchar *edid, MonitorInfo *info) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
272 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
273 |
static const Timing established[][8] = |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
274 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
275 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
276 |
{ 800, 600, 60 }, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
277 |
{ 800, 600, 56 }, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
278 |
{ 640, 480, 75 }, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
279 |
{ 640, 480, 72 }, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
280 |
{ 640, 480, 67 }, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
281 |
{ 640, 480, 60 }, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
282 |
{ 720, 400, 88 }, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
283 |
{ 720, 400, 70 } |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
284 |
}, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
285 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
286 |
{ 1280, 1024, 75 }, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
287 |
{ 1024, 768, 75 }, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
288 |
{ 1024, 768, 70 }, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
289 |
{ 1024, 768, 60 }, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
290 |
{ 1024, 768, 87 }, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
291 |
{ 832, 624, 75 }, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
292 |
{ 800, 600, 75 }, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
293 |
{ 800, 600, 72 } |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
294 |
}, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
295 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
296 |
{ 0, 0, 0 }, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
297 |
{ 0, 0, 0 }, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
298 |
{ 0, 0, 0 }, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
299 |
{ 0, 0, 0 }, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
300 |
{ 0, 0, 0 }, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
301 |
{ 0, 0, 0 }, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
302 |
{ 0, 0, 0 }, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
303 |
{ 1152, 870, 75 } |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
304 |
}, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
305 |
}; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
306 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
307 |
int i, j, idx; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
308 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
309 |
idx = 0; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
310 |
for (i = 0; i < 3; ++i) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
311 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
312 |
for (j = 0; j < 8; ++j) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
313 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
314 |
int byte = edid[0x23 + i]; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
315 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
316 |
if (get_bit (byte, j) && established[i][j].frequency != 0) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
317 |
info->established[idx++] = established[i][j]; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
318 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
319 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
320 |
return TRUE; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
321 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
322 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
323 |
static int |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
324 |
decode_standard_timings (const uchar *edid, MonitorInfo *info) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
325 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
326 |
int i; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
327 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
328 |
for (i = 0; i < 8; i++) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
329 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
330 |
int first = edid[0x26 + 2 * i]; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
331 |
int second = edid[0x27 + 2 * i]; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
332 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
333 |
if (first != 0x01 && second != 0x01) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
334 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
335 |
int w = 8 * (first + 31); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
336 |
int h; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
337 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
338 |
switch (get_bits (second, 6, 7)) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
339 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
340 |
case 0x00: h = (w / 16) * 10; break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
341 |
case 0x01: h = (w / 4) * 3; break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
342 |
case 0x02: h = (w / 5) * 4; break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
343 |
case 0x03: h = (w / 16) * 9; break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
344 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
345 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
346 |
info->standard[i].width = w; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
347 |
info->standard[i].height = h; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
348 |
info->standard[i].frequency = get_bits (second, 0, 5) + 60; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
349 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
350 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
351 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
352 |
return TRUE; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
353 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
354 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
355 |
static void |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
356 |
decode_lf_string (const uchar *s, int n_chars, char *result) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
357 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
358 |
int i; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
359 |
for (i = 0; i < n_chars; ++i) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
360 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
361 |
if (s[i] == 0x0a) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
362 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
363 |
*result++ = '\0'; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
364 |
break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
365 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
366 |
else if (s[i] == 0x00) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
367 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
368 |
/* Convert embedded 0's to spaces */ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
369 |
*result++ = ' '; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
370 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
371 |
else |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
372 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
373 |
*result++ = s[i]; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
374 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
375 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
376 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
377 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
378 |
static void |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
379 |
decode_display_descriptor (const uchar *desc, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
380 |
MonitorInfo *info) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
381 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
382 |
switch (desc[0x03]) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
383 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
384 |
case 0xFC: |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
385 |
decode_lf_string (desc + 5, 13, info->dsc_product_name); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
386 |
break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
387 |
case 0xFF: |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
388 |
decode_lf_string (desc + 5, 13, info->dsc_serial_number); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
389 |
break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
390 |
case 0xFE: |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
391 |
decode_lf_string (desc + 5, 13, info->dsc_string); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
392 |
break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
393 |
case 0xFD: |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
394 |
/* Range Limits */ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
395 |
break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
396 |
case 0xFB: |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
397 |
/* Color Point */ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
398 |
break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
399 |
case 0xFA: |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
400 |
/* Timing Identifications */ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
401 |
break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
402 |
case 0xF9: |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
403 |
/* Color Management */ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
404 |
break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
405 |
case 0xF8: |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
406 |
/* Timing Codes */ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
407 |
break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
408 |
case 0xF7: |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
409 |
/* Established Timings */ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
410 |
break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
411 |
case 0x10: |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
412 |
break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
413 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
414 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
415 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
416 |
static void |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
417 |
decode_detailed_timing (const uchar *timing, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
418 |
DetailedTiming *detailed) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
419 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
420 |
int bits; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
421 |
StereoType stereo[] = |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
422 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
423 |
NO_STEREO, NO_STEREO, FIELD_RIGHT, FIELD_LEFT, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
424 |
TWO_WAY_RIGHT_ON_EVEN, TWO_WAY_LEFT_ON_EVEN, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
425 |
FOUR_WAY_INTERLEAVED, SIDE_BY_SIDE |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
426 |
}; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
427 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
428 |
detailed->pixel_clock = (timing[0x00] | timing[0x01] << 8) * 10000; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
429 |
detailed->h_addr = timing[0x02] | ((timing[0x04] & 0xf0) << 4); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
430 |
detailed->h_blank = timing[0x03] | ((timing[0x04] & 0x0f) << 8); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
431 |
detailed->v_addr = timing[0x05] | ((timing[0x07] & 0xf0) << 4); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
432 |
detailed->v_blank = timing[0x06] | ((timing[0x07] & 0x0f) << 8); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
433 |
detailed->h_front_porch = timing[0x08] | get_bits (timing[0x0b], 6, 7) << 8; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
434 |
detailed->h_sync = timing[0x09] | get_bits (timing[0x0b], 4, 5) << 8; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
435 |
detailed->v_front_porch = |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
436 |
get_bits (timing[0x0a], 4, 7) | get_bits (timing[0x0b], 2, 3) << 4; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
437 |
detailed->v_sync = |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
438 |
get_bits (timing[0x0a], 0, 3) | get_bits (timing[0x0b], 0, 1) << 4; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
439 |
detailed->width_mm = timing[0x0c] | get_bits (timing[0x0e], 4, 7) << 8; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
440 |
detailed->height_mm = timing[0x0d] | get_bits (timing[0x0e], 0, 3) << 8; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
441 |
detailed->right_border = timing[0x0f]; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
442 |
detailed->top_border = timing[0x10]; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
443 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
444 |
detailed->interlaced = get_bit (timing[0x11], 7); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
445 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
446 |
/* Stereo */ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
447 |
bits = get_bits (timing[0x11], 5, 6) << 1 | get_bit (timing[0x11], 0); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
448 |
detailed->stereo = stereo[bits]; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
449 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
450 |
/* Sync */ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
451 |
bits = timing[0x11]; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
452 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
453 |
detailed->digital_sync = get_bit (bits, 4); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
454 |
if (detailed->digital_sync) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
455 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
456 |
detailed->digital.composite = !get_bit (bits, 3); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
457 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
458 |
if (detailed->digital.composite) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
459 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
460 |
detailed->digital.serrations = get_bit (bits, 2); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
461 |
detailed->digital.negative_vsync = FALSE; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
462 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
463 |
else |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
464 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
465 |
detailed->digital.serrations = FALSE; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
466 |
detailed->digital.negative_vsync = !get_bit (bits, 2); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
467 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
468 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
469 |
detailed->digital.negative_hsync = !get_bit (bits, 0); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
470 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
471 |
else |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
472 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
473 |
detailed->analog.bipolar = get_bit (bits, 3); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
474 |
detailed->analog.serrations = get_bit (bits, 2); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
475 |
detailed->analog.sync_on_green = !get_bit (bits, 1); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
476 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
477 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
478 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
479 |
static int |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
480 |
decode_descriptors (const uchar *edid, MonitorInfo *info) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
481 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
482 |
int i; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
483 |
int timing_idx; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
484 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
485 |
timing_idx = 0; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
486 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
487 |
for (i = 0; i < 4; ++i) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
488 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
489 |
int index = 0x36 + i * 18; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
490 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
491 |
if (edid[index + 0] == 0x00 && edid[index + 1] == 0x00) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
492 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
493 |
decode_display_descriptor (edid + index, info); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
494 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
495 |
else |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
496 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
497 |
decode_detailed_timing ( |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
498 |
edid + index, &(info->detailed_timings[timing_idx++])); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
499 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
500 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
501 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
502 |
info->n_detailed_timings = timing_idx; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
503 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
504 |
return TRUE; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
505 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
506 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
507 |
static void |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
508 |
decode_check_sum (const uchar *edid, |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
509 |
MonitorInfo *info) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
510 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
511 |
int i; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
512 |
uchar check = 0; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
513 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
514 |
for (i = 0; i < 128; ++i) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
515 |
check += edid[i]; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
516 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
517 |
info->checksum = check; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
518 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
519 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
520 |
MonitorInfo * |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
521 |
decode_edid (const uchar *edid) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
522 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
523 |
MonitorInfo *info = calloc (1, sizeof (MonitorInfo)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
524 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
525 |
decode_check_sum (edid, info); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
526 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
527 |
if (!decode_header (edid)) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
528 |
return NULL; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
529 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
530 |
if (!decode_vendor_and_product_identification (edid, info)) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
531 |
return NULL; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
532 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
533 |
if (!decode_edid_version (edid, info)) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
534 |
return NULL; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
535 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
536 |
if (!decode_display_parameters (edid, info)) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
537 |
return NULL; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
538 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
539 |
if (!decode_color_characteristics (edid, info)) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
540 |
return NULL; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
541 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
542 |
if (!decode_established_timings (edid, info)) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
543 |
return NULL; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
544 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
545 |
if (!decode_standard_timings (edid, info)) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
546 |
return NULL; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
547 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
548 |
if (!decode_descriptors (edid, info)) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
549 |
return NULL; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
550 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
551 |
return info; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
552 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
553 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
554 |
static const char * |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
555 |
yesno (int v) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
556 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
557 |
return v? "yes" : "no"; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
558 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
559 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
560 |
void |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
561 |
dump_monitor_info (MonitorInfo *info) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
562 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
563 |
char *s; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
564 |
int i; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
565 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
566 |
printf ("Checksum: %d (%s)\n", |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
567 |
info->checksum, info->checksum? "incorrect" : "correct"); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
568 |
printf ("Manufacturer Code: %s\n", info->manufacturer_code); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
569 |
printf ("Product Code: 0x%x\n", info->product_code); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
570 |
printf ("Serial Number: %u\n", info->serial_number); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
571 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
572 |
if (info->production_week != -1) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
573 |
printf ("Production Week: %d\n", info->production_week); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
574 |
else |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
575 |
printf ("Production Week: unspecified\n"); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
576 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
577 |
if (info->production_year != -1) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
578 |
printf ("Production Year: %d\n", info->production_year); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
579 |
else |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
580 |
printf ("Production Year: unspecified\n"); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
581 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
582 |
if (info->model_year != -1) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
583 |
printf ("Model Year: %d\n", info->model_year); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
584 |
else |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
585 |
printf ("Model Year: unspecified\n"); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
586 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
587 |
printf ("EDID revision: %d.%d\n", info->major_version, info->minor_version); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
588 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
589 |
printf ("Display is %s\n", info->is_digital? "digital" : "analog"); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
590 |
if (info->is_digital) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
591 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
592 |
const char *interface; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
593 |
if (info->digital.bits_per_primary != -1) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
594 |
printf ("Bits Per Primary: %d\n", info->digital.bits_per_primary); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
595 |
else |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
596 |
printf ("Bits Per Primary: undefined\n"); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
597 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
598 |
switch (info->digital.interface) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
599 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
600 |
case DVI: interface = "DVI"; break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
601 |
case HDMI_A: interface = "HDMI-a"; break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
602 |
case HDMI_B: interface = "HDMI-b"; break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
603 |
case MDDI: interface = "MDDI"; break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
604 |
case DISPLAY_PORT: interface = "DisplayPort"; break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
605 |
case UNDEFINED: interface = "undefined"; break; |
6851 | 606 |
default: interface = "unknown"; break; |
6796
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
607 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
608 |
printf ("Interface: %s\n", interface); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
609 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
610 |
printf ("RGB 4:4:4: %s\n", yesno (info->digital.rgb444)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
611 |
printf ("YCrCb 4:4:4: %s\n", yesno (info->digital.ycrcb444)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
612 |
printf ("YCrCb 4:2:2: %s\n", yesno (info->digital.ycrcb422)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
613 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
614 |
else |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
615 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
616 |
printf ("Video Signal Level: %f\n", info->analog.video_signal_level); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
617 |
printf ("Sync Signal Level: %f\n", info->analog.sync_signal_level); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
618 |
printf ("Total Signal Level: %f\n", info->analog.total_signal_level); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
619 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
620 |
printf ("Blank to Black: %s\n", |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
621 |
yesno (info->analog.blank_to_black)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
622 |
printf ("Separate HV Sync: %s\n", |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
623 |
yesno (info->analog.separate_hv_sync)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
624 |
printf ("Composite Sync on H: %s\n", |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
625 |
yesno (info->analog.composite_sync_on_h)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
626 |
printf ("Serration on VSync: %s\n", |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
627 |
yesno (info->analog.serration_on_vsync)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
628 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
629 |
switch (info->analog.color_type) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
630 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
631 |
case UNDEFINED_COLOR: s = "undefined"; break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
632 |
case MONOCHROME: s = "monochrome"; break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
633 |
case RGB: s = "rgb"; break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
634 |
case OTHER_COLOR: s = "other color"; break; |
6851 | 635 |
default: s = "unknown"; break; |
6796
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
636 |
}; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
637 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
638 |
printf ("Color: %s\n", s); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
639 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
640 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
641 |
if (info->width_mm == -1) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
642 |
printf ("Width: undefined\n"); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
643 |
else |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
644 |
printf ("Width: %d mm\n", info->width_mm); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
645 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
646 |
if (info->height_mm == -1) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
647 |
printf ("Height: undefined\n"); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
648 |
else |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
649 |
printf ("Height: %d mm\n", info->height_mm); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
650 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
651 |
if (info->aspect_ratio > 0) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
652 |
printf ("Aspect Ratio: %f\n", info->aspect_ratio); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
653 |
else |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
654 |
printf ("Aspect Ratio: undefined\n"); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
655 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
656 |
if (info->gamma >= 0) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
657 |
printf ("Gamma: %f\n", info->gamma); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
658 |
else |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
659 |
printf ("Gamma: undefined\n"); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
660 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
661 |
printf ("Standby: %s\n", yesno (info->standby)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
662 |
printf ("Suspend: %s\n", yesno (info->suspend)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
663 |
printf ("Active Off: %s\n", yesno (info->active_off)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
664 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
665 |
printf ("SRGB is Standard: %s\n", yesno (info->srgb_is_standard)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
666 |
printf ("Preferred Timing Includes Native: %s\n", |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
667 |
yesno (info->preferred_timing_includes_native)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
668 |
printf ("Continuous Frequency: %s\n", yesno (info->continuous_frequency)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
669 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
670 |
printf ("Red X: %f\n", info->red_x); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
671 |
printf ("Red Y: %f\n", info->red_y); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
672 |
printf ("Green X: %f\n", info->green_x); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
673 |
printf ("Green Y: %f\n", info->green_y); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
674 |
printf ("Blue X: %f\n", info->blue_x); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
675 |
printf ("Blue Y: %f\n", info->blue_y); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
676 |
printf ("White X: %f\n", info->white_x); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
677 |
printf ("White Y: %f\n", info->white_y); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
678 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
679 |
printf ("Established Timings:\n"); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
680 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
681 |
for (i = 0; i < 24; ++i) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
682 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
683 |
Timing *timing = &(info->established[i]); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
684 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
685 |
if (timing->frequency == 0) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
686 |
break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
687 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
688 |
printf (" %d x %d @ %d Hz\n", |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
689 |
timing->width, timing->height, timing->frequency); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
690 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
691 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
692 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
693 |
printf ("Standard Timings:\n"); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
694 |
for (i = 0; i < 8; ++i) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
695 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
696 |
Timing *timing = &(info->standard[i]); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
697 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
698 |
if (timing->frequency == 0) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
699 |
break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
700 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
701 |
printf (" %d x %d @ %d Hz\n", |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
702 |
timing->width, timing->height, timing->frequency); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
703 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
704 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
705 |
for (i = 0; i < info->n_detailed_timings; ++i) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
706 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
707 |
DetailedTiming *timing = &(info->detailed_timings[i]); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
708 |
const char *s; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
709 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
710 |
printf ("Timing%s: \n", |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
711 |
(i == 0 && info->preferred_timing_includes_native)? |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
712 |
" (Preferred)" : ""); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
713 |
printf (" Pixel Clock: %d\n", timing->pixel_clock); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
714 |
printf (" H Addressable: %d\n", timing->h_addr); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
715 |
printf (" H Blank: %d\n", timing->h_blank); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
716 |
printf (" H Front Porch: %d\n", timing->h_front_porch); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
717 |
printf (" H Sync: %d\n", timing->h_sync); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
718 |
printf (" V Addressable: %d\n", timing->v_addr); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
719 |
printf (" V Blank: %d\n", timing->v_blank); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
720 |
printf (" V Front Porch: %d\n", timing->v_front_porch); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
721 |
printf (" V Sync: %d\n", timing->v_sync); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
722 |
printf (" Width: %d mm\n", timing->width_mm); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
723 |
printf (" Height: %d mm\n", timing->height_mm); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
724 |
printf (" Right Border: %d\n", timing->right_border); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
725 |
printf (" Top Border: %d\n", timing->top_border); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
726 |
switch (timing->stereo) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
727 |
{ |
6797
8a818a373436
Fixed compiler warnings in edid-parse.c
Sam Lantinga <slouken@libsdl.org>
parents:
6796
diff
changeset
|
728 |
default: |
6796
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
729 |
case NO_STEREO: s = "No Stereo"; break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
730 |
case FIELD_RIGHT: s = "Field Sequential, Right on Sync"; break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
731 |
case FIELD_LEFT: s = "Field Sequential, Left on Sync"; break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
732 |
case TWO_WAY_RIGHT_ON_EVEN: s = "Two-way, Right on Even"; break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
733 |
case TWO_WAY_LEFT_ON_EVEN: s = "Two-way, Left on Even"; break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
734 |
case FOUR_WAY_INTERLEAVED: s = "Four-way Interleaved"; break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
735 |
case SIDE_BY_SIDE: s = "Side-by-Side"; break; |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
736 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
737 |
printf (" Stereo: %s\n", s); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
738 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
739 |
if (timing->digital_sync) |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
740 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
741 |
printf (" Digital Sync:\n"); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
742 |
printf (" composite: %s\n", yesno (timing->digital.composite)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
743 |
printf (" serrations: %s\n", yesno (timing->digital.serrations)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
744 |
printf (" negative vsync: %s\n", |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
745 |
yesno (timing->digital.negative_vsync)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
746 |
printf (" negative hsync: %s\n", |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
747 |
yesno (timing->digital.negative_hsync)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
748 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
749 |
else |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
750 |
{ |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
751 |
printf (" Analog Sync:\n"); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
752 |
printf (" bipolar: %s\n", yesno (timing->analog.bipolar)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
753 |
printf (" serrations: %s\n", yesno (timing->analog.serrations)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
754 |
printf (" sync on green: %s\n", yesno ( |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
755 |
timing->analog.sync_on_green)); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
756 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
757 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
758 |
|
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
759 |
printf ("Detailed Product information:\n"); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
760 |
printf (" Product Name: %s\n", info->dsc_product_name); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
761 |
printf (" Serial Number: %s\n", info->dsc_serial_number); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
762 |
printf (" Unspecified String: %s\n", info->dsc_string); |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
763 |
} |
424a12862805
Implemented SDL_GetDisplayName() for X11, which requires the XRandR extension.
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
764 |