drm/i915: Return the real error code from intel_set_mode()
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / drm / i915 / intel_tv.c
index 62bb048c135e510020c619d2fdf310392d129db8..984a113c5d136770d340a84f0398f7c2b10e1b74 100644 (file)
@@ -1088,13 +1088,11 @@ intel_tv_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
                int dspcntr_reg = DSPCNTR(intel_crtc->plane);
                int pipeconf = I915_READ(pipeconf_reg);
                int dspcntr = I915_READ(dspcntr_reg);
-               int dspbase_reg = DSPADDR(intel_crtc->plane);
                int xpos = 0x0, ypos = 0x0;
                unsigned int xsize, ysize;
                /* Pipe must be off here */
                I915_WRITE(dspcntr_reg, dspcntr & ~DISPLAY_PLANE_ENABLE);
-               /* Flush the plane changes */
-               I915_WRITE(dspbase_reg, I915_READ(dspbase_reg));
+               intel_flush_display_plane(dev_priv, intel_crtc->plane);
 
                /* Wait for vblank for the disable to take effect */
                if (IS_GEN2(dev))
@@ -1123,8 +1121,7 @@ intel_tv_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
 
                I915_WRITE(pipeconf_reg, pipeconf);
                I915_WRITE(dspcntr_reg, dspcntr);
-               /* Flush the plane changes */
-               I915_WRITE(dspbase_reg, I915_READ(dspbase_reg));
+               intel_flush_display_plane(dev_priv, intel_crtc->plane);
        }
 
        j = 0;
@@ -1292,7 +1289,7 @@ static void intel_tv_find_better_format(struct drm_connector *connector)
        }
 
        intel_tv->tv_format = tv_mode->name;
-       drm_connector_property_set_value(connector,
+       drm_object_property_set_value(&connector->base,
                connector->dev->mode_config.tv_mode_property, i);
 }
 
@@ -1446,7 +1443,7 @@ intel_tv_set_property(struct drm_connector *connector, struct drm_property *prop
        int ret = 0;
        bool changed = false;
 
-       ret = drm_connector_property_set_value(connector, property, val);
+       ret = drm_object_property_set_value(&connector->base, property, val);
        if (ret < 0)
                goto out;
 
@@ -1482,8 +1479,7 @@ intel_tv_set_property(struct drm_connector *connector, struct drm_property *prop
        }
 
        if (changed && crtc)
-               intel_set_mode(crtc, &crtc->mode,
-                              crtc->x, crtc->y, crtc->fb);
+               intel_crtc_restore_mode(crtc);
 out:
        return ret;
 }
@@ -1658,18 +1654,18 @@ intel_tv_init(struct drm_device *dev)
                                      ARRAY_SIZE(tv_modes),
                                      tv_format_names);
 
-       drm_connector_attach_property(connector, dev->mode_config.tv_mode_property,
+       drm_object_attach_property(&connector->base, dev->mode_config.tv_mode_property,
                                   initial_mode);
-       drm_connector_attach_property(connector,
+       drm_object_attach_property(&connector->base,
                                   dev->mode_config.tv_left_margin_property,
                                   intel_tv->margin[TV_MARGIN_LEFT]);
-       drm_connector_attach_property(connector,
+       drm_object_attach_property(&connector->base,
                                   dev->mode_config.tv_top_margin_property,
                                   intel_tv->margin[TV_MARGIN_TOP]);
-       drm_connector_attach_property(connector,
+       drm_object_attach_property(&connector->base,
                                   dev->mode_config.tv_right_margin_property,
                                   intel_tv->margin[TV_MARGIN_RIGHT]);
-       drm_connector_attach_property(connector,
+       drm_object_attach_property(&connector->base,
                                   dev->mode_config.tv_bottom_margin_property,
                                   intel_tv->margin[TV_MARGIN_BOTTOM]);
        drm_sysfs_connector_add(connector);