Skip to content

Commit

Permalink
drm/i915/fbc: Extract intel_fbc_has_fences()
Browse files Browse the repository at this point in the history
Pull the "do we have fences?" check into a single helper in the FBC
code. Avoids having to call to outside the display code in multiple
places for this.

Signed-off-by: Ville Syrjälä <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Rodrigo Vivi <[email protected]>
  • Loading branch information
vsyrjala committed Jul 12, 2024
1 parent 09af603 commit bc34d31
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/gpu/drm/i915/display/intel_fbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ static u16 intel_fbc_override_cfb_stride(const struct intel_plane_state *plane_s
return 0;
}

static bool intel_fbc_has_fences(struct drm_i915_private *i915)
{
return intel_gt_support_legacy_fencing(to_gt(i915));
}

static u32 i8xx_fbc_ctl(struct intel_fbc *fbc)
{
const struct intel_fbc_state *fbc_state = &fbc->state;
Expand Down Expand Up @@ -619,7 +624,7 @@ static void ivb_fbc_activate(struct intel_fbc *fbc)
else if (DISPLAY_VER(i915) == 9)
skl_fbc_program_cfb_stride(fbc);

if (intel_gt_support_legacy_fencing(to_gt(i915)))
if (intel_fbc_has_fences(i915))
snb_fbc_program_fence(fbc);

/* wa_14019417088 Alternative WA*/
Expand Down Expand Up @@ -1153,7 +1158,7 @@ static void intel_fbc_update_state(struct intel_atomic_state *state,
fbc_state->fence_y_offset = intel_plane_fence_y_offset(plane_state);

drm_WARN_ON(&i915->drm, plane_state->flags & PLANE_HAS_FENCE &&
!intel_gt_support_legacy_fencing(to_gt(i915)));
!intel_fbc_has_fences(i915));

if (plane_state->flags & PLANE_HAS_FENCE)
fbc_state->fence_id = i915_vma_fence_id(plane_state->ggtt_vma);
Expand Down

0 comments on commit bc34d31

Please sign in to comment.