Rev 5056 | Rev 6082 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5056 | Rev 5270 | ||
---|---|---|---|
Line 25... | Line 25... | ||
25 | 25 | ||
Line 26... | Line 26... | ||
26 | #include |
26 | #include |
27 | 27 | ||
- | 28 | #define EDID_LENGTH 128 |
|
Line 28... | Line 29... | ||
28 | #define EDID_LENGTH 128 |
29 | #define DDC_ADDR 0x50 |
29 | #define DDC_ADDR 0x50 |
30 | #define DDC_ADDR2 0x52 /* E-DDC 1.2 - where DisplayID can hide */ |
30 | 31 | ||
31 | #define CEA_EXT 0x02 |
32 | #define CEA_EXT 0x02 |
32 | #define VTB_EXT 0x10 |
33 | #define VTB_EXT 0x10 |
- | 34 | #define DI_EXT 0x40 |
|
Line 33... | Line 35... | ||
33 | #define DI_EXT 0x40 |
35 | #define LS_EXT 0x50 |
34 | #define LS_EXT 0x50 |
36 | #define MI_EXT 0x60 |
35 | #define MI_EXT 0x60 |
37 | #define DISPLAYID_EXT 0x70 |
36 | 38 | ||
Line 205... | Line 207... | ||
205 | #define DRM_EDID_HDMI_DC_48 (1 << 6) |
207 | #define DRM_EDID_HDMI_DC_48 (1 << 6) |
206 | #define DRM_EDID_HDMI_DC_36 (1 << 5) |
208 | #define DRM_EDID_HDMI_DC_36 (1 << 5) |
207 | #define DRM_EDID_HDMI_DC_30 (1 << 4) |
209 | #define DRM_EDID_HDMI_DC_30 (1 << 4) |
208 | #define DRM_EDID_HDMI_DC_Y444 (1 << 3) |
210 | #define DRM_EDID_HDMI_DC_Y444 (1 << 3) |
Line -... | Line 211... | ||
- | 211 | ||
- | 212 | /* ELD Header Block */ |
|
- | 213 | #define DRM_ELD_HEADER_BLOCK_SIZE 4 |
|
- | 214 | ||
- | 215 | #define DRM_ELD_VER 0 |
|
- | 216 | # define DRM_ELD_VER_SHIFT 3 |
|
- | 217 | # define DRM_ELD_VER_MASK (0x1f << 3) |
|
- | 218 | ||
- | 219 | #define DRM_ELD_BASELINE_ELD_LEN 2 /* in dwords! */ |
|
- | 220 | ||
- | 221 | /* ELD Baseline Block for ELD_Ver == 2 */ |
|
- | 222 | #define DRM_ELD_CEA_EDID_VER_MNL 4 |
|
- | 223 | # define DRM_ELD_CEA_EDID_VER_SHIFT 5 |
|
- | 224 | # define DRM_ELD_CEA_EDID_VER_MASK (7 << 5) |
|
- | 225 | # define DRM_ELD_CEA_EDID_VER_NONE (0 << 5) |
|
- | 226 | # define DRM_ELD_CEA_EDID_VER_CEA861 (1 << 5) |
|
- | 227 | # define DRM_ELD_CEA_EDID_VER_CEA861A (2 << 5) |
|
- | 228 | # define DRM_ELD_CEA_EDID_VER_CEA861BCD (3 << 5) |
|
- | 229 | # define DRM_ELD_MNL_SHIFT 0 |
|
- | 230 | # define DRM_ELD_MNL_MASK (0x1f << 0) |
|
- | 231 | ||
- | 232 | #define DRM_ELD_SAD_COUNT_CONN_TYPE 5 |
|
- | 233 | # define DRM_ELD_SAD_COUNT_SHIFT 4 |
|
- | 234 | # define DRM_ELD_SAD_COUNT_MASK (0xf << 4) |
|
- | 235 | # define DRM_ELD_CONN_TYPE_SHIFT 2 |
|
- | 236 | # define DRM_ELD_CONN_TYPE_MASK (3 << 2) |
|
- | 237 | # define DRM_ELD_CONN_TYPE_HDMI (0 << 2) |
|
- | 238 | # define DRM_ELD_CONN_TYPE_DP (1 << 2) |
|
- | 239 | # define DRM_ELD_SUPPORTS_AI (1 << 1) |
|
- | 240 | # define DRM_ELD_SUPPORTS_HDCP (1 << 0) |
|
- | 241 | ||
- | 242 | #define DRM_ELD_AUD_SYNCH_DELAY 6 /* in units of 2 ms */ |
|
- | 243 | # define DRM_ELD_AUD_SYNCH_DELAY_MAX 0xfa /* 500 ms */ |
|
- | 244 | ||
- | 245 | #define DRM_ELD_SPEAKER 7 |
|
- | 246 | # define DRM_ELD_SPEAKER_RLRC (1 << 6) |
|
- | 247 | # define DRM_ELD_SPEAKER_FLRC (1 << 5) |
|
- | 248 | # define DRM_ELD_SPEAKER_RC (1 << 4) |
|
- | 249 | # define DRM_ELD_SPEAKER_RLR (1 << 3) |
|
- | 250 | # define DRM_ELD_SPEAKER_FC (1 << 2) |
|
- | 251 | # define DRM_ELD_SPEAKER_LFE (1 << 1) |
|
- | 252 | # define DRM_ELD_SPEAKER_FLR (1 << 0) |
|
- | 253 | ||
- | 254 | #define DRM_ELD_PORT_ID 8 /* offsets 8..15 inclusive */ |
|
- | 255 | # define DRM_ELD_PORT_ID_LEN 8 |
|
- | 256 | ||
- | 257 | #define DRM_ELD_MANUFACTURER_NAME0 16 |
|
- | 258 | #define DRM_ELD_MANUFACTURER_NAME1 17 |
|
- | 259 | ||
- | 260 | #define DRM_ELD_PRODUCT_CODE0 18 |
|
- | 261 | #define DRM_ELD_PRODUCT_CODE1 19 |
|
- | 262 | ||
- | 263 | #define DRM_ELD_MONITOR_NAME_STRING 20 /* offsets 20..(20+mnl-1) inclusive */ |
|
- | 264 | ||
- | 265 | #define DRM_ELD_CEA_SAD(mnl, sad) (20 + (mnl) + 3 * (sad)) |
|
209 | 266 | ||
210 | struct edid { |
267 | struct edid { |
211 | u8 header[8]; |
268 | u8 header[8]; |
212 | /* Vendor & product info */ |
269 | /* Vendor & product info */ |
213 | u8 mfg_id[2]; |
270 | u8 mfg_id[2]; |
Line 277... | Line 334... | ||
277 | const struct drm_display_mode *mode); |
334 | const struct drm_display_mode *mode); |
278 | int |
335 | int |
279 | drm_hdmi_vendor_infoframe_from_display_mode(struct hdmi_vendor_infoframe *frame, |
336 | drm_hdmi_vendor_infoframe_from_display_mode(struct hdmi_vendor_infoframe *frame, |
280 | const struct drm_display_mode *mode); |
337 | const struct drm_display_mode *mode); |
Line -... | Line 338... | ||
- | 338 | ||
- | 339 | /** |
|
- | 340 | * drm_eld_mnl - Get ELD monitor name length in bytes. |
|
- | 341 | * @eld: pointer to an eld memory structure with mnl set |
|
- | 342 | */ |
|
- | 343 | static inline int drm_eld_mnl(const uint8_t *eld) |
|
- | 344 | { |
|
- | 345 | return (eld[DRM_ELD_CEA_EDID_VER_MNL] & DRM_ELD_MNL_MASK) >> DRM_ELD_MNL_SHIFT; |
|
- | 346 | } |
|
- | 347 | ||
- | 348 | /** |
|
- | 349 | * drm_eld_sad_count - Get ELD SAD count. |
|
- | 350 | * @eld: pointer to an eld memory structure with sad_count set |
|
- | 351 | */ |
|
- | 352 | static inline int drm_eld_sad_count(const uint8_t *eld) |
|
- | 353 | { |
|
- | 354 | return (eld[DRM_ELD_SAD_COUNT_CONN_TYPE] & DRM_ELD_SAD_COUNT_MASK) >> |
|
- | 355 | DRM_ELD_SAD_COUNT_SHIFT; |
|
- | 356 | } |
|
- | 357 | ||
- | 358 | /** |
|
- | 359 | * drm_eld_calc_baseline_block_size - Calculate baseline block size in bytes |
|
- | 360 | * @eld: pointer to an eld memory structure with mnl and sad_count set |
|
- | 361 | * |
|
- | 362 | * This is a helper for determining the payload size of the baseline block, in |
|
- | 363 | * bytes, for e.g. setting the Baseline_ELD_Len field in the ELD header block. |
|
- | 364 | */ |
|
- | 365 | static inline int drm_eld_calc_baseline_block_size(const uint8_t *eld) |
|
- | 366 | { |
|
- | 367 | return DRM_ELD_MONITOR_NAME_STRING - DRM_ELD_HEADER_BLOCK_SIZE + |
|
- | 368 | drm_eld_mnl(eld) + drm_eld_sad_count(eld) * 3; |
|
- | 369 | } |
|
- | 370 | ||
- | 371 | /** |
|
- | 372 | * drm_eld_size - Get ELD size in bytes |
|
- | 373 | * @eld: pointer to a complete eld memory structure |
|
- | 374 | * |
|
- | 375 | * The returned value does not include the vendor block. It's vendor specific, |
|
- | 376 | * and comprises of the remaining bytes in the ELD memory buffer after |
|
- | 377 | * drm_eld_size() bytes of header and baseline block. |
|
- | 378 | * |
|
- | 379 | * The returned value is guaranteed to be a multiple of 4. |
|
- | 380 | */ |
|
- | 381 | static inline int drm_eld_size(const uint8_t *eld) |
|
- | 382 | { |
|
- | 383 | return DRM_ELD_HEADER_BLOCK_SIZE + eld[DRM_ELD_BASELINE_ELD_LEN] * 4; |
|
- | 384 | } |
|
- | 385 | ||
- | 386 | struct edid *drm_do_get_edid(struct drm_connector *connector, |
|
- | 387 | int (*get_edid_block)(void *data, u8 *buf, unsigned int block, |
|
- | 388 | size_t len), |
|
- | 389 | void *data); |
|
281 | 390 |