[PATCH 17/17] drm/vblank_crtc: Rename struct drm_vblank_crtc::dev to drm
Uwe Kleine-König
u.kleine-koenig at pengutronix.de
Thu Jul 13 08:24:08 UTC 2023
"dev" is usually used for struct device pointers. Using it for struct
drm_device pointers is irritating (for me at least). Replace it
by "drm" and adapt all users.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
---
drivers/gpu/drm/drm_vblank.c | 4 ++--
drivers/gpu/drm/drm_vblank_work.c | 18 +++++++++---------
include/drm/drm_vblank.h | 4 ++--
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index 87e305c8f7f6..351b0e3d1361 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -485,7 +485,7 @@ void drm_vblank_disable_and_save(struct drm_device *dev, unsigned int pipe)
static void vblank_disable_fn(struct timer_list *t)
{
struct drm_vblank_crtc *vblank = from_timer(vblank, t, disable_timer);
- struct drm_device *dev = vblank->dev;
+ struct drm_device *dev = vblank->drm;
unsigned int pipe = vblank->pipe;
unsigned long irqflags;
@@ -537,7 +537,7 @@ int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs)
for (i = 0; i < num_crtcs; i++) {
struct drm_vblank_crtc *vblank = &dev->vblank[i];
- vblank->dev = dev;
+ vblank->drm = dev;
vblank->pipe = i;
init_waitqueue_head(&vblank->queue);
timer_setup(&vblank->disable_timer, vblank_disable_fn, 0);
diff --git a/drivers/gpu/drm/drm_vblank_work.c b/drivers/gpu/drm/drm_vblank_work.c
index f6e024bed6b5..acd551ff247d 100644
--- a/drivers/gpu/drm/drm_vblank_work.c
+++ b/drivers/gpu/drm/drm_vblank_work.c
@@ -49,14 +49,14 @@ void drm_handle_vblank_works(struct drm_vblank_crtc *vblank)
u64 count = atomic64_read(&vblank->count);
bool wake = false;
- assert_spin_locked(&vblank->dev->event_lock);
+ assert_spin_locked(&vblank->drm->event_lock);
list_for_each_entry_safe(work, next, &vblank->pending_work, node) {
if (!drm_vblank_passed(count, work->count))
continue;
list_del_init(&work->node);
- drm_vblank_put(vblank->dev, vblank->pipe);
+ drm_vblank_put(vblank->drm, vblank->pipe);
kthread_queue_work(vblank->worker, &work->base);
wake = true;
}
@@ -71,11 +71,11 @@ void drm_vblank_cancel_pending_works(struct drm_vblank_crtc *vblank)
{
struct drm_vblank_work *work, *next;
- assert_spin_locked(&vblank->dev->event_lock);
+ assert_spin_locked(&vblank->drm->event_lock);
list_for_each_entry_safe(work, next, &vblank->pending_work, node) {
list_del_init(&work->node);
- drm_vblank_put(vblank->dev, vblank->pipe);
+ drm_vblank_put(vblank->drm, vblank->pipe);
}
wake_up_all(&vblank->work_wait_queue);
@@ -107,7 +107,7 @@ int drm_vblank_work_schedule(struct drm_vblank_work *work,
u64 count, bool nextonmiss)
{
struct drm_vblank_crtc *vblank = work->vblank;
- struct drm_device *dev = vblank->dev;
+ struct drm_device *dev = vblank->drm;
u64 cur_vbl;
unsigned long irqflags;
bool passed, inmodeset, rescheduling = false, wake = false;
@@ -182,13 +182,13 @@ EXPORT_SYMBOL(drm_vblank_work_schedule);
bool drm_vblank_work_cancel_sync(struct drm_vblank_work *work)
{
struct drm_vblank_crtc *vblank = work->vblank;
- struct drm_device *dev = vblank->dev;
+ struct drm_device *dev = vblank->drm;
bool ret = false;
spin_lock_irq(&dev->event_lock);
if (!list_empty(&work->node)) {
list_del_init(&work->node);
- drm_vblank_put(vblank->dev, vblank->pipe);
+ drm_vblank_put(vblank->drm, vblank->pipe);
ret = true;
}
@@ -218,7 +218,7 @@ EXPORT_SYMBOL(drm_vblank_work_cancel_sync);
void drm_vblank_work_flush(struct drm_vblank_work *work)
{
struct drm_vblank_crtc *vblank = work->vblank;
- struct drm_device *dev = vblank->dev;
+ struct drm_device *dev = vblank->drm;
spin_lock_irq(&dev->event_lock);
wait_event_lock_irq(vblank->work_wait_queue, list_empty(&work->node),
@@ -253,7 +253,7 @@ int drm_vblank_worker_init(struct drm_vblank_crtc *vblank)
INIT_LIST_HEAD(&vblank->pending_work);
init_waitqueue_head(&vblank->work_wait_queue);
worker = kthread_create_worker(0, "card%d-crtc%d",
- vblank->dev->primary->index,
+ vblank->drm->primary->index,
vblank->pipe);
if (IS_ERR(worker))
return PTR_ERR(worker);
diff --git a/include/drm/drm_vblank.h b/include/drm/drm_vblank.h
index 7f3957943dd1..a89fc63a94f5 100644
--- a/include/drm/drm_vblank.h
+++ b/include/drm/drm_vblank.h
@@ -90,9 +90,9 @@ struct drm_pending_vblank_event {
*/
struct drm_vblank_crtc {
/**
- * @dev: Pointer to the &drm_device.
+ * @drm: Pointer to the &drm_device.
*/
- struct drm_device *dev;
+ struct drm_device *drm;
/**
* @queue: Wait queue for vblank waiters.
*/
--
2.39.2
More information about the dri-devel
mailing list