RE: [PATCH v2 8/9] media: chips-media: wave5: restore the display flags after a flush
From: jackson.lee
Date: Sun Nov 29 2026 - 20:30:23 EST
Hi Nicolas,
> + driver_owns = !mark_all &&
> + (vb->state == VB2_BUF_STATE_QUEUED ||
> + vb->state == VB2_BUF_STATE_ACTIVE);
>
> Its unclear, inside the framework the driver only owns the ACTIVE
> buffer, are you sure you wanted to call this owned?
You are right. A QUEUED buffer is still held by vb2 and has not been
passed to buf_queue() yet, so calling it driver-owned is wrong.
In the next version the check is on VB2_BUF_STATE_ACTIVE only, and the
variable and the comments say "queued in the driver" instead of
"owned".
> + /*
> + * The flush clears the display flags, so every frame buffer now looks
> + * free -- including the ones userspace is still holding. Only the
> + * buffers that happened to be queued when the flush ran were marked
> + * again, and userspace clears those as it re-queues them, which leaves
> + * the ones it kept unmarked: the next pictures are decoded straight
> + * into buffers the application owns and finish_decode() cannot find
> + * them in the queue any more.
> + *
> + * Mark everything, then hand back just what is queued, the same way
> + * wave5_prepare_fb() establishes the flags in the first place.
> + */
>
> This is very long and unsual, can you find a way to simply say what
> you want to achieve? Someone will rafactor the code someday
> (hopefully) and this will eventually be outdated.
Agreed, the history belongs in the commit message. In the next version
it is just:
/* The flush clears the display flags, so set them again. */
Thanks,
Jackson