diff options
author | Matt Roper <matthew.d.roper@intel.com> | 2015-09-24 18:53:12 -0400 |
---|---|---|
committer | Matt Roper <matthew.d.roper@intel.com> | 2015-10-21 17:53:23 -0400 |
commit | d21fbe87ce18297af0a9b7cc0cd545fd9ac28d33 (patch) | |
tree | 3be475787447afcb95a4323618a2ba89ca01b88a /drivers/gpu/drm/i915/intel_display.c | |
parent | e4ba99b97e7f59889eeb8dd02867f4ed00c59eb0 (diff) |
drm/i915/ivb: Move WaCxSRDisabledForSpriteScaling w/a to atomic check
Determine whether we need to apply this workaround at atomic check time
and just set a flag that will be used by the main watermark update
routine.
Moving this workaround into the atomic framework reduces
ilk_update_sprite_wm() to just a standard watermark update, so drop it
completely and just ensure that ilk_update_wm() is called whenever a
sprite plane is updated in a way that would affect watermarks.
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Smoke-tested-by: Paulo Zanoni <przanoni@gmail.com>
Link: http://patchwork.freedesktop.org/patch/60367/
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index bd1977ed6e88..49af225757bd 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -11581,18 +11581,32 @@ retry: | |||
11581 | static bool intel_wm_need_update(struct drm_plane *plane, | 11581 | static bool intel_wm_need_update(struct drm_plane *plane, |
11582 | struct drm_plane_state *state) | 11582 | struct drm_plane_state *state) |
11583 | { | 11583 | { |
11584 | /* Update watermarks on tiling changes. */ | 11584 | struct intel_plane_state *new = to_intel_plane_state(state); |
11585 | struct intel_plane_state *cur = to_intel_plane_state(plane->state); | ||
11586 | |||
11587 | /* Update watermarks on tiling or size changes. */ | ||
11585 | if (!plane->state->fb || !state->fb || | 11588 | if (!plane->state->fb || !state->fb || |
11586 | plane->state->fb->modifier[0] != state->fb->modifier[0] || | 11589 | plane->state->fb->modifier[0] != state->fb->modifier[0] || |
11587 | plane->state->rotation != state->rotation) | 11590 | plane->state->rotation != state->rotation || |
11588 | return true; | 11591 | drm_rect_width(&new->src) != drm_rect_width(&cur->src) || |
11589 | 11592 | drm_rect_height(&new->src) != drm_rect_height(&cur->src) || | |
11590 | if (plane->state->crtc_w != state->crtc_w) | 11593 | drm_rect_width(&new->dst) != drm_rect_width(&cur->dst) || |
11594 | drm_rect_height(&new->dst) != drm_rect_height(&cur->dst)) | ||
11591 | return true; | 11595 | return true; |
11592 | 11596 | ||
11593 | return false; | 11597 | return false; |
11594 | } | 11598 | } |
11595 | 11599 | ||
11600 | static bool needs_scaling(struct intel_plane_state *state) | ||
11601 | { | ||
11602 | int src_w = drm_rect_width(&state->src) >> 16; | ||
11603 | int src_h = drm_rect_height(&state->src) >> 16; | ||
11604 | int dst_w = drm_rect_width(&state->dst); | ||
11605 | int dst_h = drm_rect_height(&state->dst); | ||
11606 | |||
11607 | return (src_w != dst_w || src_h != dst_h); | ||
11608 | } | ||
11609 | |||
11596 | int intel_plane_atomic_calc_changes(struct drm_crtc_state *crtc_state, | 11610 | int intel_plane_atomic_calc_changes(struct drm_crtc_state *crtc_state, |
11597 | struct drm_plane_state *plane_state) | 11611 | struct drm_plane_state *plane_state) |
11598 | { | 11612 | { |
@@ -11608,7 +11622,6 @@ int intel_plane_atomic_calc_changes(struct drm_crtc_state *crtc_state, | |||
11608 | bool mode_changed = needs_modeset(crtc_state); | 11622 | bool mode_changed = needs_modeset(crtc_state); |
11609 | bool was_crtc_enabled = crtc->state->active; | 11623 | bool was_crtc_enabled = crtc->state->active; |
11610 | bool is_crtc_enabled = crtc_state->active; | 11624 | bool is_crtc_enabled = crtc_state->active; |
11611 | |||
11612 | bool turn_off, turn_on, visible, was_visible; | 11625 | bool turn_off, turn_on, visible, was_visible; |
11613 | struct drm_framebuffer *fb = plane_state->fb; | 11626 | struct drm_framebuffer *fb = plane_state->fb; |
11614 | 11627 | ||
@@ -11718,11 +11731,23 @@ int intel_plane_atomic_calc_changes(struct drm_crtc_state *crtc_state, | |||
11718 | case DRM_PLANE_TYPE_CURSOR: | 11731 | case DRM_PLANE_TYPE_CURSOR: |
11719 | break; | 11732 | break; |
11720 | case DRM_PLANE_TYPE_OVERLAY: | 11733 | case DRM_PLANE_TYPE_OVERLAY: |
11721 | if (turn_off && !mode_changed) { | 11734 | /* |
11735 | * WaCxSRDisabledForSpriteScaling:ivb | ||
11736 | * | ||
11737 | * cstate->update_wm was already set above, so this flag will | ||
11738 | * take effect when we commit and program watermarks. | ||
11739 | */ | ||
11740 | if (IS_IVYBRIDGE(dev) && | ||
11741 | needs_scaling(to_intel_plane_state(plane_state)) && | ||
11742 | !needs_scaling(old_plane_state)) { | ||
11743 | to_intel_crtc_state(crtc_state)->disable_lp_wm = true; | ||
11744 | } else if (turn_off && !mode_changed) { | ||
11722 | intel_crtc->atomic.wait_vblank = true; | 11745 | intel_crtc->atomic.wait_vblank = true; |
11723 | intel_crtc->atomic.update_sprite_watermarks |= | 11746 | intel_crtc->atomic.update_sprite_watermarks |= |
11724 | 1 << i; | 11747 | 1 << i; |
11725 | } | 11748 | } |
11749 | |||
11750 | break; | ||
11726 | } | 11751 | } |
11727 | return 0; | 11752 | return 0; |
11728 | } | 11753 | } |