]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/gpu/drm/i915/intel_display.c
Merge tag 'drm-intel-next-2017-05-29' of git://anongit.freedesktop.org/git/drm-intel...
[karo-tx-linux.git] / drivers / gpu / drm / i915 / intel_display.c
index 55c2c149ad0b11dde3857fe8e45a6dd70d45e0d7..7fa21df5bcd78334ff507a305b5325d81469d91d 100644 (file)
@@ -2486,7 +2486,7 @@ intel_fill_fb_info(struct drm_i915_private *dev_priv,
 
                offset = _intel_compute_tile_offset(dev_priv, &x, &y,
                                                    fb, i, fb->pitches[i],
-                                                   DRM_ROTATE_0, tile_size);
+                                                   DRM_MODE_ROTATE_0, tile_size);
                offset /= tile_size;
 
                if (fb->modifier != DRM_FORMAT_MOD_LINEAR) {
@@ -2521,7 +2521,7 @@ intel_fill_fb_info(struct drm_i915_private *dev_priv,
                        drm_rect_rotate(&r,
                                        rot_info->plane[i].width * tile_width,
                                        rot_info->plane[i].height * tile_height,
-                                       DRM_ROTATE_270);
+                                       DRM_MODE_ROTATE_270);
                        x = r.x1;
                        y = r.y1;
 
@@ -2957,7 +2957,7 @@ int skl_check_plane_surface(struct intel_plane_state *plane_state)
        if (drm_rotation_90_or_270(rotation))
                drm_rect_rotate(&plane_state->base.src,
                                fb->width << 16, fb->height << 16,
-                               DRM_ROTATE_270);
+                               DRM_MODE_ROTATE_270);
 
        /*
         * Handle the AUX surface first since
@@ -3033,10 +3033,10 @@ static u32 i9xx_plane_ctl(const struct intel_crtc_state *crtc_state,
            fb->modifier == I915_FORMAT_MOD_X_TILED)
                dspcntr |= DISPPLANE_TILED;
 
-       if (rotation & DRM_ROTATE_180)
+       if (rotation & DRM_MODE_ROTATE_180)
                dspcntr |= DISPPLANE_ROTATE_180;
 
-       if (rotation & DRM_REFLECT_X)
+       if (rotation & DRM_MODE_REFLECT_X)
                dspcntr |= DISPPLANE_MIRROR;
 
        return dspcntr;
@@ -3064,10 +3064,10 @@ int i9xx_check_plane_surface(struct intel_plane_state *plane_state)
                int src_w = drm_rect_width(&plane_state->base.src) >> 16;
                int src_h = drm_rect_height(&plane_state->base.src) >> 16;
 
-               if (rotation & DRM_ROTATE_180) {
+               if (rotation & DRM_MODE_ROTATE_180) {
                        src_x += src_w - 1;
                        src_y += src_h - 1;
-               } else if (rotation & DRM_REFLECT_X) {
+               } else if (rotation & DRM_MODE_REFLECT_X) {
                        src_x += src_w - 1;
                }
        }
@@ -3285,17 +3285,17 @@ static u32 skl_plane_ctl_tiling(uint64_t fb_modifier)
 static u32 skl_plane_ctl_rotation(unsigned int rotation)
 {
        switch (rotation) {
-       case DRM_ROTATE_0:
+       case DRM_MODE_ROTATE_0:
                break;
        /*
-        * DRM_ROTATE_ is counter clockwise to stay compatible with Xrandr
+        * DRM_MODE_ROTATE_ is counter clockwise to stay compatible with Xrandr
         * while i915 HW rotation is clockwise, thats why this swapping.
         */
-       case DRM_ROTATE_90:
+       case DRM_MODE_ROTATE_90:
                return PLANE_CTL_ROTATE_270;
-       case DRM_ROTATE_180:
+       case DRM_MODE_ROTATE_180:
                return PLANE_CTL_ROTATE_180;
-       case DRM_ROTATE_270:
+       case DRM_MODE_ROTATE_270:
                return PLANE_CTL_ROTATE_90;
        default:
                MISSING_CASE(rotation);
@@ -4683,7 +4683,7 @@ int skl_update_scaler_crtc(struct intel_crtc_state *state)
        const struct drm_display_mode *adjusted_mode = &state->base.adjusted_mode;
 
        return skl_update_scaler(state, !state->base.active, SKL_CRTC_INDEX,
-               &state->scaler_state.scaler_id, DRM_ROTATE_0,
+               &state->scaler_state.scaler_id, DRM_MODE_ROTATE_0,
                state->pipe_src_w, state->pipe_src_h,
                adjusted_mode->crtc_hdisplay, adjusted_mode->crtc_vdisplay);
 }
