summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Foss <robert.foss@collabora.com>2016-04-18 12:16:11 -0400
committerRobert Foss <robert.foss@collabora.com>2016-04-18 12:16:11 -0400
commit307a2270e71569cd1a59cf39368dcded128ee2ab (patch)
tree3b68bad22d3e5b36dced1ed9106df3b257d5c074
parent54fff103fd9b8312e8cb958dda3a0dc9d0793086 (diff)
downloadlinux-drm_vblank_debug.tar.gz
linux-drm_vblank_debug.tar.xz
Added debug printk's.drm_vblank_debug
-rw-r--r--drivers/gpu/drm/drm_atomic_helper.c5
-rw-r--r--drivers/gpu/drm/drm_irq.c49
-rw-r--r--drivers/gpu/drm/vc4/vc4_crtc.c7
-rw-r--r--drivers/gpu/drm/vc4/vc4_kms.c2
4 files changed, 50 insertions, 13 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 4befe25..0be5553 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -1056,6 +1056,7 @@ drm_atomic_helper_wait_for_vblanks(struct drm_device *dev,
struct drm_crtc *crtc;
struct drm_crtc_state *old_crtc_state;
int i, ret;
+printk("drm_atomic_helper_wait_for_vblanks() start\n");
for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) {
/* No one cares about the old state, so abuse it for tracking
@@ -1094,6 +1095,8 @@ drm_atomic_helper_wait_for_vblanks(struct drm_device *dev,
drm_crtc_vblank_put(crtc);
}
+printk("drm_atomic_helper_wait_for_vblanks() end\n");
+
}
EXPORT_SYMBOL(drm_atomic_helper_wait_for_vblanks);
@@ -1131,7 +1134,7 @@ int drm_atomic_helper_commit(struct drm_device *dev,
bool async)
{
int ret;
-
+printk("drm_atomic_helper_commit()\n");
if (async)
return -EBUSY;
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 881c5a6..dd17be3 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -405,7 +405,7 @@ int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs)
spin_lock_init(&dev->vbl_lock);
spin_lock_init(&dev->vblank_time_lock);
-
+printk("drm_vblank_init() start\n");
dev->num_crtcs = num_crtcs;
dev->vblank = kcalloc(num_crtcs, sizeof(*dev->vblank), GFP_KERNEL);
@@ -438,6 +438,7 @@ int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs)
}
dev->vblank_disable_allowed = false;
+printk("drm_vblank_init() end\n");
return 0;
@@ -565,7 +566,7 @@ int drm_irq_uninstall(struct drm_device *dev)
unsigned long irqflags;
bool irq_enabled;
int i;
-
+printk("drm_irq_uninstall\n");
if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
return -EINVAL;
@@ -1181,6 +1182,9 @@ static int drm_vblank_enable(struct drm_device *dev, unsigned int pipe)
vblank->enabled = true;
drm_update_vblank_count(dev, pipe, 0);
}
+ } else {
+printk("drm_vblank_enable() vblank already enabled!\n");
+
}
spin_unlock(&dev->vblank_time_lock);
@@ -1206,7 +1210,7 @@ int drm_vblank_get(struct drm_device *dev, unsigned int pipe)
struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
unsigned long irqflags;
int ret = 0;
-
+printk("drm_vblank_get() pipe=%u\n", pipe);
if (!dev->num_crtcs)
return -EINVAL;
@@ -1260,7 +1264,7 @@ EXPORT_SYMBOL(drm_crtc_vblank_get);
void drm_vblank_put(struct drm_device *dev, unsigned int pipe)
{
struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
-
+printk("drm_vblank_put() pipe=%u\n", pipe);
if (WARN_ON(pipe >= dev->num_crtcs))
return;
@@ -1272,7 +1276,10 @@ void drm_vblank_put(struct drm_device *dev, unsigned int pipe)
if (drm_vblank_offdelay == 0)
return;
else if (dev->vblank_disable_immediate || drm_vblank_offdelay < 0)
+ {
+printk("drm_vblank_put() vblank_disable_immediate=%d drm_vblank_offdelay=%d\n", dev->vblank_disable_immediate, drm_vblank_offdelay);
vblank_disable_fn((unsigned long)vblank);
+ }
else
mod_timer(&vblank->disable_timer,
jiffies + ((drm_vblank_offdelay * HZ)/1000));
@@ -1309,7 +1316,7 @@ void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe)
struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
int ret;
u32 last;
-
+printk("drm_wait_one_vblank() start\n");
if (WARN_ON(pipe >= dev->num_crtcs))
return;
@@ -1326,6 +1333,8 @@ void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe)
WARN(ret == 0, "vblank wait timed out on crtc %i\n", pipe);
drm_vblank_put(dev, pipe);
+printk("drm_wait_one_vblank() end\n");
+
}
EXPORT_SYMBOL(drm_wait_one_vblank);
@@ -1364,6 +1373,8 @@ void drm_vblank_off(struct drm_device *dev, unsigned int pipe)
struct timeval now;
unsigned long irqflags;
unsigned int seq;
+printk("drm_vblank_off() start\n");
+
if (WARN_ON(pipe >= dev->num_crtcs))
return;
@@ -1404,6 +1415,8 @@ void drm_vblank_off(struct drm_device *dev, unsigned int pipe)
send_vblank_event(dev, e, seq, &now);
}
spin_unlock_irqrestore(&dev->event_lock, irqflags);
+printk("drm_vblank_off() end\n");
+
}
EXPORT_SYMBOL(drm_vblank_off);
@@ -1653,7 +1666,7 @@ static int drm_queue_vblank_event(struct drm_device *dev, unsigned int pipe,
unsigned long flags;
unsigned int seq;
int ret;
-
+printk("drm_queue_vblank_event() start\n");
e = kzalloc(sizeof(*e), GFP_KERNEL);
if (e == NULL) {
ret = -ENOMEM;
@@ -1712,7 +1725,7 @@ static int drm_queue_vblank_event(struct drm_device *dev, unsigned int pipe,
}
spin_unlock_irqrestore(&dev->event_lock, flags);
-
+ printk("drm_queue_vblank_event() end\n");
return 0;
err_unlock:
@@ -1763,6 +1776,7 @@ int drm_wait_vblank(struct drm_device *dev, void *data,
flags = vblwait->request.type & _DRM_VBLANK_FLAGS_MASK;
high_pipe = (vblwait->request.type & _DRM_VBLANK_HIGH_CRTC_MASK);
+printk("drm_wait_vblank() request.type=0x%08x flags=0x%08x high_pipe=0x%08x\n", vblwait->request.type, flags, high_pipe);
if (high_pipe)
pipe = high_pipe >> _DRM_VBLANK_HIGH_CRTC_SHIFT;
else
@@ -1778,7 +1792,14 @@ int drm_wait_vblank(struct drm_device *dev, void *data,
return ret;
}
seq = drm_vblank_count(dev, pipe);
-
+printk("drm_wait_vblank() vblank_count=%u\n", seq);
+printk("drm_wait_vblank() _DRM_VBLANK_RELATIVE=%u _DRM_VBLANK_ABSOLUTE=%u _DRM_VBLANK_EVENT=%u _DRM_VBLANK_NEXTONMISS=%u sequence=%u\n",
+ (vblwait->request.type&_DRM_VBLANK_RELATIVE),
+ (vblwait->request.type&_DRM_VBLANK_ABSOLUTE),
+ (flags & _DRM_VBLANK_EVENT),
+ (flags & _DRM_VBLANK_NEXTONMISS),
+ vblwait->request.sequence
+ );
switch (vblwait->request.type & _DRM_VBLANK_TYPES_MASK) {
case _DRM_VBLANK_RELATIVE:
vblwait->request.sequence += seq;
@@ -1802,10 +1823,17 @@ int drm_wait_vblank(struct drm_device *dev, void *data,
vblwait->request.sequence = seq + 1;
}
+printk("drm_wait_vblank() _DRM_VBLANK_RELATIVE=%u _DRM_VBLANK_ABSOLUTE=%u _DRM_VBLANK_EVENT=%u _DRM_VBLANK_NEXTONMISS=%u sequence=%u\n",
+ (vblwait->request.type&_DRM_VBLANK_RELATIVE),
+ (vblwait->request.type&_DRM_VBLANK_ABSOLUTE),
+ (flags & _DRM_VBLANK_EVENT),
+ (flags & _DRM_VBLANK_NEXTONMISS),
+ vblwait->request.sequence
+ );
DRM_DEBUG("waiting on vblank count %d, crtc %u\n",
vblwait->request.sequence, pipe);
vblank->last_wait = vblwait->request.sequence;
- DRM_WAIT_ON(ret, vblank->queue, 3 * HZ,
+ DRM_WAIT_ON(ret, vblank->queue, 100 * HZ,
(((drm_vblank_count(dev, pipe) -
vblwait->request.sequence) <= (1 << 23)) ||
!vblank->enabled ||
@@ -1870,6 +1898,7 @@ bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe)
{
struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
unsigned long irqflags;
+printk("drm_handle_vblank() start\n");
if (WARN_ON_ONCE(!dev->num_crtcs))
return false;
@@ -1901,6 +1930,8 @@ bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe)
spin_unlock_irqrestore(&dev->event_lock, irqflags);
+printk("drm_handle_vblank() end\n");
+
return true;
}
EXPORT_SYMBOL(drm_handle_vblank);
diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
index 355ee4b..34e534f 100644
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
@@ -432,9 +432,9 @@ int vc4_enable_vblank(struct drm_device *dev, unsigned int crtc_id)
{
struct vc4_dev *vc4 = to_vc4_dev(dev);
struct vc4_crtc *vc4_crtc = vc4->crtc[crtc_id];
+printk("vc4_enable_vblank() crtc_id=%u\n", crtc_id);
CRTC_WRITE(PV_INTEN, PV_INT_VFP_START);
-
return 0;
}
@@ -444,6 +444,7 @@ void vc4_disable_vblank(struct drm_device *dev, unsigned int crtc_id)
struct vc4_crtc *vc4_crtc = vc4->crtc[crtc_id];
CRTC_WRITE(PV_INTEN, 0);
+printk("vc4_disable_vblank() crtc_id=%u\n", crtc_id);
}
static void vc4_crtc_handle_page_flip(struct vc4_crtc *vc4_crtc)
@@ -465,7 +466,8 @@ static irqreturn_t vc4_crtc_irq_handler(int irq, void *data)
struct vc4_crtc *vc4_crtc = data;
u32 stat = CRTC_READ(PV_INTSTAT);
irqreturn_t ret = IRQ_NONE;
-
+
+printk("vc4_crtc_irq_handler\n");
if (stat & PV_INT_VFP_START) {
CRTC_WRITE(PV_INTSTAT, PV_INT_VFP_START);
drm_crtc_handle_vblank(&vc4_crtc->base);
@@ -746,6 +748,7 @@ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data)
CRTC_WRITE(PV_INTSTAT, PV_INT_VFP_START);
ret = devm_request_irq(dev, platform_get_irq(pdev, 0),
vc4_crtc_irq_handler, 0, "vc4 crtc", vc4_crtc);
+printk("vc4_crtc_bind() set irq handler to vc4_crtc_irq_handler, ret=%d\n", ret);
if (ret)
goto err_destroy_planes;
diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c
index 4718ae5..a317041 100644
--- a/drivers/gpu/drm/vc4/vc4_kms.c
+++ b/drivers/gpu/drm/vc4/vc4_kms.c
@@ -42,7 +42,7 @@ vc4_atomic_complete_commit(struct vc4_commit *c)
struct drm_atomic_state *state = c->state;
struct drm_device *dev = state->dev;
struct vc4_dev *vc4 = to_vc4_dev(dev);
-
+printk("vc4_atomic_complete_commit()\n");
drm_atomic_helper_commit_modeset_disables(dev, state);
drm_atomic_helper_commit_planes(dev, state, false);