aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index a54843fdeb2f..c9878dd1f7cd 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2890,6 +2890,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
2890 return; 2890 return;
2891 2891
2892valid_fb: 2892valid_fb:
2893 intel_state->base.rotation = plane_config->rotation;
2893 intel_fill_fb_ggtt_view(&intel_state->view, fb, 2894 intel_fill_fb_ggtt_view(&intel_state->view, fb,
2894 intel_state->base.rotation); 2895 intel_state->base.rotation);
2895 intel_state->color_plane[0].stride = 2896 intel_state->color_plane[0].stride =
@@ -7882,8 +7883,15 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc,
7882 plane_config->tiling = I915_TILING_X; 7883 plane_config->tiling = I915_TILING_X;
7883 fb->modifier = I915_FORMAT_MOD_X_TILED; 7884 fb->modifier = I915_FORMAT_MOD_X_TILED;
7884 } 7885 }
7886
7887 if (val & DISPPLANE_ROTATE_180)
7888 plane_config->rotation = DRM_MODE_ROTATE_180;
7885 } 7889 }
7886 7890
7891 if (IS_CHERRYVIEW(dev_priv) && pipe == PIPE_B &&
7892 val & DISPPLANE_MIRROR)
7893 plane_config->rotation |= DRM_MODE_REFLECT_X;
7894
7887 pixel_format = val & DISPPLANE_PIXFORMAT_MASK; 7895 pixel_format = val & DISPPLANE_PIXFORMAT_MASK;
7888 fourcc = i9xx_format_to_fourcc(pixel_format); 7896 fourcc = i9xx_format_to_fourcc(pixel_format);
7889 fb->format = drm_format_info(fourcc); 7897 fb->format = drm_format_info(fourcc);
@@ -8952,6 +8960,29 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc,
8952 goto error; 8960 goto error;
8953 } 8961 }
8954 8962
8963 /*
8964 * DRM_MODE_ROTATE_ is counter clockwise to stay compatible with Xrandr
8965 * while i915 HW rotation is clockwise, thats why this swapping.
8966 */
8967 switch (val & PLANE_CTL_ROTATE_MASK) {
8968 case PLANE_CTL_ROTATE_0:
8969 plane_config->rotation = DRM_MODE_ROTATE_0;
8970 break;
8971 case PLANE_CTL_ROTATE_90:
8972 plane_config->rotation = DRM_MODE_ROTATE_270;
8973 break;
8974 case PLANE_CTL_ROTATE_180:
8975 plane_config->rotation = DRM_MODE_ROTATE_180;
8976 break;
8977 case PLANE_CTL_ROTATE_270:
8978 plane_config->rotation = DRM_MODE_ROTATE_90;
8979 break;
8980 }
8981
8982 if (INTEL_GEN(dev_priv) >= 10 &&
8983 val & PLANE_CTL_FLIP_HORIZONTAL)
8984 plane_config->rotation |= DRM_MODE_REFLECT_X;
8985
8955 base = I915_READ(PLANE_SURF(pipe, plane_id)) & 0xfffff000; 8986 base = I915_READ(PLANE_SURF(pipe, plane_id)) & 0xfffff000;
8956 plane_config->base = base; 8987 plane_config->base = base;
8957 8988
@@ -15267,6 +15298,14 @@ retry:
15267 ret = drm_atomic_add_affected_planes(state, crtc); 15298 ret = drm_atomic_add_affected_planes(state, crtc);
15268 if (ret) 15299 if (ret)
15269 goto out; 15300 goto out;
15301
15302 /*
15303 * FIXME hack to force a LUT update to avoid the
15304 * plane update forcing the pipe gamma on without
15305 * having a proper LUT loaded. Remove once we
15306 * have readout for pipe gamma enable.
15307 */
15308 crtc_state->color_mgmt_changed = true;
15270 } 15309 }
15271 } 15310 }
15272 15311