mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-08-09 06:14:34 +02:00
The KMS framework uses two slightly different definitions for the state concept. For a given object (plane, CRTC, encoder, etc., so drm_$OBJECT_state), the state is the entire state of that object. However, at the device level, drm_atomic_state refers to a state update for a limited number of objects. Thus, drm_atomic_state isn't the entire device state, but only the full state of some objects in that device. This has been an endless source of confusion and thus bugs. We can rename the drm_atomic_state structure to drm_atomic_commit to make it less confusing. This patch was created using: rg -l drm_atomic_state | \ xargs sed -i 's/drm_atomic_state/drm_atomic_commit/g; s/drm_atomic_commit_helper/drm_atomic_state_helper/g' mv drivers/gpu/drm/tests/drm_atomic_state_test.c drivers/gpu/drm/tests/drm_atomic_commit_test.c Acked-by: Simona Vetter <simona.vetter@ffwll.ch> Acked-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Dave Airlie <airlied@redhat.com> Link: https://patch.msgid.link/20260427-drm-drm-atomic-update-v4-1-c0e713bfdf25@kernel.org
57 lines
1.6 KiB
C
57 lines
1.6 KiB
C
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
|
|
#ifndef _DRM_VBLANK_HELPER_H_
|
|
#define _DRM_VBLANK_HELPER_H_
|
|
|
|
#include <linux/hrtimer_types.h>
|
|
#include <linux/types.h>
|
|
|
|
struct drm_atomic_commit;
|
|
struct drm_crtc;
|
|
|
|
/*
|
|
* VBLANK helpers
|
|
*/
|
|
|
|
void drm_crtc_vblank_atomic_flush(struct drm_crtc *crtc,
|
|
struct drm_atomic_commit *state);
|
|
void drm_crtc_vblank_atomic_enable(struct drm_crtc *crtc,
|
|
struct drm_atomic_commit *state);
|
|
void drm_crtc_vblank_atomic_disable(struct drm_crtc *crtc,
|
|
struct drm_atomic_commit *crtc_state);
|
|
|
|
/**
|
|
* DRM_CRTC_HELPER_VBLANK_FUNCS - Default implementation for VBLANK helpers
|
|
*
|
|
* This macro initializes struct &drm_crtc_helper_funcs to default helpers
|
|
* for VBLANK handling.
|
|
*/
|
|
#define DRM_CRTC_HELPER_VBLANK_FUNCS \
|
|
.atomic_flush = drm_crtc_vblank_atomic_flush, \
|
|
.atomic_enable = drm_crtc_vblank_atomic_enable, \
|
|
.atomic_disable = drm_crtc_vblank_atomic_disable
|
|
|
|
/*
|
|
* VBLANK timer
|
|
*/
|
|
|
|
int drm_crtc_vblank_helper_enable_vblank_timer(struct drm_crtc *crtc);
|
|
void drm_crtc_vblank_helper_disable_vblank_timer(struct drm_crtc *crtc);
|
|
bool drm_crtc_vblank_helper_get_vblank_timestamp_from_timer(struct drm_crtc *crtc,
|
|
int *max_error,
|
|
ktime_t *vblank_time,
|
|
bool in_vblank_irq);
|
|
|
|
/**
|
|
* DRM_CRTC_VBLANK_TIMER_FUNCS - Default implementation for VBLANK timers
|
|
*
|
|
* This macro initializes struct &drm_crtc_funcs to default helpers for
|
|
* VBLANK timers.
|
|
*/
|
|
#define DRM_CRTC_VBLANK_TIMER_FUNCS \
|
|
.enable_vblank = drm_crtc_vblank_helper_enable_vblank_timer, \
|
|
.disable_vblank = drm_crtc_vblank_helper_disable_vblank_timer, \
|
|
.get_vblank_timestamp = drm_crtc_vblank_helper_get_vblank_timestamp_from_timer
|
|
|
|
#endif
|