forked from luck/tmp_suning_uos_patched
321ebf04dc
So my original plan was that the drm core refcounts framebuffers like with the legacy ioctls. But that doesn't work for a bunch of reasons: - State objects might live longer than until the next fb change happens for a plane. For example delayed cleanup work only happens _after_ the pageflip ioctl has completed. So this definitely doesn't work without the plane state holding its own references. - The other issue is transition from legacy to atomic implementations, where the driver works under a mix of both worlds. Which means legacy paths might not properly update the ->fb pointer under plane->state->fb. Which is a bit a problem when then someone comes around and _does_ try to clean it up when it's long gone. The second issue is just a bit a transition bug, since drivers should update plane->state->fb in all the paths that aren't converted yet. But a bit more robustness for the transition can't hurt - we pull similar tricks with cleaning up the old fb in the transitional helpers already. The pattern for drivers that transition is if (plane->state) drm_atomic_set_fb_for_plane(plane->state, plane->fb); inserted after the fb update has logically completed at the end of ->set_config (or ->set_base/mode_set if using the crtc helpers), ->page_flip, ->update_plane or any other entry point which updates plane->fb. v2: Update kerneldoc - copypasta fail. v3: Fix spelling in the commit message (Sean). Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
68 lines
2.7 KiB
C
68 lines
2.7 KiB
C
/*
|
|
* Copyright (C) 2014 Red Hat
|
|
* Copyright (C) 2014 Intel Corp.
|
|
*
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
* to deal in the Software without restriction, including without limitation
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
*
|
|
* The above copyright notice and this permission notice shall be included in
|
|
* all copies or substantial portions of the Software.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
* OTHER DEALINGS IN THE SOFTWARE.
|
|
*
|
|
* Authors:
|
|
* Rob Clark <robdclark@gmail.com>
|
|
* Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
*/
|
|
|
|
#ifndef DRM_ATOMIC_H_
|
|
#define DRM_ATOMIC_H_
|
|
|
|
struct drm_atomic_state * __must_check
|
|
drm_atomic_state_alloc(struct drm_device *dev);
|
|
void drm_atomic_state_clear(struct drm_atomic_state *state);
|
|
void drm_atomic_state_free(struct drm_atomic_state *state);
|
|
|
|
struct drm_crtc_state * __must_check
|
|
drm_atomic_get_crtc_state(struct drm_atomic_state *state,
|
|
struct drm_crtc *crtc);
|
|
struct drm_plane_state * __must_check
|
|
drm_atomic_get_plane_state(struct drm_atomic_state *state,
|
|
struct drm_plane *plane);
|
|
struct drm_connector_state * __must_check
|
|
drm_atomic_get_connector_state(struct drm_atomic_state *state,
|
|
struct drm_connector *connector);
|
|
|
|
int __must_check
|
|
drm_atomic_set_crtc_for_plane(struct drm_plane_state *plane_state,
|
|
struct drm_crtc *crtc);
|
|
void drm_atomic_set_fb_for_plane(struct drm_plane_state *plane_state,
|
|
struct drm_framebuffer *fb);
|
|
int __must_check
|
|
drm_atomic_set_crtc_for_connector(struct drm_connector_state *conn_state,
|
|
struct drm_crtc *crtc);
|
|
int __must_check
|
|
drm_atomic_add_affected_connectors(struct drm_atomic_state *state,
|
|
struct drm_crtc *crtc);
|
|
int
|
|
drm_atomic_connectors_for_crtc(struct drm_atomic_state *state,
|
|
struct drm_crtc *crtc);
|
|
|
|
void drm_atomic_legacy_backoff(struct drm_atomic_state *state);
|
|
|
|
int __must_check drm_atomic_check_only(struct drm_atomic_state *state);
|
|
int __must_check drm_atomic_commit(struct drm_atomic_state *state);
|
|
int __must_check drm_atomic_async_commit(struct drm_atomic_state *state);
|
|
|
|
#endif /* DRM_ATOMIC_H_ */
|