aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_pm.c
diff options
context:
space:
mode:
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>2015-03-23 07:10:38 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-03-23 10:09:33 -0400
commit1fc0a8f7c45275c38d3322089313fe2e309c1f17 (patch)
tree68aa352ddfcbe64f95f3c1d04b7fd42f66b2ad28 /drivers/gpu/drm/i915/intel_pm.c
parent121920faf2ccce9aa66a7e2588415c9647b66104 (diff)
drm/i915/skl: Take 90/270 rotation into account in watermark calculations
v2: Pass in rotation info to sprite plane updates as well. v3: Use helper to determine 90/270 rotation. (Michel Thierry) v4: Rebased for fb modifiers and atomic changes. For: VIZ-4546 Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Michel Thierry <michel.thierry@intel.com> (v3) Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_pm.c')
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index e18f0fd22cf2..753a3af07333 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -2840,6 +2840,7 @@ static void skl_compute_wm_pipe_parameters(struct drm_crtc *crtc,
2840 } 2840 }
2841 p->plane[0].horiz_pixels = intel_crtc->config->pipe_src_w; 2841 p->plane[0].horiz_pixels = intel_crtc->config->pipe_src_w;
2842 p->plane[0].vert_pixels = intel_crtc->config->pipe_src_h; 2842 p->plane[0].vert_pixels = intel_crtc->config->pipe_src_h;
2843 p->plane[0].rotation = crtc->primary->state->rotation;
2843 2844
2844 fb = crtc->cursor->state->fb; 2845 fb = crtc->cursor->state->fb;
2845 if (fb) { 2846 if (fb) {
@@ -2897,7 +2898,21 @@ static bool skl_compute_plane_wm(const struct drm_i915_private *dev_priv,
2897 2898
2898 if (p_params->tiling == I915_FORMAT_MOD_Y_TILED || 2899 if (p_params->tiling == I915_FORMAT_MOD_Y_TILED ||
2899 p_params->tiling == I915_FORMAT_MOD_Yf_TILED) { 2900 p_params->tiling == I915_FORMAT_MOD_Yf_TILED) {
2900 uint32_t y_tile_minimum = plane_blocks_per_line * 4; 2901 uint32_t min_scanlines = 4;
2902 uint32_t y_tile_minimum;
2903 if (intel_rotation_90_or_270(p_params->rotation)) {
2904 switch (p_params->bytes_per_pixel) {
2905 case 1:
2906 min_scanlines = 16;
2907 break;
2908 case 2:
2909 min_scanlines = 8;
2910 break;
2911 case 8:
2912 WARN(1, "Unsupported pixel depth for rotation");
2913 };
2914 }
2915 y_tile_minimum = plane_blocks_per_line * min_scanlines;
2901 selected_result = max(method2, y_tile_minimum); 2916 selected_result = max(method2, y_tile_minimum);
2902 } else { 2917 } else {
2903 if ((ddb_allocation / plane_blocks_per_line) >= 1) 2918 if ((ddb_allocation / plane_blocks_per_line) >= 1)
@@ -3357,6 +3372,7 @@ skl_update_sprite_wm(struct drm_plane *plane, struct drm_crtc *crtc,
3357 */ 3372 */
3358 if (fb) 3373 if (fb)
3359 intel_plane->wm.tiling = fb->modifier[0]; 3374 intel_plane->wm.tiling = fb->modifier[0];
3375 intel_plane->wm.rotation = plane->state->rotation;
3360 3376
3361 skl_update_wm(crtc); 3377 skl_update_wm(crtc);
3362} 3378}