1
0
Fork 0
alistair23-linux/include/drm
Gustavo Padovan beaf5af480 drm/fence: add out-fences support
Support DRM out-fences by creating a sync_file with a fence for each CRTC
that sets the OUT_FENCE_PTR property.

We use the out_fence pointer received in the OUT_FENCE_PTR prop to send
the sync_file fd back to userspace.

The sync_file and fd are allocated/created before commit, but the
fd_install operation only happens after we know that commit succeed.

v2: Comment by Rob Clark:
	- Squash commit that adds DRM_MODE_ATOMIC_OUT_FENCE flag here.

    Comment by Daniel Vetter:
	- Add clean up code for out_fences

v3: Comments by Daniel Vetter:
	- create DRM_MODE_ATOMIC_EVENT_MASK
	- userspace should fill out_fences_ptr with the crtc_ids for which
	it wants fences back.

v4: Create OUT_FENCE_PTR properties and remove old approach.

v5: Comments by Brian Starkey:
	- Remove extra fence_get() in atomic_ioctl()
	- Check ret before iterating on the crtc_state
	- check ret before fd_install
	- set fence_state to NULL at the beginning
	- check fence_state->out_fence_ptr before put_user()
	- change order of fput() and put_unused_fd() on failure

     - Add access_ok() check to the out_fence_ptr received
     - Rebase after fence -> dma_fence rename
     - Store out_fence_ptr in the drm_atomic_state
     - Split crtc_setup_out_fence()
     - return -1 as out_fence with TEST_ONLY flag

v6: Comments by Daniel Vetter
	- Add prepare/unprepare_crtc_signaling()
	- move struct drm_out_fence_state to drm_atomic.c
	- mark get_crtc_fence() as static

    Comments by Brian Starkey
	- proper set fence_ptr fence_state array
	- isolate fence_idx increment

    - improve error handling

v7: Comments by Daniel Vetter
	- remove prefix from internal functions
	- make out_fence_ptr an s64 pointer
	- degrade DRM_INFO to DRM_DEBUG_ATOMIC when put_user fail
	- fix doc issues
	- filter out OUT_FENCE_PTR == NULL and do not fail in this case
	- add complete_crtc_signalling()
	- krealloc fence_state on demand

    Comment by Brian Starkey
	- remove unused crtc_state arg from get_out_fence()

v8: Comment by Brian Starkey
	- cancel events before check for !fence_state
	- convert a few lefovers u64 types for out_fence_ptr
	- fix memleak by assign fence_state earlier after realloc
	- proper accout num_fences in case of error

v9: Comment by Brian Starkey
	- memset last position of fence_state after krealloc
    Comments by Sean Paul
	- pass install_fds in complete_crtc_signaling() instead of ret

     - put_user(-1, fence_ptr) when decoding props

v10: Comment by Brian Starkey
	- remove unneeded num_fences increment on error path
	- kfree fence_state after installing fences fd

v11: rebase against latest drm-misc

v12: rebase again against latest drm-misc

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Brian Starkey <brian.starkey@arm.com> (v10)
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Tested-by: Robert Foss <robert.foss@collabora.com> (v10)
[danvet: Appease checkpatch.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1479301221-13056-1-git-send-email-gustavo@padovan.org
2016-11-16 14:36:27 +01:00
..
bridge video: add header file for Mobile High-Definition Link (MHL) interface 2016-10-26 10:29:58 +05:30
i2c drm/i2c: tda998x: Register ASoC hdmi-codec and add audio DT binding 2016-09-07 13:10:10 +01:00
ttm Merge tag 'topic/drm-misc-2016-10-27' of git://anongit.freedesktop.org/git/drm-intel into drm-next 2016-10-28 11:33:52 +10:00
ati_pcigart.h drm: Move legacy buffer structures to <drm/drm_legacy.h> 2014-09-12 15:28:12 +02:00
drmP.h drm/irq: Make drm_vblank_pre/post_modeset internal 2016-11-15 23:33:47 +01:00
drm_agpsupport.h drm: Give drm_agp_clear drm_legacy_ prefix 2016-04-27 08:41:34 +02:00
drm_atomic.h drm/fence: add out-fences support 2016-11-16 14:36:27 +01:00
drm_atomic_helper.h drm/fence: allow fence waiting to be interrupted by userspace 2016-09-12 16:59:15 -04:00
drm_auth.h drm: document drm_auth.c 2016-06-21 22:10:55 +02:00
drm_blend.h drm: RIP mode_config->rotation_property 2016-10-22 10:42:11 +02:00
drm_bridge.h drm: Extract drm_bridge.h 2016-09-19 15:04:15 +02:00
drm_cache.h drm: Loongson-3 doesn't fully support wc memory 2016-04-22 10:24:11 +10:00
drm_color_mgmt.h drm/doc: Document color space handling 2016-09-22 00:04:03 -07:00
drm_connector.h drm: Move tile group code into drm_connector.c 2016-11-15 15:30:38 +01:00
drm_crtc.h drm/fence: add fence timeline to drm_crtc 2016-11-16 10:42:48 +01:00
drm_crtc_helper.h drm/kms-helpers: Extract drm_modeset_helper.[hc] 2016-08-16 16:10:19 +02:00
drm_debugfs_crc.h drm: Add API for capturing frame CRCs 2016-10-17 16:44:34 +02:00
drm_displayid.h drm/edid: add displayid detailed 1 timings to the modelist. (v1.1) 2016-05-23 11:35:31 +10:00
drm_dp_dual_mode_helper.h drm: Fix LSPCON kernel-doc 2016-10-19 18:20:40 +03:00
drm_dp_helper.h drm/dp: Factor out helper to distinguish between branch and sink devices 2016-10-25 08:53:44 +02:00
drm_dp_mst_helper.h drm/dp-mst: Missing kernel doc 2016-07-19 10:31:53 +02:00
drm_drv.h drm: Consolidate dumb buffer docs 2016-11-15 12:51:49 +01:00
drm_edid.h drm: Move all decl for drm_edid.c to drm_edid.h 2016-09-19 15:04:32 +02:00
drm_encoder.h drm/crtc: constify drm_crtc_mask parameter 2016-10-17 08:12:05 +02:00
drm_encoder_slave.h drm: Constify drm_encoder_slave_funcs 2015-12-15 13:41:17 +01:00
drm_fb_cma_helper.h drm/fb_cma_helper: Add missing forward declaration 2016-11-15 12:24:08 +01:00
drm_fb_helper.h drm/fb-helper: add fb_debug_* to DRM_FB_HELPER_DEFAULT_OPS 2016-11-14 07:47:46 +01:00
drm_fixed.h drm: Add drm_fixp_from_fraction and drm_fixp2int_ceil 2016-02-05 15:23:48 +10:00
drm_flip_work.h drm: flip-work: change drm_flip_work_init prototype 2014-11-15 09:29:14 +10:00
drm_fourcc.h drm: move allocation out of drm_get_format_name() 2016-11-12 14:19:38 +01:00
drm_framebuffer.h drm: Move a few macros away from drm_crtc.h 2016-09-19 15:03:46 +02:00
drm_gem.h drm/doc: Fix more kerneldoc/sphinx warnings 2016-08-16 16:09:58 +02:00
drm_gem_cma_helper.h drm/cma: Introduce drm_gem_cma_dumb_create_internal() 2014-11-13 13:27:17 +01:00
drm_global.h drm: move ttm global code to core drm 2010-08-04 09:46:06 +10:00
drm_hashtab.h drm: Add a hash-tab rcu-safe API 2012-11-28 18:36:05 +10:00
drm_irq.h drm: drm_irq.h header cleanup 2016-11-15 23:33:48 +01:00
drm_legacy.h drm: document drm_auth.c 2016-06-21 22:10:55 +02:00
drm_mem_util.h drm,i915: Introduce drm_malloc_gfp() 2016-04-11 17:13:10 +01:00
drm_mipi_dsi.h drm/dsi: Implement DCS set/get display brightness 2016-08-24 13:34:00 +02:00
drm_mm.h drm: Track drm_mm allocators and show leaks on shutdown 2016-11-08 10:35:29 +01:00
drm_mode_config.h drm/fence: add out-fences support 2016-11-16 14:36:27 +01:00
drm_mode_object.h drm: Extract drm_bridge.h 2016-09-19 15:04:15 +02:00
drm_modes.h drm: Extract drm_bridge.h 2016-09-19 15:04:15 +02:00
drm_modeset_helper.h drm/kms-helpers: Extract drm_modeset_helper.[hc] 2016-08-16 16:10:19 +02:00
drm_modeset_helper_vtables.h drm/atomic-helper: fix reference to drm_atomic_helper_commit_planes 2016-11-08 10:43:58 +01:00
drm_modeset_lock.h drm: don't let crtc_ww_class leak out 2016-11-15 08:33:35 +01:00
drm_of.h drm: mark drm_of_component_match_add dummy inline 2016-10-26 15:48:42 -04:00
drm_os_linux.h drm: Kill DRM_SUSER 2013-12-18 11:35:45 +10:00
drm_panel.h drm/panel: Flesh out kerneldoc 2016-05-06 16:04:48 +02:00
drm_pciids.h drm/radeon: add new OLAND pci id 2015-08-12 12:24:05 -04:00
drm_plane.h Merge tag 'topic/drm-misc-2016-11-10' of git://anongit.freedesktop.org/drm-intel into drm-next 2016-11-11 09:28:44 +10:00
drm_plane_helper.h drm/kms-helpers: Extract drm_modeset_helper.[hc] 2016-08-16 16:10:19 +02:00
drm_print.h drm/print: Move kerneldoc next to definition 2016-11-15 12:55:24 +01:00
drm_property.h drm: Move a few macros away from drm_crtc.h 2016-09-19 15:03:46 +02:00
drm_rect.h drm: Add "prefix" parameter to drm_rect_debug_print() 2015-11-24 11:47:46 +01:00
drm_simple_kms_helper.h drm: simple_kms_helper: Add prepare_fb and cleanup_fb hooks 2016-10-05 15:18:02 +02:00
drm_sysfs.h drm: Enable drm drivers to add drm sysfs devices. 2009-08-19 16:08:51 +10:00
drm_vma_manager.h drm: use drm_file to tag vm-bos 2016-09-19 11:22:08 +02:00
gma_drm.h drm/gma500: Remove unused ioctls 2014-03-17 20:11:57 +01:00
i915_component.h drm/i915/dp: DP audio API changes for MST 2016-09-22 09:01:55 -07:00
i915_drm.h drm: avoid "possible bad bitmask?" warning 2016-08-09 22:18:26 +02:00
i915_pciids.h drm/i915: Remove .is_mobile field from platform struct 2016-09-07 16:07:07 -07:00
intel-gtt.h drm/i915: Add support for mapping an object page by page 2016-06-13 10:03:54 +01:00