search for: drm_vblank_crtc

Displaying 20 results from an estimated 45 matches for "drm_vblank_crtc".

2020 May 08
0
[RFC v4 03/12] drm/vblank: Register drmm cleanup action once per drm_vblank_crtc
Since we'll be allocating resources for kthread_create_worker() in the next commit (which could fail and require us to clean up the mess), let's simplify the cleanup process a bit by registering a drm_vblank_init_release() action for each drm_vblank_crtc so they're still cleaned up if we fail to initialize one of them. Changes since v3: * Use drmm_add_action_or_reset() - Daniel Vetter Cc: Daniel Vetter <daniel at ffwll.ch> Cc: Ville Syrj?l? <ville.syrjala at linux.intel.com> Cc: dri-devel at lists.freedesktop.org Cc: nouveau at li...
2020 Jun 22
0
[RFC v5 01/10] drm/vblank: Register drmm cleanup action once per drm_vblank_crtc
Since we'll be allocating resources for kthread_create_worker() in the next commit (which could fail and require us to clean up the mess), let's simplify the cleanup process a bit by registering a drm_vblank_init_release() action for each drm_vblank_crtc so they're still cleaned up if we fail to initialize one of them. Changes since v3: * Use drmm_add_action_or_reset() - Daniel Vetter Cc: Daniel Vetter <daniel at ffwll.ch> Cc: Ville Syrj?l? <ville.syrjala at linux.intel.com> Cc: dri-devel at lists.freedesktop.org Cc: nouveau at li...
2020 Mar 18
4
[PATCH 1/9] drm/vblank: Add vblank works
...ork_wait); > + kthread_stop(vblank->vblank_work.thread); > } > > kfree(dev->vblank); > @@ -447,6 +453,108 @@ void drm_vblank_cleanup(struct drm_device *dev) > dev->num_crtcs = 0; > } > > +static int vblank_work_thread(void *data) > +{ > + struct drm_vblank_crtc *vblank = data; > + > + while (!kthread_should_stop()) { > + struct drm_vblank_work *work, *next; > + LIST_HEAD(list); > + u64 count; > + int ret; > + > + spin_lock_irq(&vblank->dev->event_lock); > + > + ret = wait_event_interruptible_lock_irq(vblank-&g...
2020 Jun 24
0
[RFC v7 03/11] drm/vblank: Add vblank works
...7 +366,7 @@ static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe, store_vblank(dev, pipe, diff, t_vblank, cur_vblank); } -static u64 drm_vblank_count(struct drm_device *dev, unsigned int pipe) +u64 drm_vblank_count(struct drm_device *dev, unsigned int pipe) { struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; u64 count; @@ -497,6 +500,7 @@ static void drm_vblank_init_release(struct drm_device *dev, void *ptr) drm_WARN_ON(dev, READ_ONCE(vblank->enabled) && drm_core_check_feature(dev, DRIVER_MODESET)); + drm_vblank_destroy_worker(vblank); del_...
2020 Mar 18
0
[PATCH 1/9] drm/vblank: Add vblank works
..._timer); + + wake_up_all(&vblank->vblank_work.work_wait); + kthread_stop(vblank->vblank_work.thread); } kfree(dev->vblank); @@ -447,6 +453,108 @@ void drm_vblank_cleanup(struct drm_device *dev) dev->num_crtcs = 0; } +static int vblank_work_thread(void *data) +{ + struct drm_vblank_crtc *vblank = data; + + while (!kthread_should_stop()) { + struct drm_vblank_work *work, *next; + LIST_HEAD(list); + u64 count; + int ret; + + spin_lock_irq(&vblank->dev->event_lock); + + ret = wait_event_interruptible_lock_irq(vblank->queue, + kthread_should_stop() || +...
2020 Mar 27
2
[PATCH 1/9] drm/vblank: Add vblank works
...> > > kfree(dev->vblank); > > > @@ -447,6 +453,108 @@ void drm_vblank_cleanup(struct drm_device *dev) > > > dev->num_crtcs = 0; > > > } > > > > > > +static int vblank_work_thread(void *data) > > > +{ > > > + struct drm_vblank_crtc *vblank = data; > > > + > > > + while (!kthread_should_stop()) { > > > + struct drm_vblank_work *work, *next; > > > + LIST_HEAD(list); > > > + u64 count; > > > + int ret; > > > + > > > + spin_lock_irq(&vblank->dev-&...
2020 Jun 22
0
[RFC v5 02/10] drm/vblank: Add vblank works
...rm_device *dev, unsigned int pipe); static unsigned int drm_timestamp_precision = 20; /* Default to 20 usecs. */ @@ -490,6 +494,35 @@ static void vblank_disable_fn(struct timer_list *t) spin_unlock_irqrestore(&dev->vbl_lock, irqflags); } +static void drm_vblank_work_release(struct drm_vblank_crtc *vblank) +{ + struct kthread_worker *worker = vblank->worker; + struct drm_vblank_work *work, *tmp; + bool wake = false; + + if (!worker) + return; + + spin_lock_irq(&vblank->work_lock); + vblank->worker = NULL; + + list_for_each_entry_safe(work, tmp, &vblank->pending_work, nod...
2020 Mar 27
0
[PATCH 1/9] drm/vblank: Add vblank works
...work.thread); > > } > > > > kfree(dev->vblank); > > @@ -447,6 +453,108 @@ void drm_vblank_cleanup(struct drm_device *dev) > > dev->num_crtcs = 0; > > } > > > > +static int vblank_work_thread(void *data) > > +{ > > + struct drm_vblank_crtc *vblank = data; > > + > > + while (!kthread_should_stop()) { > > + struct drm_vblank_work *work, *next; > > + LIST_HEAD(list); > > + u64 count; > > + int ret; > > + > > + spin_lock_irq(&vblank->dev->event_lock); > > + > > +...
2020 Apr 13
0
[PATCH 1/9] drm/vblank: Add vblank works
...nk); > > > > @@ -447,6 +453,108 @@ void drm_vblank_cleanup(struct drm_device *dev) > > > > dev->num_crtcs = 0; > > > > } > > > > > > > > +static int vblank_work_thread(void *data) > > > > +{ > > > > + struct drm_vblank_crtc *vblank = data; > > > > + > > > > + while (!kthread_should_stop()) { > > > > + struct drm_vblank_work *work, *next; > > > > + LIST_HEAD(list); > > > > + u64 count; > > > > + int ret; > > > > + > > > &gt...
2020 May 08
0
[RFC v4 04/12] drm/vblank: Add vblank works
...ork *work)) +{ + kthread_init_work(&work->base, func); + INIT_LIST_HEAD(&work->flush_work); + INIT_LIST_HEAD(&work->pending); + work->vblank = &crtc->dev->vblank[drm_crtc_index(crtc)]; +} +EXPORT_SYMBOL(drm_vblank_work_init); + +static int vblank_worker_init(struct drm_vblank_crtc *vblank) +{ + struct sched_param param = { + .sched_priority = MAX_RT_PRIO - 1, + }; + + INIT_LIST_HEAD(&vblank->pending_work); + spin_lock_init(&vblank->work_lock); + vblank->worker = kthread_create_worker(0, "card%d-crtc%d", + vblank->dev->primary->...
2020 Jun 24
13
[RFC v7 00/11] drm/nouveau: Introduce CRC support for gf119+
...looks a lot more acceptable then what I was previously trying. * Apply some changes requested by danvet Major changes since v2: * Use kthread_worker instead of kthreadd for vblank workers * Don't check debugfs return values Lyude Paul (11): drm/vblank: Register drmm cleanup action once per drm_vblank_crtc drm/vblank: Use spin_(un)lock_irq() in drm_crtc_vblank_off() drm/vblank: Add vblank works drm/nouveau/kms/nv50-: Unroll error cleanup in nv50_head_create() drm/nouveau/kms/nv140-: Don't modify depth in state during atomic commit drm/nouveau/kms/nv50-: Fix disabling dithering drm...
2020 Jan 20
0
[PATCH v3 03/22] drm: Add get_vblank_timestamp() to struct drm_crtc_funcs
...- * drm_calc_vbltimestamp_from_scanoutpos(). + * drm_crtc_vblank_helper_get_vblank_timestamp(). * * Note that atomic drivers should not use this, but instead use * &drm_crtc_state.adjusted_mode. And for high-precision timestamps - * drm_calc_vbltimestamp_from_scanoutpos() used &drm_vblank_crtc.hwmode, + * drm_crtc_vblank_helper_get_vblank_timestamp() used + * &drm_vblank_crtc.hwmode, * which is filled out by calling drm_calc_timestamping_constants(). */ struct drm_display_mode hwmode; diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vta...
2020 Jun 27
9
[RFC v8 0/9] drm/nouveau: Introduce CRC support for gf119+
...looks a lot more acceptable then what I was previously trying. * Apply some changes requested by danvet Major changes since v2: * Use kthread_worker instead of kthreadd for vblank workers * Don't check debugfs return values Lyude Paul (9): drm/vblank: Register drmm cleanup action once per drm_vblank_crtc drm/vblank: Use spin_(un)lock_irq() in drm_crtc_vblank_off() drm/vblank: Add vblank works drm/nouveau/kms/nv140-: Don't modify depth in state during atomic commit drm/nouveau/kms/nv50-: Fix disabling dithering drm/nouveau/kms/nv140-: Track wndw mappings in nv50_head_atom drm/nou...
2020 Jan 15
0
[PATCH v2 03/21] drm: Add get_vblank_timestamp() to struct drm_crtc_funcs
...bool in_vblank_irq, int *vpos, int *hpos, + ktime_t *stime, ktime_t *etime, + const struct drm_display_mode *mode)) +{ + struct drm_device *dev = crtc->dev; + unsigned int pipe = crtc->index; + struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; + struct timespec64 ts_etime, ts_vblank_time; + ktime_t stime, etime; + bool vbl_status; + const struct drm_display_mode *mode; + int vpos, hpos, i; + int delta_ns, duration_ns; + + if (pipe >= dev->num_crtcs) { + DRM_ERROR("Invalid crtc %u\n",...
2020 Jan 20
0
[Intel-gfx] [PATCH v3 03/22] drm: Add get_vblank_timestamp() to struct drm_crtc_funcs
...mp_from_scanoutpos(). > + * drm_crtc_vblank_helper_get_vblank_timestamp(). > * > * Note that atomic drivers should not use this, but instead use > * &drm_crtc_state.adjusted_mode. And for high-precision timestamps > - * drm_calc_vbltimestamp_from_scanoutpos() used &drm_vblank_crtc.hwmode, > + * drm_crtc_vblank_helper_get_vblank_timestamp() used > + * &drm_vblank_crtc.hwmode, > * which is filled out by calling drm_calc_timestamping_constants(). > */ > struct drm_display_mode hwmode; > diff --git a/include/drm/drm_modeset_helper_vtables.h b/incl...
2020 Jan 15
2
[Intel-gfx] [PATCH v2 03/21] drm: Add get_vblank_timestamp() to struct drm_crtc_funcs
...blank_irq, int *vpos, int *hpos, > + ktime_t *stime, ktime_t *etime, > + const struct drm_display_mode *mode)) > +{ > + struct drm_device *dev = crtc->dev; > + unsigned int pipe = crtc->index; > + struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; > + struct timespec64 ts_etime, ts_vblank_time; > + ktime_t stime, etime; > + bool vbl_status; > + const struct drm_display_mode *mode; > + int vpos, hpos, i; > + int delta_ns, duration_ns; > + > + if (pipe >= dev->num_crtcs) { >...
2017 Jul 12
1
[PATCH] drm/nouveau: honor return type of nvif_mthd, trivial
...u_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index 8d1df5678eaa..f8f555e2e912 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -113,10 +113,11 @@ nouveau_display_scanoutpos_head(struct drm_crtc *crtc, int *vpos, int *hpos, struct drm_vblank_crtc *vblank = &crtc->dev->vblank[drm_crtc_index(crtc)]; int retry = 20; bool ret = false; + int method_ret; do { - ret = nvif_mthd(&disp->disp, 0, &args, sizeof(args)); - if (ret != 0) + int method_ret = nvif_mthd(&disp->disp, 0, &args, sizeof(args)); + if (m...
2020 Jan 16
0
[Intel-gfx] [PATCH v2 03/21] drm: Add get_vblank_timestamp() to struct drm_crtc_funcs
...t *hpos, >> + ktime_t *stime, ktime_t *etime, >> + const struct drm_display_mode *mode)) >> +{ >> + struct drm_device *dev = crtc->dev; >> + unsigned int pipe = crtc->index; >> + struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; >> + struct timespec64 ts_etime, ts_vblank_time; >> + ktime_t stime, etime; >> + bool vbl_status; >> + const struct drm_display_mode *mode; >> + int vpos, hpos, i; >> + int delta_ns, duration_ns; >> + >> + if (pipe...
2020 Jun 22
13
[RFC v5 00/10] drm/nouveau: Introduce CRC support for gf119+
...looks a lot more acceptable then what I was previously trying. * Apply some changes requested by danvet Major changes since v2: * Use kthread_worker instead of kthreadd for vblank workers * Don't check debugfs return values Lyude Paul (10): drm/vblank: Register drmm cleanup action once per drm_vblank_crtc drm/vblank: Add vblank works drm/nouveau/kms/nv50-: Unroll error cleanup in nv50_head_create() drm/nouveau/kms/nv140-: Don't modify depth in state during atomic commit drm/nouveau/kms/nv50-: Fix disabling dithering drm/nouveau/kms/nv50-: s/harm/armh/g drm/nouveau/kms/nv140-: Tra...
2020 Jan 15
1
[PATCH v2 19/21] drm/vkms: Convert to CRTC VBLANK callbacks
...c *crtc, + int *max_error, ktime_t *vblank_time, + bool in_vblank_irq) { + struct drm_device *dev = crtc->dev; + unsigned int pipe = crtc->index; struct vkms_device *vkmsdev = drm_device_to_vkms_device(dev); struct vkms_output *output = &vkmsdev->output; struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; @@ -154,6 +156,7 @@ static const struct drm_crtc_funcs vkms_crtc_funcs = { .atomic_destroy_state = vkms_atomic_crtc_destroy_state, .enable_vblank = vkms_enable_vblank, .disable_vblank = vkms_disable_vblank, + .get_vblank_timestamp = vkms_get_vblank_tim...