aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2017-09-05 08:10:16 -0400
committerArchit Taneja <architt@codeaurora.org>2017-09-16 05:40:17 -0400
commitfcb4c5eee79ea17e1fbc5b3ebbd575d56714fabe (patch)
treefefbb1e9b6f70cb93ed37eb03c314630d37f7947
parent6f39ed4f0939e6bef722f0096894c1a986da9c9a (diff)
drm/bridge: adv7511: Remove private copy of the EDID
The adv7511 driver keeps a private copy of the EDID in its driver state struct. But this copy is only used in adv7511_get_modes() where it is also retrieved, so there is no need to keep this extra copy around. If a need to access the EDID elsewhere in the driver ever arises the copy that is stored in the connector can be used. This copy is accessible through drm_connector_get_edid(). Note, this patch removes the NULL check of the EDID before passing it to drm_detect_hdmi_monitor(), but that is fine since the function correctly handles the case where the EDID is NULL. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: https://patchwork.freedesktop.org/patch/msgid/20170905121018.11477-2-lars@metafoo.de
-rw-r--r--drivers/gpu/drm/bridge/adv7511/adv7511.h2
-rw-r--r--drivers/gpu/drm/bridge/adv7511/adv7511_drv.c16
2 files changed, 6 insertions, 12 deletions
diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511.h b/drivers/gpu/drm/bridge/adv7511/adv7511.h
index fe18a5d2d84b..12ef2d8ee110 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7511.h
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511.h
@@ -328,8 +328,6 @@ struct adv7511 {
328 enum adv7511_sync_polarity hsync_polarity; 328 enum adv7511_sync_polarity hsync_polarity;
329 bool rgb; 329 bool rgb;
330 330
331 struct edid *edid;
332
333 struct gpio_desc *gpio_pd; 331 struct gpio_desc *gpio_pd;
334 332
335 struct regulator_bulk_data *supplies; 333 struct regulator_bulk_data *supplies;
diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
index fb8f4cd29e15..94d598d8aedf 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
@@ -199,17 +199,14 @@ static const uint16_t adv7511_csc_ycbcr_to_rgb[] = {
199 199
200static void adv7511_set_config_csc(struct adv7511 *adv7511, 200static void adv7511_set_config_csc(struct adv7511 *adv7511,
201 struct drm_connector *connector, 201 struct drm_connector *connector,
202 bool rgb) 202 bool rgb, bool hdmi_mode)
203{ 203{
204 struct adv7511_video_config config; 204 struct adv7511_video_config config;
205 bool output_format_422, output_format_ycbcr; 205 bool output_format_422, output_format_ycbcr;
206 unsigned int mode; 206 unsigned int mode;
207 uint8_t infoframe[17]; 207 uint8_t infoframe[17];
208 208
209 if (adv7511->edid) 209 config.hdmi_mode = hdmi_mode;
210 config.hdmi_mode = drm_detect_hdmi_monitor(adv7511->edid);
211 else
212 config.hdmi_mode = false;
213 210
214 hdmi_avi_infoframe_init(&config.avi_infoframe); 211 hdmi_avi_infoframe_init(&config.avi_infoframe);
215 212
@@ -589,13 +586,14 @@ static int adv7511_get_modes(struct adv7511 *adv7511,
589 if (!adv7511->powered) 586 if (!adv7511->powered)
590 __adv7511_power_off(adv7511); 587 __adv7511_power_off(adv7511);
591 588
592 kfree(adv7511->edid);
593 adv7511->edid = edid;
594 589
595 drm_mode_connector_update_edid_property(connector, edid); 590 drm_mode_connector_update_edid_property(connector, edid);
596 count = drm_add_edid_modes(connector, edid); 591 count = drm_add_edid_modes(connector, edid);
597 592
598 adv7511_set_config_csc(adv7511, connector, adv7511->rgb); 593 adv7511_set_config_csc(adv7511, connector, adv7511->rgb,
594 drm_detect_hdmi_monitor(edid));
595
596 kfree(edid);
599 597
600 return count; 598 return count;
601} 599}
@@ -1156,8 +1154,6 @@ static int adv7511_remove(struct i2c_client *i2c)
1156 1154
1157 i2c_unregister_device(adv7511->i2c_edid); 1155 i2c_unregister_device(adv7511->i2c_edid);
1158 1156
1159 kfree(adv7511->edid);
1160
1161 return 0; 1157 return 0;
1162} 1158}
1163 1159