Commit 49efffc7 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Tomi Valkeinen

drm: Add drm_mode_config->normalize_zpos boolean

Instead of drivers duplicating the drm_atomic_helper_check() code to be
able to normalize the zpos they can use the normalize_zpos flag to let the
drm core to do it.
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180321102029.15248-2-peter.ujfalusi@ti.com
parent f4392860
...@@ -875,6 +875,11 @@ EXPORT_SYMBOL(drm_atomic_helper_check_planes); ...@@ -875,6 +875,11 @@ EXPORT_SYMBOL(drm_atomic_helper_check_planes);
* functions depend upon an updated adjusted_mode.clock to e.g. properly compute * functions depend upon an updated adjusted_mode.clock to e.g. properly compute
* watermarks. * watermarks.
* *
* Note that zpos normalization will add all enable planes to the state which
* might not desired for some drivers.
* For example enable/disable of a cursor plane which have fixed zpos value
* would trigger all other enabled planes to be forced to the state change.
*
* RETURNS: * RETURNS:
* Zero for success or -errno * Zero for success or -errno
*/ */
...@@ -887,6 +892,12 @@ int drm_atomic_helper_check(struct drm_device *dev, ...@@ -887,6 +892,12 @@ int drm_atomic_helper_check(struct drm_device *dev,
if (ret) if (ret)
return ret; return ret;
if (dev->mode_config.normalize_zpos) {
ret = drm_atomic_normalize_zpos(dev, state);
if (ret)
return ret;
}
ret = drm_atomic_helper_check_planes(dev, state); ret = drm_atomic_helper_check_planes(dev, state);
if (ret) if (ret)
return ret; return ret;
......
...@@ -795,6 +795,14 @@ struct drm_mode_config { ...@@ -795,6 +795,14 @@ struct drm_mode_config {
*/ */
bool allow_fb_modifiers; bool allow_fb_modifiers;
/**
* @normalize_zpos:
*
* If true the drm core will call drm_atomic_normalize_zpos() as part of
* atomic mode checking from drm_atomic_helper_check()
*/
bool normalize_zpos;
/** /**
* @modifiers_property: Plane property to list support modifier/format * @modifiers_property: Plane property to list support modifier/format
* combination. * combination.
......
...@@ -51,8 +51,8 @@ struct drm_modeset_acquire_ctx; ...@@ -51,8 +51,8 @@ struct drm_modeset_acquire_ctx;
* plane with a lower ID. * plane with a lower ID.
* @normalized_zpos: normalized value of zpos: unique, range from 0 to N-1 * @normalized_zpos: normalized value of zpos: unique, range from 0 to N-1
* where N is the number of active planes for given crtc. Note that * where N is the number of active planes for given crtc. Note that
* the driver must call drm_atomic_normalize_zpos() to update this before * the driver must set drm_mode_config.normalize_zpos or call
* it can be trusted. * drm_atomic_normalize_zpos() to update this before it can be trusted.
* @src: clipped source coordinates of the plane (in 16.16) * @src: clipped source coordinates of the plane (in 16.16)
* @dst: clipped destination coordinates of the plane * @dst: clipped destination coordinates of the plane
* @state: backpointer to global drm_atomic_state * @state: backpointer to global drm_atomic_state
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment