Re: [PATCH] drm/rockchip: Return -EBUSY if there's already a pending flip event v3

From: Daniel Stone
Date: Tue May 24 2016 - 03:19:17 EST


Hi Tomeu,

On 5 April 2016 at 16:07, Tomeu Vizoso <tomeu.vizoso@xxxxxxxxxxxxx> wrote:
> On 4 April 2016 at 17:44, Daniel Stone <daniel@xxxxxxxxxxxxx> wrote:
>> On 4 April 2016 at 14:55, Tomeu Vizoso <tomeu.vizoso@xxxxxxxxxxxxx> wrote:
>>> + if (async) {
>>> + for_each_crtc_in_state(state, crtc, crtc_state, i) {
>>> + if (crtc->state->event ||
>>> + rockchip_drm_crtc_has_pending_event(crtc)) {
>>> + return -EBUSY;
>>> + }
>>> + }
>>> + }
>>
>> Hmmm ...
>>
>> Doesn't this trigger before the VOP atomic_begin() helper, meaning
>> that anything with an event set will trigger the check? Seems like it
>> should be && rather than ||.
>
> So, these are the two cases that this code aims to handle:
>
> 1. A previous request with an event set hasn't progressed to
> atomic_begin yet, so the event field in drm_crtc_state (at this point,
> the old state) is still populated but vop->event still isn't.

Ah right, this was what I was missing: the async (non-blocking)
implementation. Sounds good to me then.

Cheers,
Daniel