prints disconnected displays now
This commit is contained in:
parent
3afac42ece
commit
4d1a5bd3aa
@ -22,34 +22,9 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#define EDID_OFFSET 7
|
|
||||||
|
|
||||||
#define RANDR_MIN_VER_MAJ 1u
|
#define RANDR_MIN_VER_MAJ 1u
|
||||||
#define RANDR_MIN_VER_MIN 3u
|
#define RANDR_MIN_VER_MIN 3u
|
||||||
|
|
||||||
struct edid{
|
|
||||||
union{
|
|
||||||
uint8_t header_bits[8];
|
|
||||||
uint64_t header;
|
|
||||||
};
|
|
||||||
uint16_t vendor;
|
|
||||||
uint16_t product;
|
|
||||||
uint32_t serial;
|
|
||||||
uint8_t manufacture_week;
|
|
||||||
uint8_t manufacture_year;
|
|
||||||
uint8_t edid_version_major;
|
|
||||||
uint8_t edid_version_minor;
|
|
||||||
uint8_t video_flags;
|
|
||||||
uint8_t horizontal_size;
|
|
||||||
uint8_t vertical_size;
|
|
||||||
uint8_t gamma;
|
|
||||||
uint8_t video_features;
|
|
||||||
uint8_t chromaticity[10];
|
|
||||||
uint8_t established_timing[3];
|
|
||||||
uint8_t standard_timing[8];
|
|
||||||
};
|
|
||||||
typedef struct edid edid;
|
|
||||||
|
|
||||||
/*return 0 if we have a good version*/
|
/*return 0 if we have a good version*/
|
||||||
int check_randr_version(xcb_connection_t* connection, int* maj, int* min){
|
int check_randr_version(xcb_connection_t* connection, int* maj, int* min){
|
||||||
xcb_randr_query_version_cookie_t cookie;
|
xcb_randr_query_version_cookie_t cookie;
|
||||||
@ -170,6 +145,10 @@ int main(int argc, char* argv[]){
|
|||||||
output_atoms = xcb_randr_list_output_properties_atoms(output_list_prop_reply);
|
output_atoms = xcb_randr_list_output_properties_atoms(output_list_prop_reply);
|
||||||
num_atoms = xcb_randr_list_output_properties_atoms_length(output_list_prop_reply);
|
num_atoms = xcb_randr_list_output_properties_atoms_length(output_list_prop_reply);
|
||||||
|
|
||||||
|
/*get output name*/
|
||||||
|
output_info_reply = xcb_randr_get_output_info_reply(connection, xcb_randr_get_output_info(connection, randr_outputs[i], timestamp), NULL);
|
||||||
|
printf("%.*s:", xcb_randr_get_output_info_name_length(output_info_reply), xcb_randr_get_output_info_name(output_info_reply));
|
||||||
|
|
||||||
for(j = 0;j < num_atoms;++j){
|
for(j = 0;j < num_atoms;++j){
|
||||||
unsigned int k;
|
unsigned int k;
|
||||||
/*get atom_name*/
|
/*get atom_name*/
|
||||||
@ -177,9 +156,6 @@ int main(int argc, char* argv[]){
|
|||||||
|
|
||||||
/*if the atom is the EDID data, we want to get it*/
|
/*if the atom is the EDID data, we want to get it*/
|
||||||
if(!memcmp(xcb_get_atom_name_name(atom_name_reply), "EDID", 4)){
|
if(!memcmp(xcb_get_atom_name_name(atom_name_reply), "EDID", 4)){
|
||||||
/*get output name*/
|
|
||||||
output_info_reply = xcb_randr_get_output_info_reply(connection, xcb_randr_get_output_info(connection, randr_outputs[i], timestamp), NULL);
|
|
||||||
printf("%s:", xcb_randr_get_output_info_name(output_info_reply));
|
|
||||||
/*get property data for the current atom*/
|
/*get property data for the current atom*/
|
||||||
output_get_prop_reply = xcb_randr_get_output_property_reply(connection, xcb_randr_get_output_property(connection, randr_outputs[i], output_atoms[j], XCB_GET_PROPERTY_TYPE_ANY, 0, 100, 0, 0), NULL);
|
output_get_prop_reply = xcb_randr_get_output_property_reply(connection, xcb_randr_get_output_property(connection, randr_outputs[i], output_atoms[j], XCB_GET_PROPERTY_TYPE_ANY, 0, 100, 0, 0), NULL);
|
||||||
prop_data = xcb_randr_get_output_property_data(output_get_prop_reply);
|
prop_data = xcb_randr_get_output_property_data(output_get_prop_reply);
|
||||||
@ -188,12 +164,12 @@ int main(int argc, char* argv[]){
|
|||||||
for(k = 0;k < output_get_prop_reply->num_items;++k){
|
for(k = 0;k < output_get_prop_reply->num_items;++k){
|
||||||
printf("%02x", prop_data[k]);
|
printf("%02x", prop_data[k]);
|
||||||
}
|
}
|
||||||
printf("\n");
|
|
||||||
free(output_info_reply);
|
|
||||||
free(output_get_prop_reply);
|
free(output_get_prop_reply);
|
||||||
}
|
}
|
||||||
free(atom_name_reply);
|
free(atom_name_reply);
|
||||||
}
|
}
|
||||||
|
printf("\n");
|
||||||
|
free(output_info_reply);
|
||||||
free(output_list_prop_reply);
|
free(output_list_prop_reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user