With this, the remaining non-const parts are the ones that actually modify the EDID, for example to fix corrupt EDID.
Unified · Split
| @@ -2150,7 +2150,7 @@ static u32 edid_extract_panel_id(const struct edid *edid) · 2149 unmodified lines | ||
| 2150 | 2150 | |
| 2151 | 2151 | u32 drm_edid_get_panel_id(struct i2c_adapter *adapter) |
| 2152 | 2152 | { |
| 2153 | − struct edid *edid; | |
| 2153 | + const struct edid *edid; | |
| 2154 | 2154 | u32 panel_id; |
| 2155 | 2155 | |
| 2156 | 2156 | edid = drm_do_get_edid_base_block(NULL, drm_do_probe_ddc_edid, adapter); |
| @@ -3664,7 +3664,7 @@ static bool drm_valid_hdmi_vic(u8 vic) · 1507 unmodified lines | ||
| 3664 | 3664 | } |
| 3665 | 3665 | |
| 3666 | 3666 | static int |
| 3667 | −add_alternate_cea_modes(struct drm_connector *connector, struct edid *edid) | |
| 3667 | +add_alternate_cea_modes(struct drm_connector *connector, const struct edid *edid) | |
| 3668 | 3668 | { |
| 3669 | 3669 | struct drm_device *dev = connector->dev; |
| 3670 | 3670 | struct drm_display_mode *mode, *tmp; |
| @@ -4345,7 +4345,7 @@ static void drm_parse_y420cmdb_bitmap(struct drm_connector *connector, · 674 unmodified lines | ||
| 4345 | 4345 | } |
| 4346 | 4346 | |
| 4347 | 4347 | static int |
| 4348 | −add_cea_modes(struct drm_connector *connector, struct edid *edid) | |
| 4348 | +add_cea_modes(struct drm_connector *connector, const struct edid *edid) | |
| 4349 | 4349 | { |
| 4350 | 4350 | const u8 *cea = drm_find_cea_extension(edid); |
| 4351 | 4351 | const u8 *db, *hdmi = NULL, *video = NULL; |
| @@ -4551,7 +4551,7 @@ static int get_monitor_name(const struct edid *edid, char name[13]) · 199 unmodified lines | ||
| 4551 | 4551 | * @bufsize: The size of the name buffer (should be at least 14 chars.) |
| 4552 | 4552 | * |
| 4553 | 4553 | */ |
| 4554 | −void drm_edid_get_monitor_name(struct edid *edid, char *name, int bufsize) | |
| 4554 | +void drm_edid_get_monitor_name(const struct edid *edid, char *name, int bufsize) | |
| 4555 | 4555 | { |
| 4556 | 4556 | int name_length; |
| 4557 | 4557 | char buf[13]; |
| @@ -4585,7 +4585,8 @@ static void clear_eld(struct drm_connector *connector) · 27 unmodified lines | ||
| 4585 | 4585 | * Fill the ELD (EDID-Like Data) buffer for passing to the audio driver. The |
| 4586 | 4586 | * HDCP and Port_ID ELD fields are left for the graphics driver to fill in. |
| 4587 | 4587 | */ |
| 4588 | −static void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid) | |
| 4588 | +static void drm_edid_to_eld(struct drm_connector *connector, | |
| 4589 | + const struct edid *edid) | |
| 4589 | 4590 | { |
| 4590 | 4591 | uint8_t *eld = connector->eld; |
| 4591 | 4592 | const u8 *cea; |
| @@ -4681,7 +4682,7 @@ static void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid) · 89 unmodified lines | ||
| 4681 | 4682 | * |
| 4682 | 4683 | * Return: The number of found SADs or negative number on error. |
| 4683 | 4684 | */ |
| 4684 | −int drm_edid_to_sad(struct edid *edid, struct cea_sad **sads) | |
| 4685 | +int drm_edid_to_sad(const struct edid *edid, struct cea_sad **sads) | |
| 4685 | 4686 | { |
| 4686 | 4687 | int count = 0; |
| 4687 | 4688 | int i, start, end, dbl; |
| @@ -4743,7 +4744,7 @@ EXPORT_SYMBOL(drm_edid_to_sad); · 55 unmodified lines | ||
| 4743 | 4744 | * Return: The number of found Speaker Allocation Blocks or negative number on |
| 4744 | 4745 | * error. |
| 4745 | 4746 | */ |
| 4746 | −int drm_edid_to_speaker_allocation(struct edid *edid, u8 **sadb) | |
| 4747 | +int drm_edid_to_speaker_allocation(const struct edid *edid, u8 **sadb) | |
| 4747 | 4748 | { |
| 4748 | 4749 | int count = 0; |
| 4749 | 4750 | int i, start, end, dbl; |
| @@ -4838,7 +4839,7 @@ EXPORT_SYMBOL(drm_av_sync_delay); · 88 unmodified lines | ||
| 4838 | 4839 | * |
| 4839 | 4840 | * Return: True if the monitor is HDMI, false if not or unknown. |
| 4840 | 4841 | */ |
| 4841 | −bool drm_detect_hdmi_monitor(struct edid *edid) | |
| 4842 | +bool drm_detect_hdmi_monitor(const struct edid *edid) | |
| 4842 | 4843 | { |
| 4843 | 4844 | const u8 *edid_ext; |
| 4844 | 4845 | int i; |
| @@ -4876,7 +4877,7 @@ EXPORT_SYMBOL(drm_detect_hdmi_monitor); · 31 unmodified lines | ||
| 4876 | 4877 | * |
| 4877 | 4878 | * Return: True if the monitor supports audio, false otherwise. |
| 4878 | 4879 | */ |
| 4879 | −bool drm_detect_monitor_audio(struct edid *edid) | |
| 4880 | +bool drm_detect_monitor_audio(const struct edid *edid) | |
| 4880 | 4881 | { |
| 4881 | 4882 | const u8 *edid_ext; |
| 4882 | 4883 | int i, j; |
| @@ -5538,7 +5539,7 @@ static int add_displayid_detailed_1_modes(struct drm_connector *connector, · 655 unmodified lines | ||
| 5538 | 5539 | } |
| 5539 | 5540 | |
| 5540 | 5541 | static int add_displayid_detailed_modes(struct drm_connector *connector, |
| 5541 | − struct edid *edid) | |
| 5542 | + const struct edid *edid) | |
| 5542 | 5543 | { |
| 5543 | 5544 | const struct displayid_block *block; |
| 5544 | 5545 | struct displayid_iter iter; |
| @@ -372,8 +372,8 @@ struct drm_connector; · 371 unmodified lines | ||
| 372 | 372 | struct drm_connector_state; |
| 373 | 373 | struct drm_display_mode; |
| 374 | 374 | |
| 375 | −int drm_edid_to_sad(struct edid *edid, struct cea_sad **sads); | |
| 376 | −int drm_edid_to_speaker_allocation(struct edid *edid, u8 **sadb); | |
| 375 | +int drm_edid_to_sad(const struct edid *edid, struct cea_sad **sads); | |
| 376 | +int drm_edid_to_speaker_allocation(const struct edid *edid, u8 **sadb); | |
| 377 | 377 | int drm_av_sync_delay(struct drm_connector *connector, |
| 378 | 378 | const struct drm_display_mode *mode); |
| 379 | 379 | |
| @@ -569,8 +569,8 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid); · 189 unmodified lines | ||
| 569 | 569 | int drm_add_override_edid_modes(struct drm_connector *connector); |
| 570 | 570 | |
| 571 | 571 | u8 drm_match_cea_mode(const struct drm_display_mode *to_match); |
| 572 | −bool drm_detect_hdmi_monitor(struct edid *edid); | |
| 573 | −bool drm_detect_monitor_audio(struct edid *edid); | |
| 572 | +bool drm_detect_hdmi_monitor(const struct edid *edid); | |
| 573 | +bool drm_detect_monitor_audio(const struct edid *edid); | |
| 574 | 574 | enum hdmi_quantization_range |
| 575 | 575 | drm_default_rgb_quant_range(const struct drm_display_mode *mode); |
| 576 | 576 | int drm_add_modes_noedid(struct drm_connector *connector, |
| @@ -582,7 +582,7 @@ int drm_edid_header_is_valid(const u8 *raw_edid); · 5 unmodified lines | ||
| 582 | 582 | bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid, |
| 583 | 583 | bool *edid_corrupt); |
| 584 | 584 | bool drm_edid_is_valid(struct edid *edid); |
| 585 | −void drm_edid_get_monitor_name(struct edid *edid, char *name, | |
| 585 | +void drm_edid_get_monitor_name(const struct edid *edid, char *name, | |
| 586 | 586 | int buflen); |
| 587 | 587 | struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev, |
| 588 | 588 | int hsize, int vsize, int fresh, |