aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2016-09-28 09:51:37 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-10-04 02:23:10 -0400
commit2a272ca9b8f748aa50f5f2df391a4bf05fd9fd29 (patch)
tree8ec9b3d272e0400f3701af80b63e090c5bfc9a3f
parentab5603c4d334224e3a884e62e7083ec69849fa7a (diff)
drm/edid: Move dvi_dual/max_tmds_clock to drm_display_info
We have the drm_display_info for storing information about the sink, so let's move dvi_dual and max_tmds_clock in there. v2: Deal with superfluous code shuffling Document dvi_dual and max_tmds_clock too Cc: Alex Deucher <alexander.deucher@amd.com> Cc: "Christian König" <christian.koenig@amd.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Christian König <christian.koenig@amd.com> (v1) Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1475070703-6435-5-git-send-email-ville.syrjala@linux.intel.com
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c4
-rw-r--r--drivers/gpu/drm/drm_edid.c14
-rw-r--r--drivers/gpu/drm/radeon/radeon_connectors.c4
-rw-r--r--include/drm/drm_connector.h15
4 files changed, 23 insertions, 14 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
index 58d51e680385..22c11e7698c8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
@@ -168,12 +168,12 @@ int amdgpu_connector_get_monitor_bpc(struct drm_connector *connector)
168 } 168 }
169 169
170 /* Any defined maximum tmds clock limit we must not exceed? */ 170 /* Any defined maximum tmds clock limit we must not exceed? */
171 if (connector->max_tmds_clock > 0) { 171 if (connector->display_info.max_tmds_clock > 0) {
172 /* mode_clock is clock in kHz for mode to be modeset on this connector */ 172 /* mode_clock is clock in kHz for mode to be modeset on this connector */
173 mode_clock = amdgpu_connector->pixelclock_for_modeset; 173 mode_clock = amdgpu_connector->pixelclock_for_modeset;
174 174
175 /* Maximum allowable input clock in kHz */ 175 /* Maximum allowable input clock in kHz */
176 max_tmds_clock = connector->max_tmds_clock; 176 max_tmds_clock = connector->display_info.max_tmds_clock;
177 177
178 DRM_DEBUG("%s: hdmi mode dotclock %d kHz, max tmds input clock %d kHz.\n", 178 DRM_DEBUG("%s: hdmi mode dotclock %d kHz, max tmds input clock %d kHz.\n",
179 connector->name, mode_clock, max_tmds_clock); 179 connector->name, mode_clock, max_tmds_clock);
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index b144d5ee66ea..81b9ef82af73 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -3255,14 +3255,15 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
3255static void 3255static void
3256parse_hdmi_vsdb(struct drm_connector *connector, const u8 *db) 3256parse_hdmi_vsdb(struct drm_connector *connector, const u8 *db)
3257{ 3257{
3258 struct drm_display_info *info = &connector->display_info;
3258 u8 len = cea_db_payload_len(db); 3259 u8 len = cea_db_payload_len(db);
3259 3260
3260 if (len >= 6) { 3261 if (len >= 6) {
3261 connector->eld[5] |= (db[6] >> 7) << 1; /* Supports_AI */ 3262 connector->eld[5] |= (db[6] >> 7) << 1; /* Supports_AI */
3262 connector->dvi_dual = db[6] & 1; 3263 info->dvi_dual = db[6] & 1;
3263 } 3264 }
3264 if (len >= 7) 3265 if (len >= 7)
3265 connector->max_tmds_clock = db[7] * 5000; 3266 info->max_tmds_clock = db[7] * 5000;
3266 if (len >= 8) { 3267 if (len >= 8) {
3267 connector->latency_present[0] = db[8] >> 7; 3268 connector->latency_present[0] = db[8] >> 7;
3268 connector->latency_present[1] = (db[8] >> 6) & 1; 3269 connector->latency_present[1] = (db[8] >> 6) & 1;
@@ -3281,8 +3282,8 @@ parse_hdmi_vsdb(struct drm_connector *connector, const u8 *db)
3281 "latency present %d %d, " 3282 "latency present %d %d, "
3282 "video latency %d %d, " 3283 "video latency %d %d, "
3283 "audio latency %d %d\n", 3284 "audio latency %d %d\n",
3284 connector->dvi_dual, 3285 info->dvi_dual,
3285 connector->max_tmds_clock, 3286 info->max_tmds_clock,
3286 (int) connector->latency_present[0], 3287 (int) connector->latency_present[0],
3287 (int) connector->latency_present[1], 3288 (int) connector->latency_present[1],
3288 connector->video_latency[0], 3289 connector->video_latency[0],
@@ -3349,6 +3350,7 @@ EXPORT_SYMBOL(drm_edid_get_monitor_name);
3349 */ 3350 */
3350void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid) 3351void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid)
3351{ 3352{
3353 struct drm_display_info *info = &connector->display_info;
3352 uint8_t *eld = connector->eld; 3354 uint8_t *eld = connector->eld;
3353 u8 *cea; 3355 u8 *cea;
3354 u8 *db; 3356 u8 *db;
@@ -3365,8 +3367,8 @@ void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid)
3365 connector->video_latency[1] = 0; 3367 connector->video_latency[1] = 0;
3366 connector->audio_latency[1] = 0; 3368 connector->audio_latency[1] = 0;
3367 3369
3368 connector->max_tmds_clock = 0; 3370 info->max_tmds_clock = 0;
3369 connector->dvi_dual = false; 3371 info->dvi_dual = false;
3370 3372
3371 cea = drm_find_cea_extension(edid); 3373 cea = drm_find_cea_extension(edid);
3372 if (!cea) { 3374 if (!cea) {
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index db5488732e31..50e96d2c593d 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -198,12 +198,12 @@ int radeon_get_monitor_bpc(struct drm_connector *connector)
198 } 198 }
199 199
200 /* Any defined maximum tmds clock limit we must not exceed? */ 200 /* Any defined maximum tmds clock limit we must not exceed? */
201 if (connector->max_tmds_clock > 0) { 201 if (connector->display_info.max_tmds_clock > 0) {
202 /* mode_clock is clock in kHz for mode to be modeset on this connector */ 202 /* mode_clock is clock in kHz for mode to be modeset on this connector */
203 mode_clock = radeon_connector->pixelclock_for_modeset; 203 mode_clock = radeon_connector->pixelclock_for_modeset;
204 204
205 /* Maximum allowable input clock in kHz */ 205 /* Maximum allowable input clock in kHz */
206 max_tmds_clock = connector->max_tmds_clock; 206 max_tmds_clock = connector->display_info.max_tmds_clock;
207 207
208 DRM_DEBUG("%s: hdmi mode dotclock %d kHz, max tmds input clock %d kHz.\n", 208 DRM_DEBUG("%s: hdmi mode dotclock %d kHz, max tmds input clock %d kHz.\n",
209 connector->name, mode_clock, max_tmds_clock); 209 connector->name, mode_clock, max_tmds_clock);
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 5928cb74a06d..287a610f464e 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -167,6 +167,17 @@ struct drm_display_info {
167 u32 bus_flags; 167 u32 bus_flags;
168 168
169 /** 169 /**
170 * @max_tmds_clock: Maximum TMDS clock rate supported by the
171 * sink in kHz. 0 means undefined.
172 */
173 int max_tmds_clock;
174
175 /**
176 * @dvi_dual: Dual-link DVI sink?
177 */
178 bool dvi_dual;
179
180 /**
170 * @edid_hdmi_dc_modes: Mask of supported hdmi deep color modes. Even 181 * @edid_hdmi_dc_modes: Mask of supported hdmi deep color modes. Even
171 * more stuff redundant with @bus_formats. 182 * more stuff redundant with @bus_formats.
172 */ 183 */
@@ -515,8 +526,6 @@ struct drm_cmdline_mode {
515 * @encoder_ids: valid encoders for this connector 526 * @encoder_ids: valid encoders for this connector
516 * @encoder: encoder driving this connector, if any 527 * @encoder: encoder driving this connector, if any
517 * @eld: EDID-like data, if present 528 * @eld: EDID-like data, if present
518 * @dvi_dual: dual link DVI, if found
519 * @max_tmds_clock: max clock rate, if found
520 * @latency_present: AV delay info from ELD, if found 529 * @latency_present: AV delay info from ELD, if found
521 * @video_latency: video latency info from ELD, if found 530 * @video_latency: video latency info from ELD, if found
522 * @audio_latency: audio latency info from ELD, if found 531 * @audio_latency: audio latency info from ELD, if found
@@ -650,8 +659,6 @@ struct drm_connector {
650#define MAX_ELD_BYTES 128 659#define MAX_ELD_BYTES 128
651 /* EDID bits */ 660 /* EDID bits */
652 uint8_t eld[MAX_ELD_BYTES]; 661 uint8_t eld[MAX_ELD_BYTES];
653 bool dvi_dual;
654 int max_tmds_clock; /* in kHz */
655 bool latency_present[2]; 662 bool latency_present[2];
656 int video_latency[2]; /* [0]: progressive, [1]: interlaced */ 663 int video_latency[2]; /* [0]: progressive, [1]: interlaced */
657 int audio_latency[2]; 664 int audio_latency[2];