@@ -9161,7 +9161,7 @@ static u32 intel_cursor_base(const struct intel_plane_state *plane_state)
 
        /* ILK+ do this automagically */
        if (HAS_GMCH_DISPLAY(dev_priv) &&
-           plane_state->base.rotation & DRM_ROTATE_180)
+           plane_state->base.rotation & DRM_MODE_ROTATE_180)
                base += (plane_state->base.crtc_h *
                         plane_state->base.crtc_w - 1) * fb->format->cpp[0];
 
@@ -9383,7 +9383,7 @@ static u32 i9xx_cursor_ctl(const struct intel_crtc_state *crtc_state,
                return 0;
        }
 
-       if (plane_state->base.rotation & DRM_ROTATE_180)
+       if (plane_state->base.rotation & DRM_MODE_ROTATE_180)
                cntl |= CURSOR_ROTATE_180;
 
        return cntl;
@@ -9416,7 +9416,7 @@ static bool i9xx_cursor_size_ok(const struct intel_plane_state *plane_state)
         * cursors.
         */
        if (HAS_CUR_FBC(dev_priv) &&
-           plane_state->base.rotation & DRM_ROTATE_0) {
+           plane_state->base.rotation & DRM_MODE_ROTATE_0) {
                if (height < 8 || height > width)
                        return false;
        } else {
@@ -11630,12 +11630,6 @@ intel_modeset_update_crtc_state(struct drm_atomic_state *state)
        for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
                to_intel_crtc(crtc)->config = to_intel_crtc_state(new_crtc_state);
 
-               /* Update hwmode for vblank functions */
-               if (new_crtc_state->active)
-                       crtc->hwmode = new_crtc_state->adjusted_mode;
-               else
-                       crtc->hwmode.crtc_clock = 0;
-
                /*
                 * Update legacy state to satisfy fbc code. This can
                 * be removed when fbc uses the atomic state.
@@ -13803,22 +13797,22 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 
        if (INTEL_GEN(dev_priv) >= 9) {
                supported_rotations =
-                       DRM_ROTATE_0 | DRM_ROTATE_90 |
-                       DRM_ROTATE_180 | DRM_ROTATE_270;
+                       DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_90 |
+                       DRM_MODE_ROTATE_180 | DRM_MODE_ROTATE_270;
        } else if (IS_CHERRYVIEW(dev_priv) && pipe == PIPE_B) {
                supported_rotations =
-                       DRM_ROTATE_0 | DRM_ROTATE_180 |
-                       DRM_REFLECT_X;
+                       DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_180 |
+                       DRM_MODE_REFLECT_X;
        } else if (INTEL_GEN(dev_priv) >= 4) {
                supported_rotations =
-                       DRM_ROTATE_0 | DRM_ROTATE_180;
+                       DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_180;
        } else {
-               supported_rotations = DRM_ROTATE_0;
+               supported_rotations = DRM_MODE_ROTATE_0;
        }
 
        if (INTEL_GEN(dev_priv) >= 4)
                drm_plane_create_rotation_property(&primary->base,
-                                                  DRM_ROTATE_0,
+                                                  DRM_MODE_ROTATE_0,
                                                   supported_rotations);
 
        drm_plane_helper_add(&primary->base, &intel_plane_helper_funcs);
@@ -13888,9 +13882,9 @@ intel_cursor_plane_create(struct drm_i915_private *dev_priv,
 
        if (INTEL_GEN(dev_priv) >= 4)
                drm_plane_create_rotation_property(&cursor->base,
-                                                  DRM_ROTATE_0,
-                                                  DRM_ROTATE_0 |
-                                                  DRM_ROTATE_180);
+                                                  DRM_MODE_ROTATE_0,
+                                                  DRM_MODE_ROTATE_0 |
+                                                  DRM_MODE_ROTATE_180);
 
        if (INTEL_GEN(dev_priv) >= 9)
                state->scaler_id = -1;
@@ -15527,8 +15521,6 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
                        to_intel_crtc_state(crtc->base.state);
                int pixclk = 0;
 
-               crtc->base.hwmode = crtc_state->base.adjusted_mode;
-
                memset(&crtc->base.mode, 0, sizeof(crtc->base.mode));
                if (crtc_state->base.active) {
                        intel_mode_from_pipe_config(&crtc->base.mode, crtc_state);
@@ -15558,7 +15550,8 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
                        if (IS_BROADWELL(dev_priv) && crtc_state->ips_enabled)
                                pixclk = DIV_ROUND_UP(pixclk * 100, 95);
 
-                       drm_calc_timestamping_constants(&crtc->base, &crtc->base.hwmode);
+                       drm_calc_timestamping_constants(&crtc->base,
+                                                       &crtc_state->base.adjusted_mode);
                        update_scanline_offset(crtc);
                }