drm/i915: Use existing DSI backlight ports info
authorMadhav Chauhan <madhav.chauhan@intel.com>
Fri, 13 Oct 2017 12:45:00 +0000 (18:15 +0530)
committerJani Nikula <jani.nikula@intel.com>
Fri, 20 Oct 2017 08:28:49 +0000 (11:28 +0300)
This patch re-use already parsed DSI backlight/cabc ports
info for saving it inside struct intel_dsi rather than
parsing it at the time of DSI initialization.

V2: Remove backlight and cabc variable initialization (Jani N).

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Madhav Chauhan <madhav.chauhan@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1507898700-20016-2-git-send-email-madhav.chauhan@intel.com
drivers/gpu/drm/i915/intel_bios.c
drivers/gpu/drm/i915/intel_dsi.c

index c5405d1..a0c42e6 100644 (file)
@@ -699,8 +699,6 @@ static void parse_dsi_backlight_ports(struct drm_i915_private *dev_priv,
                if (dev_priv->vbt.dsi.config->cabc_supported)
                        dev_priv->vbt.dsi.cabc_ports = BIT(port);
 
-               dev_priv->vbt.dsi.config->dl_dcs_cabc_ports = 0;
-               dev_priv->vbt.dsi.config->dl_dcs_backlight_ports = 0;
                return;
        }
 
index 66bbedc..83f1584 100644 (file)
@@ -1751,42 +1751,13 @@ void intel_dsi_init(struct drm_i915_private *dev_priv)
        else
                intel_encoder->crtc_mask = BIT(PIPE_B);
 
-       if (dev_priv->vbt.dsi.config->dual_link) {
+       if (dev_priv->vbt.dsi.config->dual_link)
                intel_dsi->ports = BIT(PORT_A) | BIT(PORT_C);
-
-               switch (dev_priv->vbt.dsi.config->dl_dcs_backlight_ports) {
-               case DL_DCS_PORT_A:
-                       intel_dsi->dcs_backlight_ports = BIT(PORT_A);
-                       break;
-               case DL_DCS_PORT_C:
-                       intel_dsi->dcs_backlight_ports = BIT(PORT_C);
-                       break;
-               default:
-               case DL_DCS_PORT_A_AND_C:
-                       intel_dsi->dcs_backlight_ports = BIT(PORT_A) | BIT(PORT_C);
-                       break;
-               }
-
-               switch (dev_priv->vbt.dsi.config->dl_dcs_cabc_ports) {
-               case DL_DCS_PORT_A:
-                       intel_dsi->dcs_cabc_ports = BIT(PORT_A);
-                       break;
-               case DL_DCS_PORT_C:
-                       intel_dsi->dcs_cabc_ports = BIT(PORT_C);
-                       break;
-               default:
-               case DL_DCS_PORT_A_AND_C:
-                       intel_dsi->dcs_cabc_ports = BIT(PORT_A) | BIT(PORT_C);
-                       break;
-               }
-       } else {
+       else
                intel_dsi->ports = BIT(port);
-               intel_dsi->dcs_backlight_ports = BIT(port);
-               intel_dsi->dcs_cabc_ports = BIT(port);
-       }
 
-       if (!dev_priv->vbt.dsi.config->cabc_supported)
-               intel_dsi->dcs_cabc_ports = 0;
+       intel_dsi->dcs_backlight_ports = dev_priv->vbt.dsi.bl_ports;
+       intel_dsi->dcs_cabc_ports = dev_priv->vbt.dsi.cabc_ports;
 
        /* Create a DSI host (and a device) for each port. */
        for_each_dsi_port(port, intel_dsi->ports) {