UPSTREAM: drm/edid: Move dvi_dual/max_tmds_clock to drm_display_info
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 28 Sep 2016 13:51:37 +0000 (16:51 +0300)
committerZheng Yang <zhengyang@rock-chips.com>
Tue, 20 Jun 2017 09:22:50 +0000 (17:22 +0800)
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

Change-Id: I678b50021e8b9fb03554f15e2bc003037813d51a
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
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
(cherry picked from commit 2a272ca9b8f748aa50f5f2df391a4bf05fd9fd29)

drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
drivers/gpu/drm/drm_edid.c
drivers/gpu/drm/radeon/radeon_connectors.c
include/drm/drm_crtc.h

index 86e95703a49fb5558f69b2f1dada595929e9e53d..bd21bd256331a7ed0555dd0bb1c06b1722ae2258 100644 (file)
@@ -168,12 +168,12 @@ int amdgpu_connector_get_monitor_bpc(struct drm_connector *connector)
                }
 
                /* Any defined maximum tmds clock limit we must not exceed? */
-               if (connector->max_tmds_clock > 0) {
+               if (connector->display_info.max_tmds_clock > 0) {
                        /* mode_clock is clock in kHz for mode to be modeset on this connector */
                        mode_clock = amdgpu_connector->pixelclock_for_modeset;
 
                        /* Maximum allowable input clock in kHz */
-                       max_tmds_clock = connector->max_tmds_clock;
+                       max_tmds_clock = connector->display_info.max_tmds_clock;
 
                        DRM_DEBUG("%s: hdmi mode dotclock %d kHz, max tmds input clock %d kHz.\n",
                                  connector->name, mode_clock, max_tmds_clock);
index 49ffcfb1fe9b69b95570042b6d66f6b20f42d50f..ff3f8bea18db7472eb15ea8e23bbf50615be2fba 100644 (file)
@@ -3604,14 +3604,15 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
 static void
 parse_hdmi_vsdb(struct drm_connector *connector, const u8 *db)
 {
+       struct drm_display_info *info = &connector->display_info;
        u8 len = cea_db_payload_len(db);
 
        if (len >= 6) {
                connector->eld[5] |= (db[6] >> 7) << 1;  /* Supports_AI */
-               connector->dvi_dual = db[6] & 1;
+               info->dvi_dual = db[6] & 1;
        }
        if (len >= 7)
-               connector->max_tmds_clock = db[7] * 5000;
+               info->max_tmds_clock = db[7] * 5000;
        if (len >= 8) {
                connector->latency_present[0] = db[8] >> 7;
                connector->latency_present[1] = (db[8] >> 6) & 1;
@@ -3630,8 +3631,8 @@ parse_hdmi_vsdb(struct drm_connector *connector, const u8 *db)
                    "latency present %d %d, "
                    "video latency %d %d, "
                    "audio latency %d %d\n",
-                   connector->dvi_dual,
-                   connector->max_tmds_clock,
+                   info->dvi_dual,
+                   info->max_tmds_clock,
              (int) connector->latency_present[0],
              (int) connector->latency_present[1],
                    connector->video_latency[0],
@@ -3688,6 +3689,7 @@ monitor_name(struct detailed_timing *t, void *data)
  */
 void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid)
 {
+       struct drm_display_info *info = &connector->display_info;
        uint8_t *eld = connector->eld;
        u8 *cea;
        u8 *name;
@@ -3705,8 +3707,8 @@ void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid)
        connector->video_latency[1] = 0;
        connector->audio_latency[1] = 0;
 
-       connector->max_tmds_clock = 0;
-       connector->dvi_dual = false;
+       info->max_tmds_clock = 0;
+       info->dvi_dual = false;
 
        cea = drm_find_cea_extension(edid);
        if (!cea) {
index 191b86c0f542abf380428a7a6516143f141dcbcd..82d68d457e39703e5c4b557544a432e741a66115 100644 (file)
@@ -197,12 +197,12 @@ int radeon_get_monitor_bpc(struct drm_connector *connector)
                }
 
                /* Any defined maximum tmds clock limit we must not exceed? */
-               if (connector->max_tmds_clock > 0) {
+               if (connector->display_info.max_tmds_clock > 0) {
                        /* mode_clock is clock in kHz for mode to be modeset on this connector */
                        mode_clock = radeon_connector->pixelclock_for_modeset;
 
                        /* Maximum allowable input clock in kHz */
-                       max_tmds_clock = connector->max_tmds_clock;
+                       max_tmds_clock = connector->display_info.max_tmds_clock;
 
                        DRM_DEBUG("%s: hdmi mode dotclock %d kHz, max tmds input clock %d kHz.\n",
                                          connector->name, mode_clock, max_tmds_clock);
index 6c6f6545c05fd71ceb9ab5dabac8a1e9fca7a559..8035d0e83f86b16dae6d6db6ff11cc370886a395 100644 (file)
@@ -144,6 +144,17 @@ struct drm_display_info {
        const u32 *bus_formats;
        unsigned int num_bus_formats;
 
+       /**
+        * @max_tmds_clock: Maximum TMDS clock rate supported by the
+        * sink in kHz. 0 means undefined.
+        */
+       int max_tmds_clock;
+
+       /**
+        * @dvi_dual: Dual-link DVI sink?
+        */
+       bool dvi_dual;
+
        /* Mask of supported hdmi deep color modes */
        u8 edid_hdmi_dc_modes;
 
@@ -718,8 +729,6 @@ struct drm_encoder {
  * @encoder_ids: valid encoders for this connector
  * @encoder: encoder driving this connector, if any
  * @eld: EDID-like data, if present
- * @dvi_dual: dual link DVI, if found
- * @max_tmds_clock: max clock rate, if found
  * @latency_present: AV delay info from ELD, if found
  * @video_latency: video latency info from ELD, if found
  * @audio_latency: audio latency info from ELD, if found
@@ -797,8 +806,6 @@ struct drm_connector {
 
        /* EDID bits */
        uint8_t eld[MAX_ELD_BYTES];
-       bool dvi_dual;
-       int max_tmds_clock;     /* in kHz */
        bool latency_present[2];
        int video_latency[2];   /* [0]: progressive, [1]: interlaced */
        int audio_latency[2];