@@ -139,9 +139,9 @@ static void exynos_drm_plane_reset(struct drm_plane *plane)
139
139
140
140
exynos_state = kzalloc (sizeof (* exynos_state ), GFP_KERNEL );
141
141
if (exynos_state ) {
142
- exynos_state -> zpos = exynos_plane -> config -> zpos ;
143
142
plane -> state = & exynos_state -> base ;
144
143
plane -> state -> plane = plane ;
144
+ plane -> state -> zpos = exynos_plane -> config -> zpos ;
145
145
}
146
146
}
147
147
@@ -157,7 +157,6 @@ exynos_drm_plane_duplicate_state(struct drm_plane *plane)
157
157
return NULL ;
158
158
159
159
__drm_atomic_helper_plane_duplicate_state (plane , & copy -> base );
160
- copy -> zpos = exynos_state -> zpos ;
161
160
return & copy -> base ;
162
161
}
163
162
@@ -170,43 +169,6 @@ static void exynos_drm_plane_destroy_state(struct drm_plane *plane,
170
169
kfree (old_exynos_state );
171
170
}
172
171
173
- static int exynos_drm_plane_atomic_set_property (struct drm_plane * plane ,
174
- struct drm_plane_state * state ,
175
- struct drm_property * property ,
176
- uint64_t val )
177
- {
178
- struct exynos_drm_plane * exynos_plane = to_exynos_plane (plane );
179
- struct exynos_drm_plane_state * exynos_state =
180
- to_exynos_plane_state (state );
181
- struct exynos_drm_private * dev_priv = plane -> dev -> dev_private ;
182
- const struct exynos_drm_plane_config * config = exynos_plane -> config ;
183
-
184
- if (property == dev_priv -> plane_zpos_property &&
185
- (config -> capabilities & EXYNOS_DRM_PLANE_CAP_ZPOS ))
186
- exynos_state -> zpos = val ;
187
- else
188
- return - EINVAL ;
189
-
190
- return 0 ;
191
- }
192
-
193
- static int exynos_drm_plane_atomic_get_property (struct drm_plane * plane ,
194
- const struct drm_plane_state * state ,
195
- struct drm_property * property ,
196
- uint64_t * val )
197
- {
198
- const struct exynos_drm_plane_state * exynos_state =
199
- container_of (state , const struct exynos_drm_plane_state , base );
200
- struct exynos_drm_private * dev_priv = plane -> dev -> dev_private ;
201
-
202
- if (property == dev_priv -> plane_zpos_property )
203
- * val = exynos_state -> zpos ;
204
- else
205
- return - EINVAL ;
206
-
207
- return 0 ;
208
- }
209
-
210
172
static struct drm_plane_funcs exynos_plane_funcs = {
211
173
.update_plane = drm_atomic_helper_update_plane ,
212
174
.disable_plane = drm_atomic_helper_disable_plane ,
@@ -215,8 +177,6 @@ static struct drm_plane_funcs exynos_plane_funcs = {
215
177
.reset = exynos_drm_plane_reset ,
216
178
.atomic_duplicate_state = exynos_drm_plane_duplicate_state ,
217
179
.atomic_destroy_state = exynos_drm_plane_destroy_state ,
218
- .atomic_set_property = exynos_drm_plane_atomic_set_property ,
219
- .atomic_get_property = exynos_drm_plane_atomic_get_property ,
220
180
};
221
181
222
182
static int
@@ -304,23 +264,13 @@ static const struct drm_plane_helper_funcs plane_helper_funcs = {
304
264
};
305
265
306
266
static void exynos_plane_attach_zpos_property (struct drm_plane * plane ,
307
- unsigned int zpos )
267
+ bool immutable )
308
268
{
309
- struct drm_device * dev = plane -> dev ;
310
- struct exynos_drm_private * dev_priv = dev -> dev_private ;
311
- struct drm_property * prop ;
312
-
313
- prop = dev_priv -> plane_zpos_property ;
314
- if (!prop ) {
315
- prop = drm_property_create_range (dev , 0 , "zpos" ,
316
- 0 , MAX_PLANE - 1 );
317
- if (!prop )
318
- return ;
319
-
320
- dev_priv -> plane_zpos_property = prop ;
321
- }
322
-
323
- drm_object_attach_property (& plane -> base , prop , zpos );
269
+ /* FIXME */
270
+ if (immutable )
271
+ drm_plane_create_zpos_immutable_property (plane , 0 );
272
+ else
273
+ drm_plane_create_zpos_property (plane , 0 , 0 , MAX_PLANE - 1 );
324
274
}
325
275
326
276
int exynos_plane_init (struct drm_device * dev ,
@@ -346,7 +296,8 @@ int exynos_plane_init(struct drm_device *dev,
346
296
exynos_plane -> index = index ;
347
297
exynos_plane -> config = config ;
348
298
349
- exynos_plane_attach_zpos_property (& exynos_plane -> base , config -> zpos );
299
+ exynos_plane_attach_zpos_property (& exynos_plane -> base ,
300
+ !(config -> capabilities & EXYNOS_DRM_PLANE_CAP_ZPOS ));
350
301
351
302
return 0 ;
352
303
}
0 commit comments