drm/atomic: convert drm_atomic_get_{old, new}_colorop_state() into proper functions

There is no real reason to include drm_colorop.h from drm_atomic.h, as
drm_atomic_get_{old,new}_colorop_state() have no real reason to be
static inline.

Convert the static inlines to proper functions, and drop the include to
reduce the include dependencies and improve data hiding.

v2: Fix vkms build failures (Alex)

Fixes: cfc27680ee ("drm/colorop: Introduce new drm_colorop mode object")
Cc: Simon Ser <contact@emersion.fr>
Cc: Alex Hung <alex.hung@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Daniel Stone <daniels@collabora.com>
Cc: Melissa Wen <mwen@igalia.com>
Cc: Sebastian Wick <sebastian.wick@redhat.com>
Cc: Alex Hung <alex.hung@amd.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Link: https://patch.msgid.link/20251219114939.1069851-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
Jani Nikula
2025-12-19 13:49:39 +02:00
parent 50c26c301c
commit e05b08d7d0
7 changed files with 47 additions and 31 deletions

View File

@@ -641,6 +641,38 @@ drm_atomic_get_colorop_state(struct drm_atomic_state *state,
}
EXPORT_SYMBOL(drm_atomic_get_colorop_state);
/**
* drm_atomic_get_old_colorop_state - get colorop state, if it exists
* @state: global atomic state object
* @colorop: colorop to grab
*
* This function returns the old colorop state for the given colorop, or
* NULL if the colorop is not part of the global atomic state.
*/
struct drm_colorop_state *
drm_atomic_get_old_colorop_state(struct drm_atomic_state *state,
struct drm_colorop *colorop)
{
return state->colorops[drm_colorop_index(colorop)].old_state;
}
EXPORT_SYMBOL(drm_atomic_get_old_colorop_state);
/**
* drm_atomic_get_new_colorop_state - get colorop state, if it exists
* @state: global atomic state object
* @colorop: colorop to grab
*
* This function returns the new colorop state for the given colorop, or
* NULL if the colorop is not part of the global atomic state.
*/
struct drm_colorop_state *
drm_atomic_get_new_colorop_state(struct drm_atomic_state *state,
struct drm_colorop *colorop)
{
return state->colorops[drm_colorop_index(colorop)].new_state;
}
EXPORT_SYMBOL(drm_atomic_get_new_colorop_state);
static bool
plane_switching_crtc(const struct drm_plane_state *old_plane_state,
const struct drm_plane_state *new_plane_state)