diff options
author | Dave Airlie <airlied@redhat.com> | 2015-01-27 18:34:27 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2015-01-27 18:34:27 -0500 |
commit | 21773f16f2cb3c056051c679da542f0b494252e2 (patch) | |
tree | 362e701c962f8a78978775ff3e4093b490ee0cd1 /include/drm | |
parent | 2f5b4ef15c60bc5292a3f006c018acb3da53737b (diff) | |
parent | 9469244d869623e8b54d9f3d4d00737e377af273 (diff) |
Merge tag 'topic/atomic-core-2015-01-27' of git://anongit.freedesktop.org/drm-intel into drm-next
* tag 'topic/atomic-core-2015-01-27' of git://anongit.freedesktop.org/drm-intel:
drm/atomic: Fix potential use of state after free
drm/atomic-helper: debug output for modesets
drm/atomic-helpers: Saner encoder/crtc callbacks
drm/atomic-helpers: Recover full cursor plane behaviour
drm/atomic-helper: add connector->dpms() implementation
drm/atomic: Add drm_crtc_state->active
drm: Add standardized boolean props
drm/plane-helper: Fix transitional helper kerneldocs
drm/plane-helper: Skip prepare_fb/cleanup_fb when newfb==oldfb
Conflicts:
include/drm/drm_crtc_helper.h
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drm_atomic_helper.h | 2 | ||||
-rw-r--r-- | include/drm/drm_crtc.h | 7 | ||||
-rw-r--r-- | include/drm/drm_crtc_helper.h | 21 |
3 files changed, 28 insertions, 2 deletions
diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h index a0ea4ded3cb5..8039d54a7441 100644 --- a/include/drm/drm_atomic_helper.h +++ b/include/drm/drm_atomic_helper.h | |||
@@ -82,6 +82,8 @@ int drm_atomic_helper_page_flip(struct drm_crtc *crtc, | |||
82 | struct drm_framebuffer *fb, | 82 | struct drm_framebuffer *fb, |
83 | struct drm_pending_vblank_event *event, | 83 | struct drm_pending_vblank_event *event, |
84 | uint32_t flags); | 84 | uint32_t flags); |
85 | void drm_atomic_helper_connector_dpms(struct drm_connector *connector, | ||
86 | int mode); | ||
85 | 87 | ||
86 | /* default implementations for state handling */ | 88 | /* default implementations for state handling */ |
87 | void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc); | 89 | void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc); |
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 0ebd9286b332..02614170c034 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
@@ -253,6 +253,7 @@ struct drm_atomic_state; | |||
253 | * @enable: whether the CRTC should be enabled, gates all other state | 253 | * @enable: whether the CRTC should be enabled, gates all other state |
254 | * @active: whether the CRTC is actively displaying (used for DPMS) | 254 | * @active: whether the CRTC is actively displaying (used for DPMS) |
255 | * @mode_changed: for use by helpers and drivers when computing state updates | 255 | * @mode_changed: for use by helpers and drivers when computing state updates |
256 | * @active_changed: for use by helpers and drivers when computing state updates | ||
256 | * @plane_mask: bitmask of (1 << drm_plane_index(plane)) of attached planes | 257 | * @plane_mask: bitmask of (1 << drm_plane_index(plane)) of attached planes |
257 | * @last_vblank_count: for helpers and drivers to capture the vblank of the | 258 | * @last_vblank_count: for helpers and drivers to capture the vblank of the |
258 | * update to ensure framebuffer cleanup isn't done too early | 259 | * update to ensure framebuffer cleanup isn't done too early |
@@ -278,6 +279,7 @@ struct drm_crtc_state { | |||
278 | /* computed state bits used by helpers and drivers */ | 279 | /* computed state bits used by helpers and drivers */ |
279 | bool planes_changed : 1; | 280 | bool planes_changed : 1; |
280 | bool mode_changed : 1; | 281 | bool mode_changed : 1; |
282 | bool active_changed : 1; | ||
281 | 283 | ||
282 | /* attached planes bitmask: | 284 | /* attached planes bitmask: |
283 | * WARNING: transitional helpers do not maintain plane_mask so | 285 | * WARNING: transitional helpers do not maintain plane_mask so |
@@ -910,6 +912,7 @@ struct drm_bridge { | |||
910 | * struct struct drm_atomic_state - the global state object for atomic updates | 912 | * struct struct drm_atomic_state - the global state object for atomic updates |
911 | * @dev: parent DRM device | 913 | * @dev: parent DRM device |
912 | * @allow_modeset: allow full modeset | 914 | * @allow_modeset: allow full modeset |
915 | * @legacy_cursor_update: hint to enforce legacy cursor ioctl semantics | ||
913 | * @planes: pointer to array of plane pointers | 916 | * @planes: pointer to array of plane pointers |
914 | * @plane_states: pointer to array of plane states pointers | 917 | * @plane_states: pointer to array of plane states pointers |
915 | * @crtcs: pointer to array of CRTC pointers | 918 | * @crtcs: pointer to array of CRTC pointers |
@@ -922,6 +925,7 @@ struct drm_bridge { | |||
922 | struct drm_atomic_state { | 925 | struct drm_atomic_state { |
923 | struct drm_device *dev; | 926 | struct drm_device *dev; |
924 | bool allow_modeset : 1; | 927 | bool allow_modeset : 1; |
928 | bool legacy_cursor_update : 1; | ||
925 | struct drm_plane **planes; | 929 | struct drm_plane **planes; |
926 | struct drm_plane_state **plane_states; | 930 | struct drm_plane_state **plane_states; |
927 | struct drm_crtc **crtcs; | 931 | struct drm_crtc **crtcs; |
@@ -1117,6 +1121,7 @@ struct drm_mode_config { | |||
1117 | struct drm_property *prop_crtc_h; | 1121 | struct drm_property *prop_crtc_h; |
1118 | struct drm_property *prop_fb_id; | 1122 | struct drm_property *prop_fb_id; |
1119 | struct drm_property *prop_crtc_id; | 1123 | struct drm_property *prop_crtc_id; |
1124 | struct drm_property *prop_active; | ||
1120 | 1125 | ||
1121 | /* DVI-I properties */ | 1126 | /* DVI-I properties */ |
1122 | struct drm_property *dvi_i_subconnector_property; | 1127 | struct drm_property *dvi_i_subconnector_property; |
@@ -1349,6 +1354,8 @@ struct drm_property *drm_property_create_signed_range(struct drm_device *dev, | |||
1349 | int64_t min, int64_t max); | 1354 | int64_t min, int64_t max); |
1350 | struct drm_property *drm_property_create_object(struct drm_device *dev, | 1355 | struct drm_property *drm_property_create_object(struct drm_device *dev, |
1351 | int flags, const char *name, uint32_t type); | 1356 | int flags, const char *name, uint32_t type); |
1357 | struct drm_property *drm_property_create_bool(struct drm_device *dev, int flags, | ||
1358 | const char *name); | ||
1352 | extern void drm_property_destroy(struct drm_device *dev, struct drm_property *property); | 1359 | extern void drm_property_destroy(struct drm_device *dev, struct drm_property *property); |
1353 | extern int drm_property_add_enum(struct drm_property *property, int index, | 1360 | extern int drm_property_add_enum(struct drm_property *property, int index, |
1354 | uint64_t value, const char *name); | 1361 | uint64_t value, const char *name); |
diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h index 5810c027acdc..c250a22b39ab 100644 --- a/include/drm/drm_crtc_helper.h +++ b/include/drm/drm_crtc_helper.h | |||
@@ -58,11 +58,19 @@ enum mode_set_atomic { | |||
58 | * @mode_set_base_atomic: non-blocking mode set (used for kgdb support) | 58 | * @mode_set_base_atomic: non-blocking mode set (used for kgdb support) |
59 | * @load_lut: load color palette | 59 | * @load_lut: load color palette |
60 | * @disable: disable CRTC when no longer in use | 60 | * @disable: disable CRTC when no longer in use |
61 | * @enable: enable CRTC | ||
61 | * @atomic_check: check for validity of an atomic state | 62 | * @atomic_check: check for validity of an atomic state |
62 | * @atomic_begin: begin atomic update | 63 | * @atomic_begin: begin atomic update |
63 | * @atomic_flush: flush atomic update | 64 | * @atomic_flush: flush atomic update |
64 | * | 65 | * |
65 | * The helper operations are called by the mid-layer CRTC helper. | 66 | * The helper operations are called by the mid-layer CRTC helper. |
67 | * | ||
68 | * Note that with atomic helpers @dpms, @prepare and @commit hooks are | ||
69 | * deprecated. Used @enable and @disable instead exclusively. | ||
70 | * | ||
71 | * With legacy crtc helpers there's a big semantic difference between @disable | ||
72 | * and the other hooks: @disable also needs to release any resources acquired in | ||
73 | * @mode_set (like shared PLLs). | ||
66 | */ | 74 | */ |
67 | struct drm_crtc_helper_funcs { | 75 | struct drm_crtc_helper_funcs { |
68 | /* | 76 | /* |
@@ -93,8 +101,8 @@ struct drm_crtc_helper_funcs { | |||
93 | /* reload the current crtc LUT */ | 101 | /* reload the current crtc LUT */ |
94 | void (*load_lut)(struct drm_crtc *crtc); | 102 | void (*load_lut)(struct drm_crtc *crtc); |
95 | 103 | ||
96 | /* disable crtc when not in use - more explicit than dpms off */ | ||
97 | void (*disable)(struct drm_crtc *crtc); | 104 | void (*disable)(struct drm_crtc *crtc); |
105 | void (*enable)(struct drm_crtc *crtc); | ||
98 | 106 | ||
99 | /* atomic helpers */ | 107 | /* atomic helpers */ |
100 | int (*atomic_check)(struct drm_crtc *crtc, | 108 | int (*atomic_check)(struct drm_crtc *crtc, |
@@ -115,9 +123,17 @@ struct drm_crtc_helper_funcs { | |||
115 | * @get_crtc: return CRTC that the encoder is currently attached to | 123 | * @get_crtc: return CRTC that the encoder is currently attached to |
116 | * @detect: connection status detection | 124 | * @detect: connection status detection |
117 | * @disable: disable encoder when not in use (overrides DPMS off) | 125 | * @disable: disable encoder when not in use (overrides DPMS off) |
126 | * @enable: enable encoder | ||
118 | * @atomic_check: check for validity of an atomic update | 127 | * @atomic_check: check for validity of an atomic update |
119 | * | 128 | * |
120 | * The helper operations are called by the mid-layer CRTC helper. | 129 | * The helper operations are called by the mid-layer CRTC helper. |
130 | * | ||
131 | * Note that with atomic helpers @dpms, @prepare and @commit hooks are | ||
132 | * deprecated. Used @enable and @disable instead exclusively. | ||
133 | * | ||
134 | * With legacy crtc helpers there's a big semantic difference between @disable | ||
135 | * and the other hooks: @disable also needs to release any resources acquired in | ||
136 | * @mode_set (like shared PLLs). | ||
121 | */ | 137 | */ |
122 | struct drm_encoder_helper_funcs { | 138 | struct drm_encoder_helper_funcs { |
123 | void (*dpms)(struct drm_encoder *encoder, int mode); | 139 | void (*dpms)(struct drm_encoder *encoder, int mode); |
@@ -136,9 +152,10 @@ struct drm_encoder_helper_funcs { | |||
136 | /* detect for DAC style encoders */ | 152 | /* detect for DAC style encoders */ |
137 | enum drm_connector_status (*detect)(struct drm_encoder *encoder, | 153 | enum drm_connector_status (*detect)(struct drm_encoder *encoder, |
138 | struct drm_connector *connector); | 154 | struct drm_connector *connector); |
139 | /* disable encoder when not in use - more explicit than dpms off */ | ||
140 | void (*disable)(struct drm_encoder *encoder); | 155 | void (*disable)(struct drm_encoder *encoder); |
141 | 156 | ||
157 | void (*enable)(struct drm_encoder *encoder); | ||
158 | |||
142 | /* atomic helpers */ | 159 | /* atomic helpers */ |
143 | int (*atomic_check)(struct drm_encoder *encoder, | 160 | int (*atomic_check)(struct drm_encoder *encoder, |
144 | struct drm_crtc_state *crtc_state, | 161 | struct drm_crtc_state *crtc_state, |