@@ -1965,7 +1965,7 @@ static int intel_user_framebuffer_dirty(struct drm_framebuffer *fb,
struct frontbuffer_fence_cb *cb;
int ret = 0;
- if (!atomic_read(&front->bits))
+ if (!intel_frontbuffer_bits(front))
return 0;
if (dma_resv_test_signaled(intel_bo_to_drm_bo(obj)->resv, dma_resv_usage_rw(false)))
@@ -67,6 +67,16 @@
#include "intel_psr.h"
#include "intel_tdf.h"
+unsigned int intel_frontbuffer_bits(struct intel_frontbuffer *front)
+{
+ return atomic_read(&front->bits);
+}
+
+void intel_frontbuffer_bits_or(struct intel_frontbuffer *front, unsigned int bits)
+{
+ atomic_or(bits, &front->bits);
+}
+
/**
* frontbuffer_flush - flush frontbuffer
* @i915: i915 device
@@ -67,6 +67,9 @@ struct intel_frontbuffer {
GENMASK(INTEL_FRONTBUFFER_BITS_PER_PIPE * ((pipe) + 1) - 1, \
INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))
+unsigned int intel_frontbuffer_bits(struct intel_frontbuffer *front);
+void intel_frontbuffer_bits_or(struct intel_frontbuffer *front, unsigned int bits);
+
void intel_frontbuffer_flip_prepare(struct drm_i915_private *i915,
unsigned frontbuffer_bits);
void intel_frontbuffer_flip_complete(struct drm_i915_private *i915,
@@ -391,7 +391,7 @@ intel_find_initial_plane_obj(struct intel_crtc *crtc,
plane_state->uapi.crtc = &crtc->base;
intel_plane_copy_uapi_to_hw_state(plane_state, plane_state, crtc);
- atomic_or(plane->frontbuffer_bit, &to_intel_frontbuffer(fb)->bits);
+ intel_frontbuffer_bits_or(to_intel_frontbuffer(fb), plane->frontbuffer_bit);
}
static void plane_config_fini(struct intel_initial_plane_config *plane_config)
@@ -232,7 +232,7 @@ intel_find_initial_plane_obj(struct intel_crtc *crtc,
plane_state->uapi.crtc = &crtc->base;
intel_plane_copy_uapi_to_hw_state(plane_state, plane_state, crtc);
- atomic_or(plane->frontbuffer_bit, &to_intel_frontbuffer(fb)->bits);
+ intel_frontbuffer_bits_or(to_intel_frontbuffer(fb), plane->frontbuffer_bit);
plane_config->vma = vma;
Add helpers for ->bits in preparation for making struct intel_frontbuffer opaque. Signed-off-by: Jani Nikula <jani.nikula@intel.com> --- drivers/gpu/drm/i915/display/intel_fb.c | 2 +- drivers/gpu/drm/i915/display/intel_frontbuffer.c | 10 ++++++++++ drivers/gpu/drm/i915/display/intel_frontbuffer.h | 3 +++ drivers/gpu/drm/i915/display/intel_plane_initial.c | 2 +- drivers/gpu/drm/xe/display/xe_plane_initial.c | 2 +- 5 files changed, 16 insertions(+), 3 deletions(-)