]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/i915/dp: Print only sink or branch specific OUI based on dev type
authorImre Deak <imre.deak@intel.com>
Mon, 24 Oct 2016 16:33:26 +0000 (19:33 +0300)
committerImre Deak <imre.deak@intel.com>
Wed, 26 Oct 2016 09:40:59 +0000 (12:40 +0300)
There are two separate sets of DPCD registers for the DP OUI - as well as
for the device ID and HW/SW revision - based on whether the given DP
device is a branch or a sink. Currently we print both branch and sink
OUIs, for consistency print only the one that corresponds to the
probed device.

v2:
- Split out this change into a separate patch. (Jani)

Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1477326811-30431-4-git-send-email-imre.deak@intel.com
drivers/gpu/drm/i915/intel_dp.c

index 5af3907cf6720323e94c9f2d5e6f39f91562b84d..332dc86a325f2e3e4e68eb8ada2f41e70fe8329b 100644 (file)
@@ -3624,17 +3624,17 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
 static void
 intel_dp_probe_oui(struct intel_dp *intel_dp)
 {
+       bool is_branch = drm_dp_is_branch(intel_dp->dpcd);
        u8 buf[3];
 
        if (!(intel_dp->dpcd[DP_DOWN_STREAM_PORT_COUNT] & DP_OUI_SUPPORT))
                return;
 
-       if (drm_dp_dpcd_read(&intel_dp->aux, DP_SINK_OUI, buf, 3) == 3)
-               DRM_DEBUG_KMS("Sink OUI: %02hx%02hx%02hx\n",
-                             buf[0], buf[1], buf[2]);
-
-       if (drm_dp_dpcd_read(&intel_dp->aux, DP_BRANCH_OUI, buf, 3) == 3)
-               DRM_DEBUG_KMS("Branch OUI: %02hx%02hx%02hx\n",
+       if (drm_dp_dpcd_read(&intel_dp->aux,
+                            is_branch ? DP_BRANCH_OUI : DP_SINK_OUI,
+                            buf, 3) == 3)
+               DRM_DEBUG_KMS("%s OUI: %02hx%02hx%02hx\n",
+                             is_branch ? "Branch" : "Sink",
                              buf[0], buf[1], buf[2]);
 }