android_kernel_motorola_sm6375/include/drm
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Arnd Bergmann 67680d3c04 drm: vblank: use ktime_t instead of timeval
The drm vblank handling uses 'timeval' to store timestamps in either
monotonic or wall-clock time base. In either case, it reads the current
time as a ktime_t in get_drm_timestamp() and converts it from there.

This is a bit suspicious, as users of 'timeval' often suffer from
the time_t overflow in y2038. I have gone through this code and
found that it is unlikely to cause problems here:

- The user space ABI does not use time_t or timeval, but uses
  'u32' and 'long' as the types. This means at least that rebuilding
  user programs against a new libc with 64-bit time_t does not
  change the ABI.

- As of commit c61eef726a ("drm: add support for monotonic vblank
  timestamps") in linux-3.8, the monotonic timestamp is the default
  and can only get reverted to wall-clock through a module-parameter.

- With the default monotonic timestamps, there is no problem at all.

- The drm_wait_vblank_ioctl() interface is alway safe on 64-bit
  architectures, on 32-bit it might overflow the 'long' timestamps
  in 2038 with wall-clock timestamps.

- The event handling uses 'u32' seconds, which overflow in 2106
  on both 32-bit and 64-bit machines, when wall-clock timestamps
  are used.

- The effect of overflowing either of the two is only temporary
  (during the overflow, and is likely to keep working again
  afterwards. It is likely the same problem as observing a
  'settimeofday()' call, which was the reason for moving to the
  monotonic timestamps in the first place.

Overall, this seems good enough, so my patch removes the use of
'timeval' from the vblank handling altogether and uses ktime_t
consistently, except for the part where we copy the data to user
space structures in the existing format.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-10-13 08:34:46 +10:00
..
bridge Merge airlied/drm-next into drm-misc-next 2017-07-26 13:43:33 +02:00
i2c
tinydrm drm/tinydrm: Generalize tinydrm_xrgb8888_to_gray8() 2017-08-09 17:55:50 +02:00
ttm drm/ttm: add support for different pool sizes 2017-10-06 17:44:16 -04:00
ati_pcigart.h
drm_agpsupport.h
drm_atomic.h drm/atomic: Remove deprecated accessor macros 2017-09-08 10:39:37 +02:00
drm_atomic_helper.h drm: Nuke drm_atomic_helper_connector_dpms 2017-08-08 14:48:48 +02:00
drm_auth.h
drm_blend.h
drm_bridge.h drm/bridge: change return type of drm_bridge_add function 2017-08-21 08:51:53 +05:30
drm_cache.h
drm_color_mgmt.h
drm_connector.h drm: Pass struct drm_file * to __drm_mode_object_find [v2] 2017-10-12 10:03:04 +10:00
drm_crtc.h drm: Pass struct drm_file * to __drm_mode_object_find [v2] 2017-10-12 10:03:04 +10:00
drm_crtc_helper.h
drm_debugfs.h
drm_debugfs_crc.h
drm_device.h drm: Extract drm_device.h 2017-08-11 10:47:17 +02:00
drm_displayid.h
drm_dp_dual_mode_helper.h
drm_dp_helper.h drm/dp: Add defines for latency in sink 2017-09-28 09:39:35 -07:00
drm_dp_mst_helper.h drm/dp/mst: Sideband message transaction to power up/down nodes 2017-09-11 16:03:57 +03:00
drm_drv.h drm: vblank: use ktime_t instead of timeval 2017-10-13 08:34:46 +10:00
drm_edid.h drm: add backwards compatibility support for drm_kms_helper.edid_firmware 2017-09-19 18:11:45 +03:00
drm_encoder.h drm: Pass struct drm_file * to __drm_mode_object_find [v2] 2017-10-12 10:03:04 +10:00
drm_encoder_slave.h
drm_fb_cma_helper.h drm/fb-cma-helper: Remove unused functions 2017-10-01 17:05:39 +02:00
drm_fb_helper.h drm: remove unused and redundant callbacks 2017-08-07 11:20:36 +02:00
drm_file.h
drm_fixed.h
drm_flip_work.h
drm_fourcc.h
drm_framebuffer.h drm: Pass struct drm_file * to __drm_mode_object_find [v2] 2017-10-12 10:03:04 +10:00
drm_gem.h drm/gem: Add drm_gem_dumb_map_offset() 2017-07-29 13:49:55 +02:00
drm_gem_cma_helper.h drm/gem-cma-helper: Remove drm_gem_cma_dumb_map_offset() 2017-08-16 20:21:24 +02:00
drm_gem_framebuffer_helper.h drm/gem-fb-helper: Use debug message on gem lookup failure 2017-09-16 14:06:53 +02:00
drm_global.h
drm_hashtab.h
drm_ioctl.h
drm_irq.h
drm_legacy.h
drm_mipi_dsi.h
drm_mm.h lib/interval_tree: fast overlap detection 2017-09-08 18:26:49 -07:00
drm_mode_config.h drm: Create a format/modifier blob 2017-08-01 17:50:06 +01:00
drm_mode_object.h drm: Pass struct drm_file * to __drm_mode_object_find [v2] 2017-10-12 10:03:04 +10:00
drm_modes.h drm: add helper functions for YCBCR420 handling 2017-07-14 21:23:54 +03:00
drm_modeset_helper.h
drm_modeset_helper_vtables.h drm/vtables: Fix typo 2017-09-01 19:50:24 +02:00
drm_modeset_lock.h drm/atomic: Prepare drm_modeset_lock infrastructure for interruptible waiting, v2. 2017-09-13 09:50:52 +02:00
drm_of.h
drm_os_linux.h
drm_panel.h
drm_pci.h
drm_pciids.h
drm_plane.h drm: Pass struct drm_file * to __drm_mode_object_find [v2] 2017-10-12 10:03:04 +10:00
drm_plane_helper.h
drm_prime.h
drm_print.h
drm_property.h drm: Pass struct drm_file * to __drm_mode_object_find [v2] 2017-10-12 10:03:04 +10:00
drm_rect.h
drm_scdc_helper.h drm: Fix warning when building docs for scdc_helper 2017-07-31 14:24:14 +02:00
drm_simple_kms_helper.h drm: Plumb modifiers through plane init 2017-08-01 17:50:06 +01:00
drm_syncobj.h drm/syncobj: add a new helper drm_syncobj_get_fd 2017-10-06 16:47:53 -04:00
drm_sysfs.h
drm_vblank.h drm: vblank: use ktime_t instead of timeval 2017-10-13 08:34:46 +10:00
drm_vma_manager.h
drmP.h drm: Document device unplug infrastructure 2017-08-11 10:48:03 +02:00
gma_drm.h
i915_component.h
i915_drm.h
i915_pciids.h drm/i915/kbl: Change a KBL pci id to GT2 from GT1.5 2017-09-21 06:22:29 -07:00
intel-gtt.h
intel_lpe_audio.h