Lines Matching defs:plane
536 struct drm_plane *plane;
571 list_for_each_entry(plane, struct drm_plane, &dev->mode_config.plane_list, head) {
572 if (plane->fb == fb)
573 drm_plane_force_disable(plane);
797 * drm_plane_init - Initialise a new plane object
799 * @plane: plane object to init
801 * @funcs: callbacks for the new plane
804 * @priv: plane is private (hidden from userspace)?
806 * Inits a new object created as base part of a driver plane object.
811 int drm_plane_init(struct drm_device *dev, struct drm_plane *plane,
821 ret = drm_mode_object_get(dev, &plane->base, DRM_MODE_OBJECT_PLANE);
825 plane->base.properties = &plane->properties;
826 plane->dev = dev;
827 plane->funcs = funcs;
828 plane->format_types = kmalloc(sizeof(uint32_t) * format_count,
830 if (!plane->format_types) {
831 DRM_DEBUG_KMS("out of memory when allocating plane\n");
832 drm_mode_object_put(dev, &plane->base);
837 (void) memcpy(plane->format_types, formats, format_count * sizeof(uint32_t));
838 plane->format_count = format_count;
839 plane->possible_crtcs = (uint32_t) possible_crtcs;
846 list_add_tail(&plane->head, &dev->mode_config.plane_list, (caddr_t)plane);
849 INIT_LIST_HEAD(&plane->head);
859 * drm_plane_cleanup - Clean up the core plane usage
860 * @plane: plane to cleanup
862 * This function cleans up @plane and removes it from the DRM mode setting
863 * core. Note that the function does *not* free the plane structure itself,
866 void drm_plane_cleanup(struct drm_plane *plane)
868 struct drm_device *dev = plane->dev;
871 kfree(plane->format_types, sizeof(uint32_t) * plane->format_count);
872 drm_mode_object_put(dev, &plane->base);
873 /* if not added to a list, it must be a private plane */
874 if (!list_empty(&plane->head)) {
875 list_del(&plane->head);
882 * drm_plane_force_disable - Forcibly disable a plane
883 * @plane: plane to disable
885 * Forces the plane to be disabled.
887 * Used when the plane's current framebuffer is destroyed,
890 void drm_plane_force_disable(struct drm_plane *plane)
894 if (!plane->fb)
897 ret = plane->funcs->disable_plane(plane);
899 DRM_ERROR("failed to disable plane with busy fb\n");
900 /* disconnect the plane from the fb and crtc: */
901 __drm_framebuffer_unreference(plane->fb);
902 plane->fb = NULL;
903 plane->crtc = NULL;
1693 * drm_mode_getplane_res - get plane info
1699 * Return an plane count and set of IDs.
1706 struct drm_plane *plane;
1724 list_for_each_entry(plane, struct drm_plane, &config->plane_list, head) {
1725 if (put_user(plane->base.id, plane_ptr + copied)) {
1740 * drm_mode_getplane - get plane info
1746 * Return plane info, including formats supported, gamma size, any
1754 struct drm_plane *plane;
1768 plane = obj_to_plane(obj);
1770 if (plane->crtc)
1771 plane_resp->crtc_id = plane->crtc->base.id;
1775 if (plane->fb)
1776 plane_resp->fb_id = plane->fb->base.id;
1780 plane_resp->plane_id = plane->base.id;
1781 plane_resp->possible_crtcs = plane->possible_crtcs;
1788 if (plane->format_count &&
1789 (plane_resp->count_format_types >= plane->format_count)) {
1792 plane->format_types,
1793 sizeof(uint32_t) * plane->format_count)) {
1798 plane_resp->count_format_types = plane->format_count;
1806 * drm_mode_setplane - set up or tear down an plane
1812 * Set plane info, including placement, fb, scaling, and other factors.
1820 struct drm_plane *plane;
1831 * First, find the plane, crtc, and fb objects. If not available,
1837 DRM_DEBUG_KMS("Unknown plane ID %d\n",
1841 plane = obj_to_plane(obj);
1846 old_fb = plane->fb;
1847 plane->funcs->disable_plane(plane);
1848 plane->crtc = NULL;
1849 plane->fb = NULL;
1872 /* Check whether this plane supports the fb pixel format. */
1873 for (i = 0; i < plane->format_count; i++)
1874 if (fb->pixel_format == plane->format_types[i])
1876 if (i == plane->format_count) {
1917 ret = plane->funcs->update_plane(plane, crtc, fb,
1923 old_fb = plane->fb;
1924 plane->crtc = crtc;
1925 plane->fb = fb;
2419 DRM_DEBUG_KMS("no buffer object handle for plane %d\n", i);
2430 DRM_DEBUG_KMS("bad pitch %u for plane %d\n", r->pitches[i], i);
3191 struct drm_plane *plane = obj_to_plane(obj);
3193 if (plane->funcs->set_property)
3194 ret = plane->funcs->set_property(plane, property, value);
3740 * @plane: plane index
3743 * The bytes per pixel value for the specified plane.
3745 int drm_format_plane_cpp(uint32_t format, int plane)
3750 if (plane >= drm_format_num_planes(format))
3765 return plane ? 2 : 1;
3899 struct drm_plane *plane, *plt;
3934 list_for_each_entry_safe(plane, plt, struct drm_plane, &dev->mode_config.plane_list,
3936 plane->funcs->destroy(plane);