drm/i915/bxt: get_hw_state for BXT
authorShashank Sharma <shashank.sharma@intel.com>
Tue, 1 Sep 2015 14:11:45 +0000 (19:41 +0530)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 2 Oct 2015 12:45:25 +0000 (14:45 +0200)
Pick appropriate port control register (BXT or VLV), based on device.
Get the current hw state wrt Mipi port.

v2: Rebased on latest drm nightly branch.

v3: Removed the GET_DSI_PORT_CTRL Macro for consistency with earlier
    implementations as per Jani's suggestion.

Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_dsi.c

index 505501e808a2306104ac3d9411a3c7bf652b22e7..65911065e65494d16ff0ea4ccf04439dd7b046e4 100644 (file)
@@ -656,7 +656,7 @@ static bool intel_dsi_get_hw_state(struct intel_encoder *encoder,
        struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
        struct drm_device *dev = encoder->base.dev;
        enum intel_display_power_domain power_domain;
-       u32 dpi_enabled, func;
+       u32 dpi_enabled, func, ctrl_reg;
        enum port port;
 
        DRM_DEBUG_KMS("\n");
@@ -668,8 +668,9 @@ static bool intel_dsi_get_hw_state(struct intel_encoder *encoder,
        /* XXX: this only works for one DSI output */
        for_each_dsi_port(port, intel_dsi->ports) {
                func = I915_READ(MIPI_DSI_FUNC_PRG(port));
-               dpi_enabled = I915_READ(MIPI_PORT_CTRL(port)) &
-                                                       DPI_ENABLE;
+               ctrl_reg = IS_BROXTON(dev) ? BXT_MIPI_PORT_CTRL(port) :
+                                               MIPI_PORT_CTRL(port);
+               dpi_enabled = I915_READ(ctrl_reg) & DPI_ENABLE;
 
                /* Due to some hardware limitations on BYT, MIPI Port C DPI
                 * Enable bit does not get set. To check whether DSI Port C