diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2018-11-01 11:05:59 -0400 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2018-11-09 12:13:44 -0500 |
commit | 53cc688036681cc17f6db43744db6bb7703246fe (patch) | |
tree | 0b5330558201f2f5b6135d1b996fdbc3b37246e9 /drivers/gpu/drm/i915/intel_display.c | |
parent | 07464c7c0cf773b86372d128d17a892529c0775a (diff) |
drm/i915: Generalize skl_ddb_allocation_overlaps()
Make skl_ddb_allocation_overlaps() useful for other callers
besides skl_update_crtcs(). We'll need it to do plane updates
as well.
And while we're here we can reduce the stack utilization a
bit by noting that each struct skl_ddb_entry is 4 bytes whereas
a pointer to one is 8 bytes (on 64bit). So we'll switch to an
array of structs from the array of pointers we used before.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181101150605.18235-9-ville.syrjala@linux.intel.com
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index c112bf758a66..a7fa032310ae 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -12651,13 +12651,12 @@ static void skl_update_crtcs(struct drm_atomic_state *state) | |||
12651 | int i; | 12651 | int i; |
12652 | u8 hw_enabled_slices = dev_priv->wm.skl_hw.ddb.enabled_slices; | 12652 | u8 hw_enabled_slices = dev_priv->wm.skl_hw.ddb.enabled_slices; |
12653 | u8 required_slices = intel_state->wm_results.ddb.enabled_slices; | 12653 | u8 required_slices = intel_state->wm_results.ddb.enabled_slices; |
12654 | 12654 | struct skl_ddb_entry entries[I915_MAX_PIPES] = {}; | |
12655 | const struct skl_ddb_entry *entries[I915_MAX_PIPES] = {}; | ||
12656 | 12655 | ||
12657 | for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) | 12656 | for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) |
12658 | /* ignore allocations for crtc's that have been turned off. */ | 12657 | /* ignore allocations for crtc's that have been turned off. */ |
12659 | if (new_crtc_state->active) | 12658 | if (new_crtc_state->active) |
12660 | entries[i] = &to_intel_crtc_state(old_crtc_state)->wm.skl.ddb; | 12659 | entries[i] = to_intel_crtc_state(old_crtc_state)->wm.skl.ddb; |
12661 | 12660 | ||
12662 | /* If 2nd DBuf slice required, enable it here */ | 12661 | /* If 2nd DBuf slice required, enable it here */ |
12663 | if (INTEL_GEN(dev_priv) >= 11 && required_slices > hw_enabled_slices) | 12662 | if (INTEL_GEN(dev_priv) >= 11 && required_slices > hw_enabled_slices) |
@@ -12683,14 +12682,13 @@ static void skl_update_crtcs(struct drm_atomic_state *state) | |||
12683 | if (updated & cmask || !cstate->base.active) | 12682 | if (updated & cmask || !cstate->base.active) |
12684 | continue; | 12683 | continue; |
12685 | 12684 | ||
12686 | if (skl_ddb_allocation_overlaps(dev_priv, | 12685 | if (skl_ddb_allocation_overlaps(&cstate->wm.skl.ddb, |
12687 | entries, | 12686 | entries, |
12688 | &cstate->wm.skl.ddb, | 12687 | INTEL_INFO(dev_priv)->num_pipes, i)) |
12689 | i)) | ||
12690 | continue; | 12688 | continue; |
12691 | 12689 | ||
12692 | updated |= cmask; | 12690 | updated |= cmask; |
12693 | entries[i] = &cstate->wm.skl.ddb; | 12691 | entries[i] = cstate->wm.skl.ddb; |
12694 | 12692 | ||
12695 | /* | 12693 | /* |
12696 | * If this is an already active pipe, it's DDB changed, | 12694 | * If this is an already active pipe, it's DDB changed, |