graphics/edid: Add support for digital display info; solves #17462

* We pack the first 8 bits into a union for the raw
  edid since alignment matters.
* Handing the raw_edid is a bit ugly, so in the edid struct
  we drop the input_type from the union since packing doesn't
  matter as much.

Change-Id: I32dbfe9484f9eb83cf491a44d30a32ca36d65b7b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4775
Reviewed-by: Alex von Gluck IV <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
Alexander von Gluck IV
2021-12-18 15:21:30 +00:00
committed by Adrien Destugues
parent 6a9aea9dfd
commit 65ed50c713
4 changed files with 80 additions and 38 deletions
+22 -10
View File
@@ -25,18 +25,30 @@ typedef struct {
uint8 revision;
} edid1_version;
// analog input parameters
typedef struct {
uint8 input_voltage; // 0=0.7V/0.3V, 1=0.714V/0.286,
// 2=1V/0.4V, 3=0.7V/0V
bool setup; // true if voltage configurable
bool sep_sync;
bool comp_sync;
bool sync_on_green;
bool sync_serr;
} edid1_analog_params;
// digital input parameters
typedef struct {
uint8 bit_depth;
uint8 interface;
} edid1_digital_params;
// display info
typedef struct {
BBITFIELD8_7 (
input_type : 1, // 1 : digital
input_voltage : 2, // 0=0.7V/0.3V, 1=0.714V/0.286,
// 2=1V/0.4V, 3=0.7V/0V
setup : 1, // true if voltage configurable
sep_sync : 1,
comp_sync : 1,
sync_on_green : 1,
sync_serr : 1
);
uint8 input_type;
edid1_analog_params analog_params;
edid1_digital_params digital_params;
uint8 h_size;
uint8 v_size;
uint8 gamma; // (x+100)/100
+24 -4
View File
@@ -61,11 +61,11 @@ typedef struct _PACKED {
} edid1_version_raw;
// display info
// analog input parameters
typedef struct _PACKED {
BBITFIELD8_7 (
input_type : 1, // 1 : digital
input_voltage : 2, // 0=0.7V/0.3V, 1=0.714V/0.286,
BBITFIELD8_7 (
input_type : 1, // 0 : analog, 1 : digital
input_voltage : 2, // 0=0.7V/0.3V, 1=0.714V/0.286,
// 2=1V/0.4V, 3=0.7V/0V
setup : 1, // true if voltage configurable
sep_sync : 1,
@@ -73,6 +73,26 @@ typedef struct _PACKED {
sync_on_green : 1,
sync_serr : 1
);
} edid1_analog_params_raw;
// digital input parameters
typedef struct _PACKED {
BBITFIELD8_3 (
input_type : 1, // 0 : analog, 1 : digital
bit_depth : 3, // 0=undefined, 1=6,2=8,3=10,4=12,5=14,6=16,7=reserved
interface : 4 // 0=undefined, 2=HDMIa, 3=HDMIb
// 4=MDDI, 5=DisplayPort
);
} edid1_digital_params_raw;
// display info
typedef struct _PACKED {
union {
edid1_analog_params_raw analog_params;
edid1_digital_params_raw digital_params;
};
uint8 h_size;
uint8 v_size;
uint8 gamma; // (x+100)/100