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: [email protected] <[email protected]> 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/[email protected]?part=1
