aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm/drm_crtc.h
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2016-06-13 05:11:26 -0400
committerBenjamin Gaignard <benjamin.gaignard@linaro.org>2016-07-29 03:59:30 -0400
commit44d1240d006c9cd0249263b5449c8e4752500f6a (patch)
tree7d4696d61dbeee0d4f653fbfbcec7f5d255a4e70 /include/drm/drm_crtc.h
parent62c2cd0f49333a2bb53602ec23039ca99a19cb9d (diff)
drm: add generic zpos property
version 8: - move drm_blend.o from drm-y to drm_kms_helper-y to avoid EXPORT_SYMBOL(drm_atomic_helper_normalize_zpos) - remove dead function declarations in drm_crtc.h version 7: - remove useless EXPORT_SYMBOL() - better z-order wording in Documentation version 6: - add zpos in gpu documentation file - merge Ville patch about zpos initial value and API improvement. I have split Ville patch between zpos core and drivers version 5: - remove zpos range check and comeback to 0 to N-1 normalization algorithm version 4: - make sure that normalized zpos value is stay in the defined property range and warn user if not This patch adds support for generic plane's zpos property property with well-defined semantics: - added zpos properties to plane and plane state structures - added helpers for normalizing zpos properties of given set of planes - well defined semantics: planes are sorted by zpos values and then plane id value if zpos equals Normalized zpos values are calculated automatically when generic muttable zpos property has been initialized. Drivers can simply use plane_state->normalized_zpos in their atomic_check and/or plane_update callbacks without any additional calls to DRM core. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Compare to Marek's original patch zpos property is now specific to each plane and no more to the core. Normalize function take care of the range of per plane defined range before set normalized_zpos. Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Inki Dae <inki.dae@samsung.com> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Ville Syrjala <ville.syrjala@linux.intel.com> Cc: Joonyoung Shim <jy0922.shim@samsung.com> Cc: Seung-Woo Kim <sw0312.kim@samsung.com> Cc: Andrzej Hajda <a.hajda@samsung.com> Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Cc: Gustavo Padovan <gustavo@padovan.org> Cc: vincent.abriou@st.com Cc: fabien.dessenne@st.com Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'include/drm/drm_crtc.h')
-rw-r--r--include/drm/drm_crtc.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 3edeaf88ebc0..44e070800b6d 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -308,6 +308,7 @@ struct drm_plane_helper_funcs;
308 * @mode_changed: crtc_state->mode or crtc_state->enable has been changed 308 * @mode_changed: crtc_state->mode or crtc_state->enable has been changed
309 * @active_changed: crtc_state->active has been toggled. 309 * @active_changed: crtc_state->active has been toggled.
310 * @connectors_changed: connectors to this crtc have been updated 310 * @connectors_changed: connectors to this crtc have been updated
311 * @zpos_changed: zpos values of planes on this crtc have been updated
311 * @color_mgmt_changed: color management properties have changed (degamma or 312 * @color_mgmt_changed: color management properties have changed (degamma or
312 * gamma LUT or CSC matrix) 313 * gamma LUT or CSC matrix)
313 * @plane_mask: bitmask of (1 << drm_plane_index(plane)) of attached planes 314 * @plane_mask: bitmask of (1 << drm_plane_index(plane)) of attached planes
@@ -344,6 +345,7 @@ struct drm_crtc_state {
344 bool mode_changed : 1; 345 bool mode_changed : 1;
345 bool active_changed : 1; 346 bool active_changed : 1;
346 bool connectors_changed : 1; 347 bool connectors_changed : 1;
348 bool zpos_changed : 1;
347 bool color_mgmt_changed : 1; 349 bool color_mgmt_changed : 1;
348 350
349 /* attached planes bitmask: 351 /* attached planes bitmask:
@@ -1409,6 +1411,9 @@ struct drm_connector {
1409 * @src_w: width of visible portion of plane (in 16.16) 1411 * @src_w: width of visible portion of plane (in 16.16)
1410 * @src_h: height of visible portion of plane (in 16.16) 1412 * @src_h: height of visible portion of plane (in 16.16)
1411 * @rotation: rotation of the plane 1413 * @rotation: rotation of the plane
1414 * @zpos: priority of the given plane on crtc (optional)
1415 * @normalized_zpos: normalized value of zpos: unique, range from 0 to N-1
1416 * where N is the number of active planes for given crtc
1412 * @state: backpointer to global drm_atomic_state 1417 * @state: backpointer to global drm_atomic_state
1413 */ 1418 */
1414struct drm_plane_state { 1419struct drm_plane_state {
@@ -1429,6 +1434,10 @@ struct drm_plane_state {
1429 /* Plane rotation */ 1434 /* Plane rotation */
1430 unsigned int rotation; 1435 unsigned int rotation;
1431 1436
1437 /* Plane zpos */
1438 unsigned int zpos;
1439 unsigned int normalized_zpos;
1440
1432 struct drm_atomic_state *state; 1441 struct drm_atomic_state *state;
1433}; 1442};
1434 1443
@@ -1688,6 +1697,7 @@ enum drm_plane_type {
1688 * @properties: property tracking for this plane 1697 * @properties: property tracking for this plane
1689 * @type: type of plane (overlay, primary, cursor) 1698 * @type: type of plane (overlay, primary, cursor)
1690 * @state: current atomic state for this plane 1699 * @state: current atomic state for this plane
1700 * @zpos_property: zpos property for this plane
1691 * @helper_private: mid-layer private data 1701 * @helper_private: mid-layer private data
1692 */ 1702 */
1693struct drm_plane { 1703struct drm_plane {
@@ -1732,6 +1742,8 @@ struct drm_plane {
1732 const struct drm_plane_helper_funcs *helper_private; 1742 const struct drm_plane_helper_funcs *helper_private;
1733 1743
1734 struct drm_plane_state *state; 1744 struct drm_plane_state *state;
1745
1746 struct drm_property *zpos_property;
1735}; 1747};
1736 1748
1737/** 1749/**
@@ -2958,6 +2970,14 @@ extern void drm_crtc_enable_color_mgmt(struct drm_crtc *crtc,
2958 uint degamma_lut_size, 2970 uint degamma_lut_size,
2959 bool has_ctm, 2971 bool has_ctm,
2960 uint gamma_lut_size); 2972 uint gamma_lut_size);
2973
2974int drm_plane_create_zpos_property(struct drm_plane *plane,
2975 unsigned int zpos,
2976 unsigned int min, unsigned int max);
2977
2978int drm_plane_create_zpos_immutable_property(struct drm_plane *plane,
2979 unsigned int zpos);
2980
2961/* Helpers */ 2981/* Helpers */
2962struct drm_mode_object *drm_mode_object_find(struct drm_device *dev, 2982struct drm_mode_object *drm_mode_object_find(struct drm_device *dev,
2963 uint32_t id, uint32_t type); 2983 uint32_t id, uint32_t type);