diff options
Diffstat (limited to 'drivers/gpu/drm/drm_irq.c')
-rw-r--r-- | drivers/gpu/drm/drm_irq.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index eba6337f5860..2151ea551d3b 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c | |||
@@ -616,10 +616,18 @@ int drm_control(struct drm_device *dev, void *data, | |||
616 | void drm_calc_timestamping_constants(struct drm_crtc *crtc, | 616 | void drm_calc_timestamping_constants(struct drm_crtc *crtc, |
617 | const struct drm_display_mode *mode) | 617 | const struct drm_display_mode *mode) |
618 | { | 618 | { |
619 | struct drm_vblank_crtc *vblank = &crtc->dev->vblank[drm_crtc_index(crtc)]; | 619 | struct drm_device *dev = crtc->dev; |
620 | unsigned int pipe = drm_crtc_index(crtc); | ||
621 | struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; | ||
620 | int linedur_ns = 0, framedur_ns = 0; | 622 | int linedur_ns = 0, framedur_ns = 0; |
621 | int dotclock = mode->crtc_clock; | 623 | int dotclock = mode->crtc_clock; |
622 | 624 | ||
625 | if (!dev->num_crtcs) | ||
626 | return; | ||
627 | |||
628 | if (WARN_ON(pipe >= dev->num_crtcs)) | ||
629 | return; | ||
630 | |||
623 | /* Valid dotclock? */ | 631 | /* Valid dotclock? */ |
624 | if (dotclock > 0) { | 632 | if (dotclock > 0) { |
625 | int frame_size = mode->crtc_htotal * mode->crtc_vtotal; | 633 | int frame_size = mode->crtc_htotal * mode->crtc_vtotal; |