diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-11-12 21:24:47 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-11-12 21:24:47 -0500 |
commit | f6d07dfcb15aad199d7351d3122eabd506968daf (patch) | |
tree | 7f76fb2b9c2d1966ed0bac068fead768eba3c56e /drivers/gpu/drm/drm_irq.c | |
parent | 0e976064256523ca604bd82048ae0e3402ce2467 (diff) | |
parent | 5bad7d29a7bcffb2dbc28ea2728eeb3af13784f2 (diff) |
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie:
"One urgent fix for an oops under console lock in some drivers, one
uapi fix, and one revert to fix rockchip regression"
* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
Revert "drm/rockchip: Convert the probe function to the generic drm_of_component_probe()"
drm: Don't oops in drm_calc_timestamping_constants() if drm_vblank_init() wasn't called
drm: Use userspace compatible type in fourcc_mod_code macro
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; |