]> Git Repo - linux.git/blob - drivers/gpu/drm/drm_plane.c
drm/doc: render drm.h uapi docs
[linux.git] / drivers / gpu / drm / drm_plane.c
1 /*
2  * Copyright (c) 2016 Intel Corporation
3  *
4  * Permission to use, copy, modify, distribute, and sell this software and its
5  * documentation for any purpose is hereby granted without fee, provided that
6  * the above copyright notice appear in all copies and that both that copyright
7  * notice and this permission notice appear in supporting documentation, and
8  * that the name of the copyright holders not be used in advertising or
9  * publicity pertaining to distribution of the software without specific,
10  * written prior permission.  The copyright holders make no representations
11  * about the suitability of this software for any purpose.  It is provided "as
12  * is" without express or implied warranty.
13  *
14  * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16  * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
20  * OF THIS SOFTWARE.
21  */
22
23 #include <linux/slab.h>
24 #include <linux/uaccess.h>
25
26 #include <drm/drm_plane.h>
27 #include <drm/drm_drv.h>
28 #include <drm/drm_print.h>
29 #include <drm/drm_framebuffer.h>
30 #include <drm/drm_file.h>
31 #include <drm/drm_crtc.h>
32 #include <drm/drm_fourcc.h>
33 #include <drm/drm_vblank.h>
34
35 #include "drm_crtc_internal.h"
36
37 /**
38  * DOC: overview
39  *
40  * A plane represents an image source that can be blended with or overlayed on
41  * top of a CRTC during the scanout process. Planes take their input data from a
42  * &drm_framebuffer object. The plane itself specifies the cropping and scaling
43  * of that image, and where it is placed on the visible area of a display
44  * pipeline, represented by &drm_crtc. A plane can also have additional
45  * properties that specify how the pixels are positioned and blended, like
46  * rotation or Z-position. All these properties are stored in &drm_plane_state.
47  *
48  * To create a plane, a KMS drivers allocates and zeroes an instances of
49  * &struct drm_plane (possibly as part of a larger structure) and registers it
50  * with a call to drm_universal_plane_init().
51  *
52  * The type of a plane is exposed in the immutable "type" enumeration property,
53  * which has one of the following values: "Overlay", "Primary", "Cursor" (see
54  * enum drm_plane_type). A plane can be compatible with multiple CRTCs, see
55  * &drm_plane.possible_crtcs.
56  *
57  * Each CRTC must have a unique primary plane userspace can attach to enable
58  * the CRTC. In other words, userspace must be able to attach a different
59  * primary plane to each CRTC at the same time. Primary planes can still be
60  * compatible with multiple CRTCs. There must be exactly as many primary planes
61  * as there are CRTCs.
62  *
63  * Legacy uAPI doesn't expose the primary and cursor planes directly. DRM core
64  * relies on the driver to set the primary and optionally the cursor plane used
65  * for legacy IOCTLs. This is done by calling drm_crtc_init_with_planes(). All
66  * drivers must provide one primary plane per CRTC to avoid surprising legacy
67  * userspace too much.
68  */
69
70 /**
71  * DOC: standard plane properties
72  *
73  * DRM planes have a few standardized properties:
74  *
75  * IN_FORMATS:
76  *     Blob property which contains the set of buffer format and modifier
77  *     pairs supported by this plane. The blob is a struct
78  *     drm_format_modifier_blob. Without this property the plane doesn't
79  *     support buffers with modifiers. Userspace cannot change this property.
80  */
81
82 static unsigned int drm_num_planes(struct drm_device *dev)
83 {
84         unsigned int num = 0;
85         struct drm_plane *tmp;
86
87         drm_for_each_plane(tmp, dev) {
88                 num++;
89         }
90
91         return num;
92 }
93
94 static inline u32 *
95 formats_ptr(struct drm_format_modifier_blob *blob)
96 {
97         return (u32 *)(((char *)blob) + blob->formats_offset);
98 }
99
100 static inline struct drm_format_modifier *
101 modifiers_ptr(struct drm_format_modifier_blob *blob)
102 {
103         return (struct drm_format_modifier *)(((char *)blob) + blob->modifiers_offset);
104 }
105
106 static int create_in_format_blob(struct drm_device *dev, struct drm_plane *plane)
107 {
108         const struct drm_mode_config *config = &dev->mode_config;
109         struct drm_property_blob *blob;
110         struct drm_format_modifier *mod;
111         size_t blob_size, formats_size, modifiers_size;
112         struct drm_format_modifier_blob *blob_data;
113         unsigned int i, j;
114
115         formats_size = sizeof(__u32) * plane->format_count;
116         if (WARN_ON(!formats_size)) {
117                 /* 0 formats are never expected */
118                 return 0;
119         }
120
121         modifiers_size =
122                 sizeof(struct drm_format_modifier) * plane->modifier_count;
123
124         blob_size = sizeof(struct drm_format_modifier_blob);
125         /* Modifiers offset is a pointer to a struct with a 64 bit field so it
126          * should be naturally aligned to 8B.
127          */
128         BUILD_BUG_ON(sizeof(struct drm_format_modifier_blob) % 8);
129         blob_size += ALIGN(formats_size, 8);
130         blob_size += modifiers_size;
131
132         blob = drm_property_create_blob(dev, blob_size, NULL);
133         if (IS_ERR(blob))
134                 return -1;
135
136         blob_data = blob->data;
137         blob_data->version = FORMAT_BLOB_CURRENT;
138         blob_data->count_formats = plane->format_count;
139         blob_data->formats_offset = sizeof(struct drm_format_modifier_blob);
140         blob_data->count_modifiers = plane->modifier_count;
141
142         blob_data->modifiers_offset =
143                 ALIGN(blob_data->formats_offset + formats_size, 8);
144
145         memcpy(formats_ptr(blob_data), plane->format_types, formats_size);
146
147         /* If we can't determine support, just bail */
148         if (!plane->funcs->format_mod_supported)
149                 goto done;
150
151         mod = modifiers_ptr(blob_data);
152         for (i = 0; i < plane->modifier_count; i++) {
153                 for (j = 0; j < plane->format_count; j++) {
154                         if (plane->funcs->format_mod_supported(plane,
155                                                                plane->format_types[j],
156                                                                plane->modifiers[i])) {
157
158                                 mod->formats |= 1ULL << j;
159                         }
160                 }
161
162                 mod->modifier = plane->modifiers[i];
163                 mod->offset = 0;
164                 mod->pad = 0;
165                 mod++;
166         }
167
168 done:
169         drm_object_attach_property(&plane->base, config->modifiers_property,
170                                    blob->base.id);
171
172         return 0;
173 }
174
175 /**
176  * drm_universal_plane_init - Initialize a new universal plane object
177  * @dev: DRM device
178  * @plane: plane object to init
179  * @possible_crtcs: bitmask of possible CRTCs
180  * @funcs: callbacks for the new plane
181  * @formats: array of supported formats (DRM_FORMAT\_\*)
182  * @format_count: number of elements in @formats
183  * @format_modifiers: array of struct drm_format modifiers terminated by
184  *                    DRM_FORMAT_MOD_INVALID
185  * @type: type of plane (overlay, primary, cursor)
186  * @name: printf style format string for the plane name, or NULL for default name
187  *
188  * Initializes a plane object of type @type.
189  *
190  * Returns:
191  * Zero on success, error code on failure.
192  */
193 int drm_universal_plane_init(struct drm_device *dev, struct drm_plane *plane,
194                              uint32_t possible_crtcs,
195                              const struct drm_plane_funcs *funcs,
196                              const uint32_t *formats, unsigned int format_count,
197                              const uint64_t *format_modifiers,
198                              enum drm_plane_type type,
199                              const char *name, ...)
200 {
201         struct drm_mode_config *config = &dev->mode_config;
202         unsigned int format_modifier_count = 0;
203         int ret;
204
205         /* plane index is used with 32bit bitmasks */
206         if (WARN_ON(config->num_total_plane >= 32))
207                 return -EINVAL;
208
209         WARN_ON(drm_drv_uses_atomic_modeset(dev) &&
210                 (!funcs->atomic_destroy_state ||
211                  !funcs->atomic_duplicate_state));
212
213         ret = drm_mode_object_add(dev, &plane->base, DRM_MODE_OBJECT_PLANE);
214         if (ret)
215                 return ret;
216
217         drm_modeset_lock_init(&plane->mutex);
218
219         plane->base.properties = &plane->properties;
220         plane->dev = dev;
221         plane->funcs = funcs;
222         plane->format_types = kmalloc_array(format_count, sizeof(uint32_t),
223                                             GFP_KERNEL);
224         if (!plane->format_types) {
225                 DRM_DEBUG_KMS("out of memory when allocating plane\n");
226                 drm_mode_object_unregister(dev, &plane->base);
227                 return -ENOMEM;
228         }
229
230         /*
231          * First driver to need more than 64 formats needs to fix this. Each
232          * format is encoded as a bit and the current code only supports a u64.
233          */
234         if (WARN_ON(format_count > 64))
235                 return -EINVAL;
236
237         if (format_modifiers) {
238                 const uint64_t *temp_modifiers = format_modifiers;
239
240                 while (*temp_modifiers++ != DRM_FORMAT_MOD_INVALID)
241                         format_modifier_count++;
242         }
243
244         if (format_modifier_count)
245                 config->allow_fb_modifiers = true;
246
247         plane->modifier_count = format_modifier_count;
248         plane->modifiers = kmalloc_array(format_modifier_count,
249                                          sizeof(format_modifiers[0]),
250                                          GFP_KERNEL);
251
252         if (format_modifier_count && !plane->modifiers) {
253                 DRM_DEBUG_KMS("out of memory when allocating plane\n");
254                 kfree(plane->format_types);
255                 drm_mode_object_unregister(dev, &plane->base);
256                 return -ENOMEM;
257         }
258
259         if (name) {
260                 va_list ap;
261
262                 va_start(ap, name);
263                 plane->name = kvasprintf(GFP_KERNEL, name, ap);
264                 va_end(ap);
265         } else {
266                 plane->name = kasprintf(GFP_KERNEL, "plane-%d",
267                                         drm_num_planes(dev));
268         }
269         if (!plane->name) {
270                 kfree(plane->format_types);
271                 kfree(plane->modifiers);
272                 drm_mode_object_unregister(dev, &plane->base);
273                 return -ENOMEM;
274         }
275
276         memcpy(plane->format_types, formats, format_count * sizeof(uint32_t));
277         plane->format_count = format_count;
278         memcpy(plane->modifiers, format_modifiers,
279                format_modifier_count * sizeof(format_modifiers[0]));
280         plane->possible_crtcs = possible_crtcs;
281         plane->type = type;
282
283         list_add_tail(&plane->head, &config->plane_list);
284         plane->index = config->num_total_plane++;
285
286         drm_object_attach_property(&plane->base,
287                                    config->plane_type_property,
288                                    plane->type);
289
290         if (drm_core_check_feature(dev, DRIVER_ATOMIC)) {
291                 drm_object_attach_property(&plane->base, config->prop_fb_id, 0);
292                 drm_object_attach_property(&plane->base, config->prop_in_fence_fd, -1);
293                 drm_object_attach_property(&plane->base, config->prop_crtc_id, 0);
294                 drm_object_attach_property(&plane->base, config->prop_crtc_x, 0);
295                 drm_object_attach_property(&plane->base, config->prop_crtc_y, 0);
296                 drm_object_attach_property(&plane->base, config->prop_crtc_w, 0);
297                 drm_object_attach_property(&plane->base, config->prop_crtc_h, 0);
298                 drm_object_attach_property(&plane->base, config->prop_src_x, 0);
299                 drm_object_attach_property(&plane->base, config->prop_src_y, 0);
300                 drm_object_attach_property(&plane->base, config->prop_src_w, 0);
301                 drm_object_attach_property(&plane->base, config->prop_src_h, 0);
302         }
303
304         if (config->allow_fb_modifiers)
305                 create_in_format_blob(dev, plane);
306
307         return 0;
308 }
309 EXPORT_SYMBOL(drm_universal_plane_init);
310
311 int drm_plane_register_all(struct drm_device *dev)
312 {
313         unsigned int num_planes = 0;
314         unsigned int num_zpos = 0;
315         struct drm_plane *plane;
316         int ret = 0;
317
318         drm_for_each_plane(plane, dev) {
319                 if (plane->funcs->late_register)
320                         ret = plane->funcs->late_register(plane);
321                 if (ret)
322                         return ret;
323
324                 if (plane->zpos_property)
325                         num_zpos++;
326                 num_planes++;
327         }
328
329         drm_WARN(dev, num_zpos && num_planes != num_zpos,
330                  "Mixing planes with and without zpos property is invalid\n");
331
332         return 0;
333 }
334
335 void drm_plane_unregister_all(struct drm_device *dev)
336 {
337         struct drm_plane *plane;
338
339         drm_for_each_plane(plane, dev) {
340                 if (plane->funcs->early_unregister)
341                         plane->funcs->early_unregister(plane);
342         }
343 }
344
345 /**
346  * drm_plane_init - Initialize a legacy plane
347  * @dev: DRM device
348  * @plane: plane object to init
349  * @possible_crtcs: bitmask of possible CRTCs
350  * @funcs: callbacks for the new plane
351  * @formats: array of supported formats (DRM_FORMAT\_\*)
352  * @format_count: number of elements in @formats
353  * @is_primary: plane type (primary vs overlay)
354  *
355  * Legacy API to initialize a DRM plane.
356  *
357  * New drivers should call drm_universal_plane_init() instead.
358  *
359  * Returns:
360  * Zero on success, error code on failure.
361  */
362 int drm_plane_init(struct drm_device *dev, struct drm_plane *plane,
363                    uint32_t possible_crtcs,
364                    const struct drm_plane_funcs *funcs,
365                    const uint32_t *formats, unsigned int format_count,
366                    bool is_primary)
367 {
368         enum drm_plane_type type;
369
370         type = is_primary ? DRM_PLANE_TYPE_PRIMARY : DRM_PLANE_TYPE_OVERLAY;
371         return drm_universal_plane_init(dev, plane, possible_crtcs, funcs,
372                                         formats, format_count,
373                                         NULL, type, NULL);
374 }
375 EXPORT_SYMBOL(drm_plane_init);
376
377 /**
378  * drm_plane_cleanup - Clean up the core plane usage
379  * @plane: plane to cleanup
380  *
381  * This function cleans up @plane and removes it from the DRM mode setting
382  * core. Note that the function does *not* free the plane structure itself,
383  * this is the responsibility of the caller.
384  */
385 void drm_plane_cleanup(struct drm_plane *plane)
386 {
387         struct drm_device *dev = plane->dev;
388
389         drm_modeset_lock_fini(&plane->mutex);
390
391         kfree(plane->format_types);
392         kfree(plane->modifiers);
393         drm_mode_object_unregister(dev, &plane->base);
394
395         BUG_ON(list_empty(&plane->head));
396
397         /* Note that the plane_list is considered to be static; should we
398          * remove the drm_plane at runtime we would have to decrement all
399          * the indices on the drm_plane after us in the plane_list.
400          */
401
402         list_del(&plane->head);
403         dev->mode_config.num_total_plane--;
404
405         WARN_ON(plane->state && !plane->funcs->atomic_destroy_state);
406         if (plane->state && plane->funcs->atomic_destroy_state)
407                 plane->funcs->atomic_destroy_state(plane, plane->state);
408
409         kfree(plane->name);
410
411         memset(plane, 0, sizeof(*plane));
412 }
413 EXPORT_SYMBOL(drm_plane_cleanup);
414
415 /**
416  * drm_plane_from_index - find the registered plane at an index
417  * @dev: DRM device
418  * @idx: index of registered plane to find for
419  *
420  * Given a plane index, return the registered plane from DRM device's
421  * list of planes with matching index. This is the inverse of drm_plane_index().
422  */
423 struct drm_plane *
424 drm_plane_from_index(struct drm_device *dev, int idx)
425 {
426         struct drm_plane *plane;
427
428         drm_for_each_plane(plane, dev)
429                 if (idx == plane->index)
430                         return plane;
431
432         return NULL;
433 }
434 EXPORT_SYMBOL(drm_plane_from_index);
435
436 /**
437  * drm_plane_force_disable - Forcibly disable a plane
438  * @plane: plane to disable
439  *
440  * Forces the plane to be disabled.
441  *
442  * Used when the plane's current framebuffer is destroyed,
443  * and when restoring fbdev mode.
444  *
445  * Note that this function is not suitable for atomic drivers, since it doesn't
446  * wire through the lock acquisition context properly and hence can't handle
447  * retries or driver private locks. You probably want to use
448  * drm_atomic_helper_disable_plane() or
449  * drm_atomic_helper_disable_planes_on_crtc() instead.
450  */
451 void drm_plane_force_disable(struct drm_plane *plane)
452 {
453         int ret;
454
455         if (!plane->fb)
456                 return;
457
458         WARN_ON(drm_drv_uses_atomic_modeset(plane->dev));
459
460         plane->old_fb = plane->fb;
461         ret = plane->funcs->disable_plane(plane, NULL);
462         if (ret) {
463                 DRM_ERROR("failed to disable plane with busy fb\n");
464                 plane->old_fb = NULL;
465                 return;
466         }
467         /* disconnect the plane from the fb and crtc: */
468         drm_framebuffer_put(plane->old_fb);
469         plane->old_fb = NULL;
470         plane->fb = NULL;
471         plane->crtc = NULL;
472 }
473 EXPORT_SYMBOL(drm_plane_force_disable);
474
475 /**
476  * drm_mode_plane_set_obj_prop - set the value of a property
477  * @plane: drm plane object to set property value for
478  * @property: property to set
479  * @value: value the property should be set to
480  *
481  * This functions sets a given property on a given plane object. This function
482  * calls the driver's ->set_property callback and changes the software state of
483  * the property if the callback succeeds.
484  *
485  * Returns:
486  * Zero on success, error code on failure.
487  */
488 int drm_mode_plane_set_obj_prop(struct drm_plane *plane,
489                                 struct drm_property *property,
490                                 uint64_t value)
491 {
492         int ret = -EINVAL;
493         struct drm_mode_object *obj = &plane->base;
494
495         if (plane->funcs->set_property)
496                 ret = plane->funcs->set_property(plane, property, value);
497         if (!ret)
498                 drm_object_property_set_value(obj, property, value);
499
500         return ret;
501 }
502 EXPORT_SYMBOL(drm_mode_plane_set_obj_prop);
503
504 int drm_mode_getplane_res(struct drm_device *dev, void *data,
505                           struct drm_file *file_priv)
506 {
507         struct drm_mode_get_plane_res *plane_resp = data;
508         struct drm_plane *plane;
509         uint32_t __user *plane_ptr;
510         int count = 0;
511
512         if (!drm_core_check_feature(dev, DRIVER_MODESET))
513                 return -EOPNOTSUPP;
514
515         plane_ptr = u64_to_user_ptr(plane_resp->plane_id_ptr);
516
517         /*
518          * This ioctl is called twice, once to determine how much space is
519          * needed, and the 2nd time to fill it.
520          */
521         drm_for_each_plane(plane, dev) {
522                 /*
523                  * Unless userspace set the 'universal planes'
524                  * capability bit, only advertise overlays.
525                  */
526                 if (plane->type != DRM_PLANE_TYPE_OVERLAY &&
527                     !file_priv->universal_planes)
528                         continue;
529
530                 if (drm_lease_held(file_priv, plane->base.id)) {
531                         if (count < plane_resp->count_planes &&
532                             put_user(plane->base.id, plane_ptr + count))
533                                 return -EFAULT;
534                         count++;
535                 }
536         }
537         plane_resp->count_planes = count;
538
539         return 0;
540 }
541
542 int drm_mode_getplane(struct drm_device *dev, void *data,
543                       struct drm_file *file_priv)
544 {
545         struct drm_mode_get_plane *plane_resp = data;
546         struct drm_plane *plane;
547         uint32_t __user *format_ptr;
548
549         if (!drm_core_check_feature(dev, DRIVER_MODESET))
550                 return -EOPNOTSUPP;
551
552         plane = drm_plane_find(dev, file_priv, plane_resp->plane_id);
553         if (!plane)
554                 return -ENOENT;
555
556         drm_modeset_lock(&plane->mutex, NULL);
557         if (plane->state && plane->state->crtc && drm_lease_held(file_priv, plane->state->crtc->base.id))
558                 plane_resp->crtc_id = plane->state->crtc->base.id;
559         else if (!plane->state && plane->crtc && drm_lease_held(file_priv, plane->crtc->base.id))
560                 plane_resp->crtc_id = plane->crtc->base.id;
561         else
562                 plane_resp->crtc_id = 0;
563
564         if (plane->state && plane->state->fb)
565                 plane_resp->fb_id = plane->state->fb->base.id;
566         else if (!plane->state && plane->fb)
567                 plane_resp->fb_id = plane->fb->base.id;
568         else
569                 plane_resp->fb_id = 0;
570         drm_modeset_unlock(&plane->mutex);
571
572         plane_resp->plane_id = plane->base.id;
573         plane_resp->possible_crtcs = drm_lease_filter_crtcs(file_priv,
574                                                             plane->possible_crtcs);
575
576         plane_resp->gamma_size = 0;
577
578         /*
579          * This ioctl is called twice, once to determine how much space is
580          * needed, and the 2nd time to fill it.
581          */
582         if (plane->format_count &&
583             (plane_resp->count_format_types >= plane->format_count)) {
584                 format_ptr = (uint32_t __user *)(unsigned long)plane_resp->format_type_ptr;
585                 if (copy_to_user(format_ptr,
586                                  plane->format_types,
587                                  sizeof(uint32_t) * plane->format_count)) {
588                         return -EFAULT;
589                 }
590         }
591         plane_resp->count_format_types = plane->format_count;
592
593         return 0;
594 }
595
596 int drm_plane_check_pixel_format(struct drm_plane *plane,
597                                  u32 format, u64 modifier)
598 {
599         unsigned int i;
600
601         for (i = 0; i < plane->format_count; i++) {
602                 if (format == plane->format_types[i])
603                         break;
604         }
605         if (i == plane->format_count)
606                 return -EINVAL;
607
608         if (plane->funcs->format_mod_supported) {
609                 if (!plane->funcs->format_mod_supported(plane, format, modifier))
610                         return -EINVAL;
611         } else {
612                 if (!plane->modifier_count)
613                         return 0;
614
615                 for (i = 0; i < plane->modifier_count; i++) {
616                         if (modifier == plane->modifiers[i])
617                                 break;
618                 }
619                 if (i == plane->modifier_count)
620                         return -EINVAL;
621         }
622
623         return 0;
624 }
625
626 static int __setplane_check(struct drm_plane *plane,
627                             struct drm_crtc *crtc,
628                             struct drm_framebuffer *fb,
629                             int32_t crtc_x, int32_t crtc_y,
630                             uint32_t crtc_w, uint32_t crtc_h,
631                             uint32_t src_x, uint32_t src_y,
632                             uint32_t src_w, uint32_t src_h)
633 {
634         int ret;
635
636         /* Check whether this plane is usable on this CRTC */
637         if (!(plane->possible_crtcs & drm_crtc_mask(crtc))) {
638                 DRM_DEBUG_KMS("Invalid crtc for plane\n");
639                 return -EINVAL;
640         }
641
642         /* Check whether this plane supports the fb pixel format. */
643         ret = drm_plane_check_pixel_format(plane, fb->format->format,
644                                            fb->modifier);
645         if (ret) {
646                 struct drm_format_name_buf format_name;
647
648                 DRM_DEBUG_KMS("Invalid pixel format %s, modifier 0x%llx\n",
649                               drm_get_format_name(fb->format->format,
650                                                   &format_name),
651                               fb->modifier);
652                 return ret;
653         }
654
655         /* Give drivers some help against integer overflows */
656         if (crtc_w > INT_MAX ||
657             crtc_x > INT_MAX - (int32_t) crtc_w ||
658             crtc_h > INT_MAX ||
659             crtc_y > INT_MAX - (int32_t) crtc_h) {
660                 DRM_DEBUG_KMS("Invalid CRTC coordinates %ux%u+%d+%d\n",
661                               crtc_w, crtc_h, crtc_x, crtc_y);
662                 return -ERANGE;
663         }
664
665         ret = drm_framebuffer_check_src_coords(src_x, src_y, src_w, src_h, fb);
666         if (ret)
667                 return ret;
668
669         return 0;
670 }
671
672 /**
673  * drm_any_plane_has_format - Check whether any plane supports this format and modifier combination
674  * @dev: DRM device
675  * @format: pixel format (DRM_FORMAT_*)
676  * @modifier: data layout modifier
677  *
678  * Returns:
679  * Whether at least one plane supports the specified format and modifier combination.
680  */
681 bool drm_any_plane_has_format(struct drm_device *dev,
682                               u32 format, u64 modifier)
683 {
684         struct drm_plane *plane;
685
686         drm_for_each_plane(plane, dev) {
687                 if (drm_plane_check_pixel_format(plane, format, modifier) == 0)
688                         return true;
689         }
690
691         return false;
692 }
693 EXPORT_SYMBOL(drm_any_plane_has_format);
694
695 /*
696  * __setplane_internal - setplane handler for internal callers
697  *
698  * This function will take a reference on the new fb for the plane
699  * on success.
700  *
701  * src_{x,y,w,h} are provided in 16.16 fixed point format
702  */
703 static int __setplane_internal(struct drm_plane *plane,
704                                struct drm_crtc *crtc,
705                                struct drm_framebuffer *fb,
706                                int32_t crtc_x, int32_t crtc_y,
707                                uint32_t crtc_w, uint32_t crtc_h,
708                                /* src_{x,y,w,h} values are 16.16 fixed point */
709                                uint32_t src_x, uint32_t src_y,
710                                uint32_t src_w, uint32_t src_h,
711                                struct drm_modeset_acquire_ctx *ctx)
712 {
713         int ret = 0;
714
715         WARN_ON(drm_drv_uses_atomic_modeset(plane->dev));
716
717         /* No fb means shut it down */
718         if (!fb) {
719                 plane->old_fb = plane->fb;
720                 ret = plane->funcs->disable_plane(plane, ctx);
721                 if (!ret) {
722                         plane->crtc = NULL;
723                         plane->fb = NULL;
724                 } else {
725                         plane->old_fb = NULL;
726                 }
727                 goto out;
728         }
729
730         ret = __setplane_check(plane, crtc, fb,
731                                crtc_x, crtc_y, crtc_w, crtc_h,
732                                src_x, src_y, src_w, src_h);
733         if (ret)
734                 goto out;
735
736         plane->old_fb = plane->fb;
737         ret = plane->funcs->update_plane(plane, crtc, fb,
738                                          crtc_x, crtc_y, crtc_w, crtc_h,
739                                          src_x, src_y, src_w, src_h, ctx);
740         if (!ret) {
741                 plane->crtc = crtc;
742                 plane->fb = fb;
743                 drm_framebuffer_get(plane->fb);
744         } else {
745                 plane->old_fb = NULL;
746         }
747
748 out:
749         if (plane->old_fb)
750                 drm_framebuffer_put(plane->old_fb);
751         plane->old_fb = NULL;
752
753         return ret;
754 }
755
756 static int __setplane_atomic(struct drm_plane *plane,
757                              struct drm_crtc *crtc,
758                              struct drm_framebuffer *fb,
759                              int32_t crtc_x, int32_t crtc_y,
760                              uint32_t crtc_w, uint32_t crtc_h,
761                              uint32_t src_x, uint32_t src_y,
762                              uint32_t src_w, uint32_t src_h,
763                              struct drm_modeset_acquire_ctx *ctx)
764 {
765         int ret;
766
767         WARN_ON(!drm_drv_uses_atomic_modeset(plane->dev));
768
769         /* No fb means shut it down */
770         if (!fb)
771                 return plane->funcs->disable_plane(plane, ctx);
772
773         /*
774          * FIXME: This is redundant with drm_atomic_plane_check(),
775          * but the legacy cursor/"async" .update_plane() tricks
776          * don't call that so we still need this here. Should remove
777          * this when all .update_plane() implementations have been
778          * fixed to call drm_atomic_plane_check().
779          */
780         ret = __setplane_check(plane, crtc, fb,
781                                crtc_x, crtc_y, crtc_w, crtc_h,
782                                src_x, src_y, src_w, src_h);
783         if (ret)
784                 return ret;
785
786         return plane->funcs->update_plane(plane, crtc, fb,
787                                           crtc_x, crtc_y, crtc_w, crtc_h,
788                                           src_x, src_y, src_w, src_h, ctx);
789 }
790
791 static int setplane_internal(struct drm_plane *plane,
792                              struct drm_crtc *crtc,
793                              struct drm_framebuffer *fb,
794                              int32_t crtc_x, int32_t crtc_y,
795                              uint32_t crtc_w, uint32_t crtc_h,
796                              /* src_{x,y,w,h} values are 16.16 fixed point */
797                              uint32_t src_x, uint32_t src_y,
798                              uint32_t src_w, uint32_t src_h)
799 {
800         struct drm_modeset_acquire_ctx ctx;
801         int ret;
802
803         DRM_MODESET_LOCK_ALL_BEGIN(plane->dev, ctx,
804                                    DRM_MODESET_ACQUIRE_INTERRUPTIBLE, ret);
805
806         if (drm_drv_uses_atomic_modeset(plane->dev))
807                 ret = __setplane_atomic(plane, crtc, fb,
808                                         crtc_x, crtc_y, crtc_w, crtc_h,
809                                         src_x, src_y, src_w, src_h, &ctx);
810         else
811                 ret = __setplane_internal(plane, crtc, fb,
812                                           crtc_x, crtc_y, crtc_w, crtc_h,
813                                           src_x, src_y, src_w, src_h, &ctx);
814
815         DRM_MODESET_LOCK_ALL_END(plane->dev, ctx, ret);
816
817         return ret;
818 }
819
820 int drm_mode_setplane(struct drm_device *dev, void *data,
821                       struct drm_file *file_priv)
822 {
823         struct drm_mode_set_plane *plane_req = data;
824         struct drm_plane *plane;
825         struct drm_crtc *crtc = NULL;
826         struct drm_framebuffer *fb = NULL;
827         int ret;
828
829         if (!drm_core_check_feature(dev, DRIVER_MODESET))
830                 return -EOPNOTSUPP;
831
832         /*
833          * First, find the plane, crtc, and fb objects.  If not available,
834          * we don't bother to call the driver.
835          */
836         plane = drm_plane_find(dev, file_priv, plane_req->plane_id);
837         if (!plane) {
838                 DRM_DEBUG_KMS("Unknown plane ID %d\n",
839                               plane_req->plane_id);
840                 return -ENOENT;
841         }
842
843         if (plane_req->fb_id) {
844                 fb = drm_framebuffer_lookup(dev, file_priv, plane_req->fb_id);
845                 if (!fb) {
846                         DRM_DEBUG_KMS("Unknown framebuffer ID %d\n",
847                                       plane_req->fb_id);
848                         return -ENOENT;
849                 }
850
851                 crtc = drm_crtc_find(dev, file_priv, plane_req->crtc_id);
852                 if (!crtc) {
853                         drm_framebuffer_put(fb);
854                         DRM_DEBUG_KMS("Unknown crtc ID %d\n",
855                                       plane_req->crtc_id);
856                         return -ENOENT;
857                 }
858         }
859
860         ret = setplane_internal(plane, crtc, fb,
861                                 plane_req->crtc_x, plane_req->crtc_y,
862                                 plane_req->crtc_w, plane_req->crtc_h,
863                                 plane_req->src_x, plane_req->src_y,
864                                 plane_req->src_w, plane_req->src_h);
865
866         if (fb)
867                 drm_framebuffer_put(fb);
868
869         return ret;
870 }
871
872 static int drm_mode_cursor_universal(struct drm_crtc *crtc,
873                                      struct drm_mode_cursor2 *req,
874                                      struct drm_file *file_priv,
875                                      struct drm_modeset_acquire_ctx *ctx)
876 {
877         struct drm_device *dev = crtc->dev;
878         struct drm_plane *plane = crtc->cursor;
879         struct drm_framebuffer *fb = NULL;
880         struct drm_mode_fb_cmd2 fbreq = {
881                 .width = req->width,
882                 .height = req->height,
883                 .pixel_format = DRM_FORMAT_ARGB8888,
884                 .pitches = { req->width * 4 },
885                 .handles = { req->handle },
886         };
887         int32_t crtc_x, crtc_y;
888         uint32_t crtc_w = 0, crtc_h = 0;
889         uint32_t src_w = 0, src_h = 0;
890         int ret = 0;
891
892         BUG_ON(!plane);
893         WARN_ON(plane->crtc != crtc && plane->crtc != NULL);
894
895         /*
896          * Obtain fb we'll be using (either new or existing) and take an extra
897          * reference to it if fb != null.  setplane will take care of dropping
898          * the reference if the plane update fails.
899          */
900         if (req->flags & DRM_MODE_CURSOR_BO) {
901                 if (req->handle) {
902                         fb = drm_internal_framebuffer_create(dev, &fbreq, file_priv);
903                         if (IS_ERR(fb)) {
904                                 DRM_DEBUG_KMS("failed to wrap cursor buffer in drm framebuffer\n");
905                                 return PTR_ERR(fb);
906                         }
907
908                         fb->hot_x = req->hot_x;
909                         fb->hot_y = req->hot_y;
910                 } else {
911                         fb = NULL;
912                 }
913         } else {
914                 if (plane->state)
915                         fb = plane->state->fb;
916                 else
917                         fb = plane->fb;
918
919                 if (fb)
920                         drm_framebuffer_get(fb);
921         }
922
923         if (req->flags & DRM_MODE_CURSOR_MOVE) {
924                 crtc_x = req->x;
925                 crtc_y = req->y;
926         } else {
927                 crtc_x = crtc->cursor_x;
928                 crtc_y = crtc->cursor_y;
929         }
930
931         if (fb) {
932                 crtc_w = fb->width;
933                 crtc_h = fb->height;
934                 src_w = fb->width << 16;
935                 src_h = fb->height << 16;
936         }
937
938         if (drm_drv_uses_atomic_modeset(dev))
939                 ret = __setplane_atomic(plane, crtc, fb,
940                                         crtc_x, crtc_y, crtc_w, crtc_h,
941                                         0, 0, src_w, src_h, ctx);
942         else
943                 ret = __setplane_internal(plane, crtc, fb,
944                                           crtc_x, crtc_y, crtc_w, crtc_h,
945                                           0, 0, src_w, src_h, ctx);
946
947         if (fb)
948                 drm_framebuffer_put(fb);
949
950         /* Update successful; save new cursor position, if necessary */
951         if (ret == 0 && req->flags & DRM_MODE_CURSOR_MOVE) {
952                 crtc->cursor_x = req->x;
953                 crtc->cursor_y = req->y;
954         }
955
956         return ret;
957 }
958
959 static int drm_mode_cursor_common(struct drm_device *dev,
960                                   struct drm_mode_cursor2 *req,
961                                   struct drm_file *file_priv)
962 {
963         struct drm_crtc *crtc;
964         struct drm_modeset_acquire_ctx ctx;
965         int ret = 0;
966
967         if (!drm_core_check_feature(dev, DRIVER_MODESET))
968                 return -EOPNOTSUPP;
969
970         if (!req->flags || (~DRM_MODE_CURSOR_FLAGS & req->flags))
971                 return -EINVAL;
972
973         crtc = drm_crtc_find(dev, file_priv, req->crtc_id);
974         if (!crtc) {
975                 DRM_DEBUG_KMS("Unknown CRTC ID %d\n", req->crtc_id);
976                 return -ENOENT;
977         }
978
979         drm_modeset_acquire_init(&ctx, DRM_MODESET_ACQUIRE_INTERRUPTIBLE);
980 retry:
981         ret = drm_modeset_lock(&crtc->mutex, &ctx);
982         if (ret)
983                 goto out;
984         /*
985          * If this crtc has a universal cursor plane, call that plane's update
986          * handler rather than using legacy cursor handlers.
987          */
988         if (crtc->cursor) {
989                 ret = drm_modeset_lock(&crtc->cursor->mutex, &ctx);
990                 if (ret)
991                         goto out;
992
993                 if (!drm_lease_held(file_priv, crtc->cursor->base.id)) {
994                         ret = -EACCES;
995                         goto out;
996                 }
997
998                 ret = drm_mode_cursor_universal(crtc, req, file_priv, &ctx);
999                 goto out;
1000         }
1001
1002         if (req->flags & DRM_MODE_CURSOR_BO) {
1003                 if (!crtc->funcs->cursor_set && !crtc->funcs->cursor_set2) {
1004                         ret = -ENXIO;
1005                         goto out;
1006                 }
1007                 /* Turns off the cursor if handle is 0 */
1008                 if (crtc->funcs->cursor_set2)
1009                         ret = crtc->funcs->cursor_set2(crtc, file_priv, req->handle,
1010                                                       req->width, req->height, req->hot_x, req->hot_y);
1011                 else
1012                         ret = crtc->funcs->cursor_set(crtc, file_priv, req->handle,
1013                                                       req->width, req->height);
1014         }
1015
1016         if (req->flags & DRM_MODE_CURSOR_MOVE) {
1017                 if (crtc->funcs->cursor_move) {
1018                         ret = crtc->funcs->cursor_move(crtc, req->x, req->y);
1019                 } else {
1020                         ret = -EFAULT;
1021                         goto out;
1022                 }
1023         }
1024 out:
1025         if (ret == -EDEADLK) {
1026                 ret = drm_modeset_backoff(&ctx);
1027                 if (!ret)
1028                         goto retry;
1029         }
1030
1031         drm_modeset_drop_locks(&ctx);
1032         drm_modeset_acquire_fini(&ctx);
1033
1034         return ret;
1035
1036 }
1037
1038
1039 int drm_mode_cursor_ioctl(struct drm_device *dev,
1040                           void *data, struct drm_file *file_priv)
1041 {
1042         struct drm_mode_cursor *req = data;
1043         struct drm_mode_cursor2 new_req;
1044
1045         memcpy(&new_req, req, sizeof(struct drm_mode_cursor));
1046         new_req.hot_x = new_req.hot_y = 0;
1047
1048         return drm_mode_cursor_common(dev, &new_req, file_priv);
1049 }
1050
1051 /*
1052  * Set the cursor configuration based on user request. This implements the 2nd
1053  * version of the cursor ioctl, which allows userspace to additionally specify
1054  * the hotspot of the pointer.
1055  */
1056 int drm_mode_cursor2_ioctl(struct drm_device *dev,
1057                            void *data, struct drm_file *file_priv)
1058 {
1059         struct drm_mode_cursor2 *req = data;
1060
1061         return drm_mode_cursor_common(dev, req, file_priv);
1062 }
1063
1064 int drm_mode_page_flip_ioctl(struct drm_device *dev,
1065                              void *data, struct drm_file *file_priv)
1066 {
1067         struct drm_mode_crtc_page_flip_target *page_flip = data;
1068         struct drm_crtc *crtc;
1069         struct drm_plane *plane;
1070         struct drm_framebuffer *fb = NULL, *old_fb;
1071         struct drm_pending_vblank_event *e = NULL;
1072         u32 target_vblank = page_flip->sequence;
1073         struct drm_modeset_acquire_ctx ctx;
1074         int ret = -EINVAL;
1075
1076         if (!drm_core_check_feature(dev, DRIVER_MODESET))
1077                 return -EOPNOTSUPP;
1078
1079         if (page_flip->flags & ~DRM_MODE_PAGE_FLIP_FLAGS)
1080                 return -EINVAL;
1081
1082         if (page_flip->sequence != 0 && !(page_flip->flags & DRM_MODE_PAGE_FLIP_TARGET))
1083                 return -EINVAL;
1084
1085         /* Only one of the DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags
1086          * can be specified
1087          */
1088         if ((page_flip->flags & DRM_MODE_PAGE_FLIP_TARGET) == DRM_MODE_PAGE_FLIP_TARGET)
1089                 return -EINVAL;
1090
1091         if ((page_flip->flags & DRM_MODE_PAGE_FLIP_ASYNC) && !dev->mode_config.async_page_flip)
1092                 return -EINVAL;
1093
1094         crtc = drm_crtc_find(dev, file_priv, page_flip->crtc_id);
1095         if (!crtc)
1096                 return -ENOENT;
1097
1098         plane = crtc->primary;
1099
1100         if (!drm_lease_held(file_priv, plane->base.id))
1101                 return -EACCES;
1102
1103         if (crtc->funcs->page_flip_target) {
1104                 u32 current_vblank;
1105                 int r;
1106
1107                 r = drm_crtc_vblank_get(crtc);
1108                 if (r)
1109                         return r;
1110
1111                 current_vblank = (u32)drm_crtc_vblank_count(crtc);
1112
1113                 switch (page_flip->flags & DRM_MODE_PAGE_FLIP_TARGET) {
1114                 case DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE:
1115                         if ((int)(target_vblank - current_vblank) > 1) {
1116                                 DRM_DEBUG("Invalid absolute flip target %u, "
1117                                           "must be <= %u\n", target_vblank,
1118                                           current_vblank + 1);
1119                                 drm_crtc_vblank_put(crtc);
1120                                 return -EINVAL;
1121                         }
1122                         break;
1123                 case DRM_MODE_PAGE_FLIP_TARGET_RELATIVE:
1124                         if (target_vblank != 0 && target_vblank != 1) {
1125                                 DRM_DEBUG("Invalid relative flip target %u, "
1126                                           "must be 0 or 1\n", target_vblank);
1127                                 drm_crtc_vblank_put(crtc);
1128                                 return -EINVAL;
1129                         }
1130                         target_vblank += current_vblank;
1131                         break;
1132                 default:
1133                         target_vblank = current_vblank +
1134                                 !(page_flip->flags & DRM_MODE_PAGE_FLIP_ASYNC);
1135                         break;
1136                 }
1137         } else if (crtc->funcs->page_flip == NULL ||
1138                    (page_flip->flags & DRM_MODE_PAGE_FLIP_TARGET)) {
1139                 return -EINVAL;
1140         }
1141
1142         drm_modeset_acquire_init(&ctx, DRM_MODESET_ACQUIRE_INTERRUPTIBLE);
1143 retry:
1144         ret = drm_modeset_lock(&crtc->mutex, &ctx);
1145         if (ret)
1146                 goto out;
1147         ret = drm_modeset_lock(&plane->mutex, &ctx);
1148         if (ret)
1149                 goto out;
1150
1151         if (plane->state)
1152                 old_fb = plane->state->fb;
1153         else
1154                 old_fb = plane->fb;
1155
1156         if (old_fb == NULL) {
1157                 /* The framebuffer is currently unbound, presumably
1158                  * due to a hotplug event, that userspace has not
1159                  * yet discovered.
1160                  */
1161                 ret = -EBUSY;
1162                 goto out;
1163         }
1164
1165         fb = drm_framebuffer_lookup(dev, file_priv, page_flip->fb_id);
1166         if (!fb) {
1167                 ret = -ENOENT;
1168                 goto out;
1169         }
1170
1171         if (plane->state) {
1172                 const struct drm_plane_state *state = plane->state;
1173
1174                 ret = drm_framebuffer_check_src_coords(state->src_x,
1175                                                        state->src_y,
1176                                                        state->src_w,
1177                                                        state->src_h,
1178                                                        fb);
1179         } else {
1180                 ret = drm_crtc_check_viewport(crtc, crtc->x, crtc->y,
1181                                               &crtc->mode, fb);
1182         }
1183         if (ret)
1184                 goto out;
1185
1186         if (old_fb->format != fb->format) {
1187                 DRM_DEBUG_KMS("Page flip is not allowed to change frame buffer format.\n");
1188                 ret = -EINVAL;
1189                 goto out;
1190         }
1191
1192         if (page_flip->flags & DRM_MODE_PAGE_FLIP_EVENT) {
1193                 e = kzalloc(sizeof *e, GFP_KERNEL);
1194                 if (!e) {
1195                         ret = -ENOMEM;
1196                         goto out;
1197                 }
1198
1199                 e->event.base.type = DRM_EVENT_FLIP_COMPLETE;
1200                 e->event.base.length = sizeof(e->event);
1201                 e->event.vbl.user_data = page_flip->user_data;
1202                 e->event.vbl.crtc_id = crtc->base.id;
1203
1204                 ret = drm_event_reserve_init(dev, file_priv, &e->base, &e->event.base);
1205                 if (ret) {
1206                         kfree(e);
1207                         e = NULL;
1208                         goto out;
1209                 }
1210         }
1211
1212         plane->old_fb = plane->fb;
1213         if (crtc->funcs->page_flip_target)
1214                 ret = crtc->funcs->page_flip_target(crtc, fb, e,
1215                                                     page_flip->flags,
1216                                                     target_vblank,
1217                                                     &ctx);
1218         else
1219                 ret = crtc->funcs->page_flip(crtc, fb, e, page_flip->flags,
1220                                              &ctx);
1221         if (ret) {
1222                 if (page_flip->flags & DRM_MODE_PAGE_FLIP_EVENT)
1223                         drm_event_cancel_free(dev, &e->base);
1224                 /* Keep the old fb, don't unref it. */
1225                 plane->old_fb = NULL;
1226         } else {
1227                 if (!plane->state) {
1228                         plane->fb = fb;
1229                         drm_framebuffer_get(fb);
1230                 }
1231         }
1232
1233 out:
1234         if (fb)
1235                 drm_framebuffer_put(fb);
1236         if (plane->old_fb)
1237                 drm_framebuffer_put(plane->old_fb);
1238         plane->old_fb = NULL;
1239
1240         if (ret == -EDEADLK) {
1241                 ret = drm_modeset_backoff(&ctx);
1242                 if (!ret)
1243                         goto retry;
1244         }
1245
1246         drm_modeset_drop_locks(&ctx);
1247         drm_modeset_acquire_fini(&ctx);
1248
1249         if (ret && crtc->funcs->page_flip_target)
1250                 drm_crtc_vblank_put(crtc);
1251
1252         return ret;
1253 }
1254
1255 struct drm_property *
1256 drm_create_scaling_filter_prop(struct drm_device *dev,
1257                                unsigned int supported_filters)
1258 {
1259         struct drm_property *prop;
1260         static const struct drm_prop_enum_list props[] = {
1261                 { DRM_SCALING_FILTER_DEFAULT, "Default" },
1262                 { DRM_SCALING_FILTER_NEAREST_NEIGHBOR, "Nearest Neighbor" },
1263         };
1264         unsigned int valid_mode_mask = BIT(DRM_SCALING_FILTER_DEFAULT) |
1265                                        BIT(DRM_SCALING_FILTER_NEAREST_NEIGHBOR);
1266         int i;
1267
1268         if (WARN_ON((supported_filters & ~valid_mode_mask) ||
1269                     ((supported_filters & BIT(DRM_SCALING_FILTER_DEFAULT)) == 0)))
1270                 return ERR_PTR(-EINVAL);
1271
1272         prop = drm_property_create(dev, DRM_MODE_PROP_ENUM,
1273                                    "SCALING_FILTER",
1274                                    hweight32(supported_filters));
1275         if (!prop)
1276                 return ERR_PTR(-ENOMEM);
1277
1278         for (i = 0; i < ARRAY_SIZE(props); i++) {
1279                 int ret;
1280
1281                 if (!(BIT(props[i].type) & supported_filters))
1282                         continue;
1283
1284                 ret = drm_property_add_enum(prop, props[i].type,
1285                                             props[i].name);
1286
1287                 if (ret) {
1288                         drm_property_destroy(dev, prop);
1289
1290                         return ERR_PTR(ret);
1291                 }
1292         }
1293
1294         return prop;
1295 }
1296
1297 /**
1298  * drm_plane_create_scaling_filter_property - create a new scaling filter
1299  * property
1300  *
1301  * @plane: drm plane
1302  * @supported_filters: bitmask of supported scaling filters, must include
1303  *                     BIT(DRM_SCALING_FILTER_DEFAULT).
1304  *
1305  * This function lets driver to enable the scaling filter property on a given
1306  * plane.
1307  *
1308  * RETURNS:
1309  * Zero for success or -errno
1310  */
1311 int drm_plane_create_scaling_filter_property(struct drm_plane *plane,
1312                                              unsigned int supported_filters)
1313 {
1314         struct drm_property *prop =
1315                 drm_create_scaling_filter_prop(plane->dev, supported_filters);
1316
1317         if (IS_ERR(prop))
1318                 return PTR_ERR(prop);
1319
1320         drm_object_attach_property(&plane->base, prop,
1321                                    DRM_SCALING_FILTER_DEFAULT);
1322         plane->scaling_filter_property = prop;
1323
1324         return 0;
1325 }
1326 EXPORT_SYMBOL(drm_plane_create_scaling_filter_property);
This page took 0.119634 seconds and 4 git commands to generate.