On Thu, 16 Oct 2025, Ville Syrjala <[email protected]> wrote:
> From: Ville Syrjälä <[email protected]>
>
> intel_bo_frontbuffer_flush_for_display() is a bit too low level
> to be direclty in the high level dirtyfb code. Move the calls

*directly

> into intel_frontbuffer_flush().
>
> There is a slight beahavioural change here in that we now skip

*behavioural

> the flush if the bo is not a current scanout buffer (front->bits
> == 0). But that is fine as the flush will eventually happen via
> the fb pinning code if/when the bo becomes a scanout buffer again.
>
> Acked-by: Jani Nikula <[email protected]>

Upgrade to

Reviewed-by: Jani Nikula <[email protected]>


> Signed-off-by: Ville Syrjälä <[email protected]>
> ---
>  drivers/gpu/drm/i915/display/intel_fb.c          | 1 -
>  drivers/gpu/drm/i915/display/intel_frontbuffer.c | 4 +++-
>  2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_fb.c 
> b/drivers/gpu/drm/i915/display/intel_fb.c
> index ab301c657395..088e194ecf69 100644
> --- a/drivers/gpu/drm/i915/display/intel_fb.c
> +++ b/drivers/gpu/drm/i915/display/intel_fb.c
> @@ -2194,7 +2194,6 @@ static int intel_user_framebuffer_dirty(struct 
> drm_framebuffer *fb,
>       return ret;
>  
>  flush:
> -     intel_bo_frontbuffer_flush_for_display(front);
>       intel_frontbuffer_flush(front, ORIGIN_DIRTYFB);
>       return ret;
>  }
> diff --git a/drivers/gpu/drm/i915/display/intel_frontbuffer.c 
> b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
> index 5562801d2ea3..bdf8bfa7deb9 100644
> --- a/drivers/gpu/drm/i915/display/intel_frontbuffer.c
> +++ b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
> @@ -150,6 +150,9 @@ void __intel_fb_flush(struct intel_frontbuffer *front,
>  {
>       struct intel_display *display = to_intel_display(front->obj->dev);
>  
> +     if (origin == ORIGIN_DIRTYFB)
> +             intel_bo_frontbuffer_flush_for_display(front);
> +
>       if (origin == ORIGIN_CS) {
>               spin_lock(&display->fb_tracking.lock);
>               /* Filter out new bits since rendering started. */
> @@ -167,7 +170,6 @@ static void intel_frontbuffer_flush_work(struct 
> work_struct *work)
>       struct intel_frontbuffer *front =
>               container_of(work, struct intel_frontbuffer, flush_work);
>  
> -     intel_bo_frontbuffer_flush_for_display(front);
>       intel_frontbuffer_flush(front, ORIGIN_DIRTYFB);
>       intel_frontbuffer_put(front);
>  }

-- 
Jani Nikula, Intel

Reply via email to