Lines Matching full:plane
42 * A plane represents an image source that can be blended with or overlaid on
44 * &drm_framebuffer object. The plane itself specifies the cropping and scaling
46 * pipeline, represented by &drm_crtc. A plane can also have additional
52 * which are not covered by a plane will be black, and alpha blending of any
55 * To create a plane, a KMS drivers allocates and zeroes an instances of
59 * Each plane has a type, see enum drm_plane_type. A plane can be compatible
62 * Each CRTC must have a unique primary plane userspace can attach to enable
64 * primary plane to each CRTC at the same time. Primary planes can still be
69 * relies on the driver to set the primary and optionally the cursor plane used
71 * drivers must provide one primary plane per CRTC to avoid surprising legacy
76 * DOC: standard plane properties
81 * Immutable property describing the type of the plane.
84 * the plane type is just a hint and is mostly superseded by atomic
86 * easily with a plane configuration accepted by the driver.
91 * To light up a CRTC, attaching a primary plane is the most likely to
95 * Drivers may support more features for the primary plane, user-space
101 * plane (e.g. through an atomic commit) with these legacy IOCTLs.
104 * To enable this plane, using a framebuffer configured without scaling
112 * a linear layout. Otherwise, use the IN_FORMATS plane property.
114 * Drivers may support more features for the cursor plane, user-space
120 * plane (e.g. through an atomic commit) with these legacy IOCTLs.
122 * Some drivers may support cursors even if no cursor plane is exposed.
134 * pairs supported by this plane. The blob is a struct
135 * drm_format_modifier_blob. Without this property the plane doesn't
140 * plane will have the IN_FORMATS property, even when it only supports
143 * flag and per-plane properties.
147 * pairs supported by this plane for asynchronous flips. The blob is a struct
150 * atomic ioctl when the modifier/format is not supported by that plane under
154 * Blob property which contains the set of recommended plane size
157 * supported plane sizes through atomic/setcursor ioctls.
170 * the appropriate plane size to use.
198 struct drm_plane *plane, in create_in_format_blob() argument
200 (struct drm_plane *plane, in create_in_format_blob()
210 formats_size = sizeof(__u32) * plane->format_count; in create_in_format_blob()
217 sizeof(struct drm_format_modifier) * plane->modifier_count; in create_in_format_blob()
233 blob_data->count_formats = plane->format_count; in create_in_format_blob()
235 blob_data->count_modifiers = plane->modifier_count; in create_in_format_blob()
240 memcpy(formats_ptr(blob_data), plane->format_types, formats_size); in create_in_format_blob()
243 for (i = 0; i < plane->modifier_count; i++) { in create_in_format_blob()
244 for (j = 0; j < plane->format_count; j++) { in create_in_format_blob()
246 format_mod_supported(plane, in create_in_format_blob()
247 plane->format_types[j], in create_in_format_blob()
248 plane->modifiers[i])) { in create_in_format_blob()
253 mod->modifier = plane->modifiers[i]; in create_in_format_blob()
268 * When the plane is being used as a cursor image to display a mouse pointer,
273 * plane towards the right and bottom.
283 * devices, forwarded to the desktop for processing, and then the cursor plane's
294 * The assumption is generally made that there is only one cursor plane being
297 * should only be exposing a single cursor plane, or find some other way
299 * If the hotspot properties are set, the cursor plane is therefore assumed to be
301 * cursor plane + offset can therefore be used for coordinating with input from a
304 * The cursor will then be drawn either at the location of the plane in the CRTC
305 * console, or as a free-floating cursor plane on the user's console
319 * properties and attaches them to the given cursor plane
321 * @plane: drm cursor plane
324 * cursor plane. Look at the documentation for hotspot properties
330 static int drm_plane_create_hotspot_properties(struct drm_plane *plane) in drm_plane_create_hotspot_properties() argument
335 drm_WARN_ON(plane->dev, in drm_plane_create_hotspot_properties()
336 !drm_core_check_feature(plane->dev, in drm_plane_create_hotspot_properties()
339 prop_x = drm_property_create_signed_range(plane->dev, 0, "HOTSPOT_X", in drm_plane_create_hotspot_properties()
344 prop_y = drm_property_create_signed_range(plane->dev, 0, "HOTSPOT_Y", in drm_plane_create_hotspot_properties()
347 drm_property_destroy(plane->dev, prop_x); in drm_plane_create_hotspot_properties()
351 drm_object_attach_property(&plane->base, prop_x, 0); in drm_plane_create_hotspot_properties()
352 drm_object_attach_property(&plane->base, prop_y, 0); in drm_plane_create_hotspot_properties()
353 plane->hotspot_x_property = prop_x; in drm_plane_create_hotspot_properties()
354 plane->hotspot_y_property = prop_y; in drm_plane_create_hotspot_properties()
361 struct drm_plane *plane, in __drm_universal_plane_init() argument
378 /* plane index is used with 32bit bitmasks */ in __drm_universal_plane_init()
393 ret = drm_mode_object_add(dev, &plane->base, DRM_MODE_OBJECT_PLANE); in __drm_universal_plane_init()
397 drm_modeset_lock_init(&plane->mutex); in __drm_universal_plane_init()
399 plane->base.properties = &plane->properties; in __drm_universal_plane_init()
400 plane->dev = dev; in __drm_universal_plane_init()
401 plane->funcs = funcs; in __drm_universal_plane_init()
402 plane->format_types = kmalloc_array(format_count, sizeof(uint32_t), in __drm_universal_plane_init()
404 if (!plane->format_types) { in __drm_universal_plane_init()
405 DRM_DEBUG_KMS("out of memory when allocating plane\n"); in __drm_universal_plane_init()
406 drm_mode_object_unregister(dev, &plane->base); in __drm_universal_plane_init()
426 plane->modifier_count = format_modifier_count; in __drm_universal_plane_init()
427 plane->modifiers = kmalloc_array(format_modifier_count, in __drm_universal_plane_init()
428 sizeof(*plane->modifiers), in __drm_universal_plane_init()
431 if (format_modifier_count && !plane->modifiers) { in __drm_universal_plane_init()
432 DRM_DEBUG_KMS("out of memory when allocating plane\n"); in __drm_universal_plane_init()
433 kfree(plane->format_types); in __drm_universal_plane_init()
434 drm_mode_object_unregister(dev, &plane->base); in __drm_universal_plane_init()
439 plane->name = kvasprintf(GFP_KERNEL, name, ap); in __drm_universal_plane_init()
441 plane->name = kasprintf(GFP_KERNEL, "plane-%d", in __drm_universal_plane_init()
444 if (!plane->name) { in __drm_universal_plane_init()
445 kfree(plane->format_types); in __drm_universal_plane_init()
446 kfree(plane->modifiers); in __drm_universal_plane_init()
447 drm_mode_object_unregister(dev, &plane->base); in __drm_universal_plane_init()
451 memcpy(plane->format_types, formats, format_count * sizeof(uint32_t)); in __drm_universal_plane_init()
452 plane->format_count = format_count; in __drm_universal_plane_init()
453 memcpy(plane->modifiers, format_modifiers, in __drm_universal_plane_init()
455 plane->possible_crtcs = possible_crtcs; in __drm_universal_plane_init()
456 plane->type = type; in __drm_universal_plane_init()
458 list_add_tail(&plane->head, &config->plane_list); in __drm_universal_plane_init()
459 plane->index = config->num_total_plane++; in __drm_universal_plane_init()
461 drm_object_attach_property(&plane->base, in __drm_universal_plane_init()
463 plane->type); in __drm_universal_plane_init()
466 drm_object_attach_property(&plane->base, config->prop_fb_id, 0); in __drm_universal_plane_init()
467 drm_object_attach_property(&plane->base, config->prop_in_fence_fd, -1); in __drm_universal_plane_init()
468 drm_object_attach_property(&plane->base, config->prop_crtc_id, 0); in __drm_universal_plane_init()
469 drm_object_attach_property(&plane->base, config->prop_crtc_x, 0); in __drm_universal_plane_init()
470 drm_object_attach_property(&plane->base, config->prop_crtc_y, 0); in __drm_universal_plane_init()
471 drm_object_attach_property(&plane->base, config->prop_crtc_w, 0); in __drm_universal_plane_init()
472 drm_object_attach_property(&plane->base, config->prop_crtc_h, 0); in __drm_universal_plane_init()
473 drm_object_attach_property(&plane->base, config->prop_src_x, 0); in __drm_universal_plane_init()
474 drm_object_attach_property(&plane->base, config->prop_src_y, 0); in __drm_universal_plane_init()
475 drm_object_attach_property(&plane->base, config->prop_src_w, 0); in __drm_universal_plane_init()
476 drm_object_attach_property(&plane->base, config->prop_src_h, 0); in __drm_universal_plane_init()
480 drm_plane_create_hotspot_properties(plane); in __drm_universal_plane_init()
484 blob = create_in_format_blob(dev, plane, in __drm_universal_plane_init()
485 plane->funcs->format_mod_supported); in __drm_universal_plane_init()
487 drm_object_attach_property(&plane->base, in __drm_universal_plane_init()
492 if (plane->funcs->format_mod_supported_async) { in __drm_universal_plane_init()
493 blob = create_in_format_blob(dev, plane, in __drm_universal_plane_init()
494 plane->funcs->format_mod_supported_async); in __drm_universal_plane_init()
496 drm_object_attach_property(&plane->base, in __drm_universal_plane_init()
506 * drm_universal_plane_init - Initialize a new universal plane object
508 * @plane: plane object to init
510 * @funcs: callbacks for the new plane
515 * @type: type of plane (overlay, primary, cursor)
516 * @name: printf style format string for the plane name, or NULL for default name
518 * Initializes a plane object of type @type. The &drm_plane_funcs.destroy hook
519 * should call drm_plane_cleanup() and kfree() the plane structure. The plane
527 * @format_modifiers to NULL. The plane will advertise the linear modifier.
532 int drm_universal_plane_init(struct drm_device *dev, struct drm_plane *plane, in drm_universal_plane_init() argument
546 ret = __drm_universal_plane_init(dev, plane, possible_crtcs, funcs, in drm_universal_plane_init()
556 struct drm_plane *plane = ptr; in drmm_universal_plane_alloc_release() local
558 if (WARN_ON(!plane->dev)) in drmm_universal_plane_alloc_release()
561 drm_plane_cleanup(plane); in drmm_universal_plane_alloc_release()
573 struct drm_plane *plane; in __drmm_universal_plane_alloc() local
584 plane = container + offset; in __drmm_universal_plane_alloc()
587 ret = __drm_universal_plane_init(dev, plane, possible_crtcs, funcs, in __drmm_universal_plane_alloc()
595 plane); in __drmm_universal_plane_alloc()
612 struct drm_plane *plane; in __drm_universal_plane_alloc() local
623 plane = container + offset; in __drm_universal_plane_alloc()
626 ret = __drm_universal_plane_init(dev, plane, possible_crtcs, funcs, in __drm_universal_plane_alloc()
645 struct drm_plane *plane; in drm_plane_register_all() local
648 drm_for_each_plane(plane, dev) { in drm_plane_register_all()
649 if (plane->funcs->late_register) in drm_plane_register_all()
650 ret = plane->funcs->late_register(plane); in drm_plane_register_all()
654 if (plane->zpos_property) in drm_plane_register_all()
667 struct drm_plane *plane; in drm_plane_unregister_all() local
669 drm_for_each_plane(plane, dev) { in drm_plane_unregister_all()
670 if (plane->funcs->early_unregister) in drm_plane_unregister_all()
671 plane->funcs->early_unregister(plane); in drm_plane_unregister_all()
676 * drm_plane_cleanup - Clean up the core plane usage
677 * @plane: plane to cleanup
679 * This function cleans up @plane and removes it from the DRM mode setting
680 * core. Note that the function does *not* free the plane structure itself,
683 void drm_plane_cleanup(struct drm_plane *plane) in drm_plane_cleanup() argument
685 struct drm_device *dev = plane->dev; in drm_plane_cleanup()
687 drm_modeset_lock_fini(&plane->mutex); in drm_plane_cleanup()
689 kfree(plane->format_types); in drm_plane_cleanup()
690 kfree(plane->modifiers); in drm_plane_cleanup()
691 drm_mode_object_unregister(dev, &plane->base); in drm_plane_cleanup()
693 BUG_ON(list_empty(&plane->head)); in drm_plane_cleanup()
700 list_del(&plane->head); in drm_plane_cleanup()
703 WARN_ON(plane->state && !plane->funcs->atomic_destroy_state); in drm_plane_cleanup()
704 if (plane->state && plane->funcs->atomic_destroy_state) in drm_plane_cleanup()
705 plane->funcs->atomic_destroy_state(plane, plane->state); in drm_plane_cleanup()
707 kfree(plane->name); in drm_plane_cleanup()
709 memset(plane, 0, sizeof(*plane)); in drm_plane_cleanup()
714 * drm_plane_from_index - find the registered plane at an index
716 * @idx: index of registered plane to find for
718 * Given a plane index, return the registered plane from DRM device's
724 struct drm_plane *plane; in drm_plane_from_index() local
726 drm_for_each_plane(plane, dev) in drm_plane_from_index()
727 if (idx == plane->index) in drm_plane_from_index()
728 return plane; in drm_plane_from_index()
735 * drm_plane_force_disable - Forcibly disable a plane
736 * @plane: plane to disable
738 * Forces the plane to be disabled.
740 * Used when the plane's current framebuffer is destroyed,
749 void drm_plane_force_disable(struct drm_plane *plane) in drm_plane_force_disable() argument
753 if (!plane->fb) in drm_plane_force_disable()
756 WARN_ON(drm_drv_uses_atomic_modeset(plane->dev)); in drm_plane_force_disable()
758 plane->old_fb = plane->fb; in drm_plane_force_disable()
759 ret = plane->funcs->disable_plane(plane, NULL); in drm_plane_force_disable()
761 DRM_ERROR("failed to disable plane with busy fb\n"); in drm_plane_force_disable()
762 plane->old_fb = NULL; in drm_plane_force_disable()
765 /* disconnect the plane from the fb and crtc: */ in drm_plane_force_disable()
766 drm_framebuffer_put(plane->old_fb); in drm_plane_force_disable()
767 plane->old_fb = NULL; in drm_plane_force_disable()
768 plane->fb = NULL; in drm_plane_force_disable()
769 plane->crtc = NULL; in drm_plane_force_disable()
775 * @plane: drm plane object to set property value for
779 * This functions sets a given property on a given plane object. This function
786 int drm_mode_plane_set_obj_prop(struct drm_plane *plane, in drm_mode_plane_set_obj_prop() argument
791 struct drm_mode_object *obj = &plane->base; in drm_mode_plane_set_obj_prop()
793 if (plane->funcs->set_property) in drm_mode_plane_set_obj_prop()
794 ret = plane->funcs->set_property(plane, property, value); in drm_mode_plane_set_obj_prop()
806 struct drm_plane *plane; in drm_mode_getplane_res() local
819 drm_for_each_plane(plane, dev) { in drm_mode_getplane_res()
824 if (plane->type != DRM_PLANE_TYPE_OVERLAY && in drm_mode_getplane_res()
831 * virtualized cursor plane, disable cursor planes in drm_mode_getplane_res()
835 if (plane->type == DRM_PLANE_TYPE_CURSOR && in drm_mode_getplane_res()
841 if (drm_lease_held(file_priv, plane->base.id)) { in drm_mode_getplane_res()
843 put_user(plane->base.id, plane_ptr + count)) in drm_mode_getplane_res()
857 struct drm_plane *plane; in drm_mode_getplane() local
863 plane = drm_plane_find(dev, file_priv, plane_resp->plane_id); in drm_mode_getplane()
864 if (!plane) in drm_mode_getplane()
867 drm_modeset_lock(&plane->mutex, NULL); in drm_mode_getplane()
868 if (plane->state && plane->state->crtc && drm_lease_held(file_priv, plane->state->crtc->base.id)) in drm_mode_getplane()
869 plane_resp->crtc_id = plane->state->crtc->base.id; in drm_mode_getplane()
870 else if (!plane->state && plane->crtc && drm_lease_held(file_priv, plane->crtc->base.id)) in drm_mode_getplane()
871 plane_resp->crtc_id = plane->crtc->base.id; in drm_mode_getplane()
875 if (plane->state && plane->state->fb) in drm_mode_getplane()
876 plane_resp->fb_id = plane->state->fb->base.id; in drm_mode_getplane()
877 else if (!plane->state && plane->fb) in drm_mode_getplane()
878 plane_resp->fb_id = plane->fb->base.id; in drm_mode_getplane()
881 drm_modeset_unlock(&plane->mutex); in drm_mode_getplane()
883 plane_resp->plane_id = plane->base.id; in drm_mode_getplane()
885 plane->possible_crtcs); in drm_mode_getplane()
893 if (plane->format_count && in drm_mode_getplane()
894 (plane_resp->count_format_types >= plane->format_count)) { in drm_mode_getplane()
897 plane->format_types, in drm_mode_getplane()
898 sizeof(uint32_t) * plane->format_count)) { in drm_mode_getplane()
902 plane_resp->count_format_types = plane->format_count; in drm_mode_getplane()
908 * drm_plane_has_format - Check whether the plane supports this format and modifier combination
909 * @plane: drm plane
914 * Whether the plane supports the specified format and modifier combination.
916 bool drm_plane_has_format(struct drm_plane *plane, in drm_plane_has_format() argument
921 for (i = 0; i < plane->format_count; i++) { in drm_plane_has_format()
922 if (format == plane->format_types[i]) in drm_plane_has_format()
925 if (i == plane->format_count) in drm_plane_has_format()
928 if (plane->funcs->format_mod_supported) { in drm_plane_has_format()
929 if (!plane->funcs->format_mod_supported(plane, format, modifier)) in drm_plane_has_format()
932 if (!plane->modifier_count) in drm_plane_has_format()
935 for (i = 0; i < plane->modifier_count; i++) { in drm_plane_has_format()
936 if (modifier == plane->modifiers[i]) in drm_plane_has_format()
939 if (i == plane->modifier_count) in drm_plane_has_format()
947 static int __setplane_check(struct drm_plane *plane, in __setplane_check() argument
957 /* Check whether this plane is usable on this CRTC */ in __setplane_check()
958 if (!(plane->possible_crtcs & drm_crtc_mask(crtc))) { in __setplane_check()
959 DRM_DEBUG_KMS("Invalid crtc for plane\n"); in __setplane_check()
963 /* Check whether this plane supports the fb pixel format. */ in __setplane_check()
964 if (!drm_plane_has_format(plane, fb->format->format, fb->modifier)) { in __setplane_check()
988 * drm_any_plane_has_format - Check whether any plane supports this format and modifier combination
994 * Whether at least one plane supports the specified format and modifier combination.
999 struct drm_plane *plane; in drm_any_plane_has_format() local
1001 drm_for_each_plane(plane, dev) { in drm_any_plane_has_format()
1002 if (drm_plane_has_format(plane, format, modifier)) in drm_any_plane_has_format()
1013 * This function will take a reference on the new fb for the plane
1018 static int __setplane_internal(struct drm_plane *plane, in __setplane_internal() argument
1030 WARN_ON(drm_drv_uses_atomic_modeset(plane->dev)); in __setplane_internal()
1034 plane->old_fb = plane->fb; in __setplane_internal()
1035 ret = plane->funcs->disable_plane(plane, ctx); in __setplane_internal()
1037 plane->crtc = NULL; in __setplane_internal()
1038 plane->fb = NULL; in __setplane_internal()
1040 plane->old_fb = NULL; in __setplane_internal()
1045 ret = __setplane_check(plane, crtc, fb, in __setplane_internal()
1051 plane->old_fb = plane->fb; in __setplane_internal()
1052 ret = plane->funcs->update_plane(plane, crtc, fb, in __setplane_internal()
1056 plane->crtc = crtc; in __setplane_internal()
1057 plane->fb = fb; in __setplane_internal()
1058 drm_framebuffer_get(plane->fb); in __setplane_internal()
1060 plane->old_fb = NULL; in __setplane_internal()
1064 if (plane->old_fb) in __setplane_internal()
1065 drm_framebuffer_put(plane->old_fb); in __setplane_internal()
1066 plane->old_fb = NULL; in __setplane_internal()
1071 static int __setplane_atomic(struct drm_plane *plane, in __setplane_atomic() argument
1082 WARN_ON(!drm_drv_uses_atomic_modeset(plane->dev)); in __setplane_atomic()
1086 return plane->funcs->disable_plane(plane, ctx); in __setplane_atomic()
1095 ret = __setplane_check(plane, crtc, fb, in __setplane_atomic()
1101 return plane->funcs->update_plane(plane, crtc, fb, in __setplane_atomic()
1106 static int setplane_internal(struct drm_plane *plane, in setplane_internal() argument
1118 DRM_MODESET_LOCK_ALL_BEGIN(plane->dev, ctx, in setplane_internal()
1121 if (drm_drv_uses_atomic_modeset(plane->dev)) in setplane_internal()
1122 ret = __setplane_atomic(plane, crtc, fb, in setplane_internal()
1126 ret = __setplane_internal(plane, crtc, fb, in setplane_internal()
1130 DRM_MODESET_LOCK_ALL_END(plane->dev, ctx, ret); in setplane_internal()
1139 struct drm_plane *plane; in drm_mode_setplane() local
1148 * First, find the plane, crtc, and fb objects. If not available, in drm_mode_setplane()
1151 plane = drm_plane_find(dev, file_priv, plane_req->plane_id); in drm_mode_setplane()
1152 if (!plane) { in drm_mode_setplane()
1153 DRM_DEBUG_KMS("Unknown plane ID %d\n", in drm_mode_setplane()
1175 ret = setplane_internal(plane, crtc, fb, in drm_mode_setplane()
1193 struct drm_plane *plane = crtc->cursor; in drm_mode_cursor_universal() local
1207 BUG_ON(!plane); in drm_mode_cursor_universal()
1208 WARN_ON(plane->crtc != crtc && plane->crtc != NULL); in drm_mode_cursor_universal()
1213 * the reference if the plane update fails. in drm_mode_cursor_universal()
1223 if (plane->hotspot_x_property && plane->state) in drm_mode_cursor_universal()
1224 plane->state->hotspot_x = req->hot_x; in drm_mode_cursor_universal()
1225 if (plane->hotspot_y_property && plane->state) in drm_mode_cursor_universal()
1226 plane->state->hotspot_y = req->hot_y; in drm_mode_cursor_universal()
1231 if (plane->state) in drm_mode_cursor_universal()
1232 fb = plane->state->fb; in drm_mode_cursor_universal()
1234 fb = plane->fb; in drm_mode_cursor_universal()
1256 ret = __setplane_atomic(plane, crtc, fb, in drm_mode_cursor_universal()
1260 ret = __setplane_internal(plane, crtc, fb, in drm_mode_cursor_universal()
1302 * If this crtc has a universal cursor plane, call that plane's update in drm_mode_cursor_common()
1386 struct drm_plane *plane; in drm_mode_page_flip_ioctl() local
1415 plane = crtc->primary; in drm_mode_page_flip_ioctl()
1417 if (!drm_lease_held(file_priv, plane->base.id)) in drm_mode_page_flip_ioctl()
1464 ret = drm_modeset_lock(&plane->mutex, &ctx); in drm_mode_page_flip_ioctl()
1468 if (plane->state) in drm_mode_page_flip_ioctl()
1469 old_fb = plane->state->fb; in drm_mode_page_flip_ioctl()
1471 old_fb = plane->fb; in drm_mode_page_flip_ioctl()
1488 if (plane->state) { in drm_mode_page_flip_ioctl()
1489 const struct drm_plane_state *state = plane->state; in drm_mode_page_flip_ioctl()
1536 plane->old_fb = plane->fb; in drm_mode_page_flip_ioctl()
1549 plane->old_fb = NULL; in drm_mode_page_flip_ioctl()
1551 if (!plane->state) { in drm_mode_page_flip_ioctl()
1552 plane->fb = fb; in drm_mode_page_flip_ioctl()
1561 if (plane->old_fb) in drm_mode_page_flip_ioctl()
1562 drm_framebuffer_put(plane->old_fb); in drm_mode_page_flip_ioctl()
1563 plane->old_fb = NULL; in drm_mode_page_flip_ioctl()
1583 * FB_DAMAGE_CLIPS is an optional plane property which provides a means to
1584 * specify a list of damage rectangles on a plane in framebuffer coordinates of
1585 * the framebuffer attached to the plane. In current context damage is the area
1586 * of plane framebuffer that has changed since last plane update (also called
1588 * framebuffer attached during last plane update or not.
1595 * ignore damage clips property and in that case driver will do a full plane
1597 * inside damage clips will be updated to plane. For efficiency driver can do
1602 * framebuffer (since last plane update) can result in incorrect rendering.
1605 * array of &drm_mode_rect. Unlike plane &drm_plane_state.src coordinates,
1606 * damage clips are not in 16.16 fixed point. Similar to plane src in
1611 * Drivers that are interested in damage interface for plane should enable
1619 * target. Drivers implementing a per-plane or per-CRTC upload target need to
1630 * as the damage rectangle, to force a full plane update.
1633 * of the old and new plane states to determine if the framebuffer attached to a
1634 * plane has changed or not since the last plane update. If &drm_plane_state.fb
1637 * That is because drivers with a per-plane upload target, expect the backing
1638 * storage buffer to not change for a given plane. If the upload buffer changes
1649 * drm_plane_enable_fb_damage_clips - Enables plane fb damage clips property.
1650 * @plane: Plane on which to enable damage clips property.
1652 * This function lets driver to enable the damage clips property on a plane.
1654 void drm_plane_enable_fb_damage_clips(struct drm_plane *plane) in drm_plane_enable_fb_damage_clips() argument
1656 struct drm_device *dev = plane->dev; in drm_plane_enable_fb_damage_clips()
1659 drm_object_attach_property(&plane->base, config->prop_fb_damage_clips, in drm_plane_enable_fb_damage_clips()
1666 * @state: Plane state.
1669 * during plane update.
1671 * Return: Number of clips in plane fb_damage_clips blob property.
1690 * @state: Plane state.
1697 * Return: Damage clips in plane fb_damage_clips blob property.
1702 struct drm_device *dev = state->plane->dev; in drm_plane_get_damage_clips()
1706 if (!drm_mode_obj_find_prop_id(&state->plane->base, in drm_plane_get_damage_clips()
1760 * @plane: drm plane
1765 * plane.
1770 int drm_plane_create_scaling_filter_property(struct drm_plane *plane, in drm_plane_create_scaling_filter_property() argument
1774 drm_create_scaling_filter_prop(plane->dev, supported_filters); in drm_plane_create_scaling_filter_property()
1779 drm_object_attach_property(&plane->base, prop, in drm_plane_create_scaling_filter_property()
1781 plane->scaling_filter_property = prop; in drm_plane_create_scaling_filter_property()
1790 * @plane: drm plane
1794 * Create a size hints property for the plane.
1799 int drm_plane_add_size_hints_property(struct drm_plane *plane, in drm_plane_add_size_hints_property() argument
1803 struct drm_device *dev = plane->dev; in drm_plane_add_size_hints_property()
1807 /* extending to other plane types needs actual thought */ in drm_plane_add_size_hints_property()
1808 if (drm_WARN_ON(dev, plane->type != DRM_PLANE_TYPE_CURSOR)) in drm_plane_add_size_hints_property()
1817 drm_object_attach_property(&plane->base, config->size_hints_property, in drm_plane_add_size_hints_property()
1828 * @plane: drm plane
1832 * Create the COLOR_PIPELINE plane property to specific color pipelines on
1833 * the plane.
1838 int drm_plane_create_color_pipeline_property(struct drm_plane *plane, in drm_plane_create_color_pipeline_property() argument
1852 drm_err(plane->dev, "failed to allocate color pipeline\n"); in drm_plane_create_color_pipeline_property()
1867 prop = drm_property_create_enum(plane->dev, DRM_MODE_PROP_ATOMIC, in drm_plane_create_color_pipeline_property()
1875 drm_object_attach_property(&plane->base, prop, 0); in drm_plane_create_color_pipeline_property()
1876 plane->color_pipeline_property = prop; in drm_plane_create_color_pipeline_property()