[PATCH 5/5] drm/radeon: rework page flip handling v3

Alex Deucher alexdeucher at gmail.com
Tue Jun 3 06:31:37 PDT 2014


On Wed, May 28, 2014 at 2:56 AM, Michel Dänzer <michel at daenzer.net> wrote:
> On 27.05.2014 23:49, Christian König wrote:
>> From: Christian König <christian.koenig at amd.com>
>>
>> Instead of trying to flip inside the vblank period when
>> the buffer is idle, offload blocking for idle to a kernel
>> thread and program the flip directly into the hardware.
>>
>> v2: add error handling, fix EBUSY handling
>> v3: add proper exclusive_lock handling
>
> [...]
>
>> +     /* update crtc fb */
>> +     crtc->primary->fb = fb;
>> +
>> +     /* We borrow the event spin lock for protecting flip_work */
>> +     spin_lock_irqsave(&crtc->dev->event_lock, flags);
>> +
>> +     if (radeon_crtc->flip_work) {
>> +             DRM_DEBUG_DRIVER("flip queue: crtc already busy\n");
>> +             spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
>> +             drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base);
>> +             radeon_fence_unref(&work->fence);
>> +             kfree(work);
>> +             return -EBUSY;
>> +     }
>
> If we return -EBUSY, we shouldn't change crtc->primary->fb, should we? I
> wonder if crtc->primary->fb shouldn't be changed in
> radeon_flip_work_func(), when we're sure we can actually flip.

How about this?

Alex
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-drm-radeon-update-crtc-primary-fb-in-radeon_flip_wor.patch
Type: text/x-diff
Size: 1392 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140603/c08a5dfa/attachment.patch>


More information about the dri-devel mailing list