Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Bin Luo (University of Electronic Science and Technology of
	China)" <luob87709@gmail.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915/display: hold frontbuffer ref across dirtyfb fence callback
Date: Fri, 27 Nov 2026 13:55:25 +0000	[thread overview]
Message-ID: <sashiko-outbox-237524@kernel.org> (raw)
In-Reply-To: <20261127133935.1461-1-luob87709@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] drm/i915/display: dead intel_frontbuffer_queue_flush() and
  flush_work
--

commit ef90877ebdeba58596971006e74cdcc49524595d
Author: luob87709@gmail.com <luob87709@gmail.com>

drm/i915/display: hold frontbuffer ref across dirtyfb fence callback

This commit holds a frontbuffer reference across the dirtyfb dma_fence
callback and defers the frontbuffer flush and reference release to a work
item embedded in frontbuffer_fence_cb.

> diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c
> index 2c63aeefaea88..1ed9f8d7efd73 100644
> --- a/drivers/gpu/drm/i915/display/intel_fb.c
> +++ b/drivers/gpu/drm/i915/display/intel_fb.c
[ ... ]
> @@ -2177,16 +2178,26 @@ static int intel_user_framebuffer_create_handle(struct drm_framebuffer *fb,
>  
>  struct frontbuffer_fence_cb {
>  	struct dma_fence_cb base;
> +	struct work_struct work;
>  	struct intel_frontbuffer *front;
>  };
>  
> +static void intel_user_framebuffer_fence_work(struct work_struct *work)
> +{
> +	struct frontbuffer_fence_cb *cb = container_of(work, typeof(*cb), work);
> +	struct intel_frontbuffer *front = cb->front;
> +
> +	intel_frontbuffer_flush(front, ORIGIN_DIRTYFB);
> +	intel_parent_frontbuffer_put(front->display, front);
> +	kfree(cb);
> +}
> +
>  static void intel_user_framebuffer_fence_wake(struct dma_fence *dma,
>  					      struct dma_fence_cb *data)
>  {
>  	struct frontbuffer_fence_cb *cb = container_of(data, typeof(*cb), base);
>  
> -	intel_frontbuffer_queue_flush(cb->front);
> -	kfree(cb);
> +	schedule_work(&cb->work);
>  	dma_fence_put(dma);
>  }

[Severity: Low]
Does replacing intel_frontbuffer_queue_flush() here leave
intel_frontbuffer_queue_flush(), intel_frontbuffer_flush_work(), and
struct intel_frontbuffer's flush_work member unused?

intel_user_framebuffer_fence_wake() was the only caller of
intel_frontbuffer_queue_flush() in the tree, so those helpers in
intel_frontbuffer.c and flush_work in struct intel_frontbuffer are now
dead code (and intel_frontbuffer_queue_flush() still contains an atomic
intel_parent_frontbuffer_put() fallback if schedule_work() returns false).

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261127133935.1461-1-luob87709@gmail.com?part=1

       reply	other threads:[~2026-11-27 13:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20261127133935.1461-1-luob87709@gmail.com>
2026-11-27 13:55 ` sashiko-bot [this message]
2026-11-27 14:17 ` [PATCH v2] drm/i915/display: hold frontbuffer ref across dirtyfb fence callback Jani Nikula

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-237524@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=luob87709@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox