diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-02-26 15:34:42 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-02-26 15:34:42 -0500 |
commit | 8e22e1b3499a446df48c2b26667ca36c55bf864c (patch) | |
tree | 5329f98b3eb3c95a9dcbab0fa4f9b6e62f0e788d /drivers/gpu/drm/drm_atomic.c | |
parent | 00d3c14f14d51babd8aeafd5fa734ccf04f5ca3d (diff) | |
parent | 64a577196d66b44e37384bc5c4d78c61f59d5b2a (diff) |
Merge airlied/drm-next into drm-misc-next
Backmerge the main pull request to sync up with all the newly landed
drivers. Otherwise we'll have chaos even before 4.12 started in
earnest.
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'drivers/gpu/drm/drm_atomic.c')
-rw-r--r-- | drivers/gpu/drm/drm_atomic.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 5a0c7082c8f8..afec53832145 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c | |||
@@ -288,15 +288,15 @@ drm_atomic_get_crtc_state(struct drm_atomic_state *state, | |||
288 | EXPORT_SYMBOL(drm_atomic_get_crtc_state); | 288 | EXPORT_SYMBOL(drm_atomic_get_crtc_state); |
289 | 289 | ||
290 | static void set_out_fence_for_crtc(struct drm_atomic_state *state, | 290 | static void set_out_fence_for_crtc(struct drm_atomic_state *state, |
291 | struct drm_crtc *crtc, s64 __user *fence_ptr) | 291 | struct drm_crtc *crtc, s32 __user *fence_ptr) |
292 | { | 292 | { |
293 | state->crtcs[drm_crtc_index(crtc)].out_fence_ptr = fence_ptr; | 293 | state->crtcs[drm_crtc_index(crtc)].out_fence_ptr = fence_ptr; |
294 | } | 294 | } |
295 | 295 | ||
296 | static s64 __user *get_out_fence_for_crtc(struct drm_atomic_state *state, | 296 | static s32 __user *get_out_fence_for_crtc(struct drm_atomic_state *state, |
297 | struct drm_crtc *crtc) | 297 | struct drm_crtc *crtc) |
298 | { | 298 | { |
299 | s64 __user *fence_ptr; | 299 | s32 __user *fence_ptr; |
300 | 300 | ||
301 | fence_ptr = state->crtcs[drm_crtc_index(crtc)].out_fence_ptr; | 301 | fence_ptr = state->crtcs[drm_crtc_index(crtc)].out_fence_ptr; |
302 | state->crtcs[drm_crtc_index(crtc)].out_fence_ptr = NULL; | 302 | state->crtcs[drm_crtc_index(crtc)].out_fence_ptr = NULL; |
@@ -507,7 +507,7 @@ int drm_atomic_crtc_set_property(struct drm_crtc *crtc, | |||
507 | state->color_mgmt_changed |= replaced; | 507 | state->color_mgmt_changed |= replaced; |
508 | return ret; | 508 | return ret; |
509 | } else if (property == config->prop_out_fence_ptr) { | 509 | } else if (property == config->prop_out_fence_ptr) { |
510 | s64 __user *fence_ptr = u64_to_user_ptr(val); | 510 | s32 __user *fence_ptr = u64_to_user_ptr(val); |
511 | 511 | ||
512 | if (!fence_ptr) | 512 | if (!fence_ptr) |
513 | return 0; | 513 | return 0; |
@@ -1914,7 +1914,7 @@ EXPORT_SYMBOL(drm_atomic_clean_old_fb); | |||
1914 | */ | 1914 | */ |
1915 | 1915 | ||
1916 | struct drm_out_fence_state { | 1916 | struct drm_out_fence_state { |
1917 | s64 __user *out_fence_ptr; | 1917 | s32 __user *out_fence_ptr; |
1918 | struct sync_file *sync_file; | 1918 | struct sync_file *sync_file; |
1919 | int fd; | 1919 | int fd; |
1920 | }; | 1920 | }; |
@@ -1951,7 +1951,7 @@ static int prepare_crtc_signaling(struct drm_device *dev, | |||
1951 | return 0; | 1951 | return 0; |
1952 | 1952 | ||
1953 | for_each_new_crtc_in_state(state, crtc, crtc_state, i) { | 1953 | for_each_new_crtc_in_state(state, crtc, crtc_state, i) { |
1954 | u64 __user *fence_ptr; | 1954 | s32 __user *fence_ptr; |
1955 | 1955 | ||
1956 | fence_ptr = get_out_fence_for_crtc(crtc_state->state, crtc); | 1956 | fence_ptr = get_out_fence_for_crtc(crtc_state->state, crtc); |
1957 | 1957 | ||
@@ -2031,13 +2031,16 @@ static void complete_crtc_signaling(struct drm_device *dev, | |||
2031 | } | 2031 | } |
2032 | 2032 | ||
2033 | for_each_new_crtc_in_state(state, crtc, crtc_state, i) { | 2033 | for_each_new_crtc_in_state(state, crtc, crtc_state, i) { |
2034 | struct drm_pending_vblank_event *event = crtc_state->event; | ||
2034 | /* | 2035 | /* |
2035 | * TEST_ONLY and PAGE_FLIP_EVENT are mutually | 2036 | * Free the allocated event. drm_atomic_helper_setup_commit |
2036 | * exclusive, if they weren't, this code should be | 2037 | * can allocate an event too, so only free it if it's ours |
2037 | * called on success for TEST_ONLY too. | 2038 | * to prevent a double free in drm_atomic_state_clear. |
2038 | */ | 2039 | */ |
2039 | if (crtc_state->event) | 2040 | if (event && (event->base.fence || event->base.file_priv)) { |
2040 | drm_event_cancel_free(dev, &crtc_state->event->base); | 2041 | drm_event_cancel_free(dev, &event->base); |
2042 | crtc_state->event = NULL; | ||
2043 | } | ||
2041 | } | 2044 | } |
2042 | 2045 | ||
2043 | if (!fence_state) | 2046 | if (!fence_state) |