Re: [PATCH v2 2/2] drm/fb_helper: implement ioctl FBIO_WAITFORVSYNC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 9 February 2017 at 17:01, Daniel Vetter <daniel@xxxxxxxx> wrote:
> On Thu, Feb 02, 2017 at 11:31:57AM +0100, Maxime Ripard wrote:
>> +int drm_fb_helper_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
>> +{
>> +     struct drm_fb_helper *fb_helper = info->par;
>> +     struct drm_device *dev = fb_helper->dev;
>> +     unsigned int i;
>> +     int ret = 0;
>> +
>> +     drm_modeset_lock_all(dev);
>> +     if (!drm_fb_helper_is_bound(fb_helper)) {
>> +             drm_modeset_unlock_all(dev);
>> +             return -EBUSY;
>> +     }
>> +
>> +     switch (cmd) {
>> +     case FBIO_WAITFORVSYNC:
>> +             for (i = 0; i < fb_helper->crtc_count; i++) {
>> +                     struct drm_mode_set *mode_set;
>> +                     struct drm_crtc *crtc;
>> +
>> +                     mode_set = &fb_helper->crtc_info[i].mode_set;
>> +                     crtc = mode_set->crtc;
>> +
>> +                     /*
>> +                      * Only call drm_crtc_wait_one_vblank for crtcs that
>> +                      * are currently enabled.
>> +                      */
>> +                     if (!crtc->enabled)
>> +                             continue;
>
> This needs locking

More locking than the drm_modeset_lock_all() above the switch? Ouch. :)

Cheers,
Daniel
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux