diff options
| -rw-r--r-- | Documentation/DocBook/drm.tmpl | 6 | ||||
| -rw-r--r-- | drivers/gpu/drm/drm_irq.c | 2 | ||||
| -rw-r--r-- | include/drm/drmP.h | 10 |
3 files changed, 17 insertions, 1 deletions
diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl index 55923d00bd52..583edbffff1a 100644 --- a/Documentation/DocBook/drm.tmpl +++ b/Documentation/DocBook/drm.tmpl | |||
| @@ -3387,6 +3387,12 @@ void (*disable_vblank) (struct drm_device *dev, int crtc);</synopsis> | |||
| 3387 | module parameter or the <varname>drm_vblank_offdelay</varname> global | 3387 | module parameter or the <varname>drm_vblank_offdelay</varname> global |
| 3388 | variable and expressed in milliseconds. Its default value is 5000 ms. | 3388 | variable and expressed in milliseconds. Its default value is 5000 ms. |
| 3389 | Zero means never disable, and a negative value means disable immediately. | 3389 | Zero means never disable, and a negative value means disable immediately. |
| 3390 | Drivers may override the behaviour by setting the | ||
| 3391 | <structname>drm_device</structname> | ||
| 3392 | <structfield>vblank_disable_immediate</structfield> flag, which when set | ||
| 3393 | causes vblank interrupts to be disabled immediately regardless of the | ||
| 3394 | drm_vblank_offdelay value. The flag should only be set if there's a | ||
| 3395 | properly working hardware vblank counter present. | ||
| 3390 | </para> | 3396 | </para> |
| 3391 | <para> | 3397 | <para> |
| 3392 | When a vertical blanking interrupt occurs drivers only need to call the | 3398 | When a vertical blanking interrupt occurs drivers only need to call the |
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 99145c4d536b..8dbcc3f892d5 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c | |||
| @@ -994,7 +994,7 @@ void drm_vblank_put(struct drm_device *dev, int crtc) | |||
| 994 | 994 | ||
| 995 | /* Last user schedules interrupt disable */ | 995 | /* Last user schedules interrupt disable */ |
| 996 | if (atomic_dec_and_test(&vblank->refcount)) { | 996 | if (atomic_dec_and_test(&vblank->refcount)) { |
| 997 | if (drm_vblank_offdelay < 0) | 997 | if (dev->vblank_disable_immediate || drm_vblank_offdelay < 0) |
| 998 | vblank_disable_fn((unsigned long)vblank); | 998 | vblank_disable_fn((unsigned long)vblank); |
| 999 | else if (drm_vblank_offdelay > 0) | 999 | else if (drm_vblank_offdelay > 0) |
| 1000 | mod_timer(&vblank->disable_timer, | 1000 | mod_timer(&vblank->disable_timer, |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 24b32d453c60..17a5c10474bd 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
| @@ -1074,6 +1074,16 @@ struct drm_device { | |||
| 1074 | */ | 1074 | */ |
| 1075 | bool vblank_disable_allowed; | 1075 | bool vblank_disable_allowed; |
| 1076 | 1076 | ||
| 1077 | /* | ||
| 1078 | * If true, vblank interrupt will be disabled immediately when the | ||
| 1079 | * refcount drops to zero, as opposed to via the vblank disable | ||
| 1080 | * timer. | ||
| 1081 | * This can be set to true it the hardware has a working vblank | ||
| 1082 | * counter and the driver uses drm_vblank_on() and drm_vblank_off() | ||
| 1083 | * appropriately. | ||
| 1084 | */ | ||
| 1085 | bool vblank_disable_immediate; | ||
| 1086 | |||
| 1077 | /* array of size num_crtcs */ | 1087 | /* array of size num_crtcs */ |
| 1078 | struct drm_vblank_crtc *vblank; | 1088 | struct drm_vblank_crtc *vblank; |
| 1079 | 1089 | ||
