drm/i915: simplify condition for digital port
authorJani Nikula <jani.nikula@intel.com>
Thu, 28 May 2015 12:43:52 +0000 (15:43 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 29 May 2015 08:15:30 +0000 (10:15 +0200)
As the hpd loops have been merged together, we don't have to maintain
state for all hpd triggers.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_irq.c

index b53b91744a17b5d38840af3898e3a34be1318dd5..6fffbfd3121a7d52001ba3b0ca65049ad19450dc 100644 (file)
@@ -1432,7 +1432,7 @@ static void intel_hpd_irq_handler(struct drm_device *dev,
        bool storm_detected = false;
        bool queue_dig = false, queue_hp = false;
        u32 dig_shift;
-       u32 dig_port_mask = 0;
+       bool is_dig_port;
 
        if (!hotplug_trigger)
                return;
@@ -1446,7 +1446,9 @@ static void intel_hpd_irq_handler(struct drm_device *dev,
                        continue;
 
                port = get_port_from_pin(i);
-               if (port && dev_priv->hotplug.irq_port[port]) {
+               is_dig_port = port && dev_priv->hotplug.irq_port[port];
+
+               if (is_dig_port) {
                        bool long_hpd;
 
                        if (!HAS_GMCH_DISPLAY(dev_priv)) {
@@ -1466,8 +1468,6 @@ static void intel_hpd_irq_handler(struct drm_device *dev,
                        queue_dig = true;
                        if (long_hpd) {
                                dev_priv->hotplug.long_port_mask |= (1 << port);
-                               /* FIXME: this can be simplified. */
-                               dig_port_mask |= hpd[i];
                        } else {
                                /* for short HPD just trigger the digital queue */
                                dev_priv->hotplug.short_port_mask |= (1 << port);
@@ -1492,7 +1492,7 @@ static void intel_hpd_irq_handler(struct drm_device *dev,
                if (dev_priv->hotplug.stats[i].state != HPD_ENABLED)
                        continue;
 
-               if (!(dig_port_mask & hpd[i])) {
+               if (!is_dig_port) {
                        dev_priv->hotplug.event_bits |= (1 << i);
                        queue_hp = true;
                }