/* create extra planes */ int xilinx_drm_plane_create_planes(struct xilinx_drm_plane_manager *manager, unsigned int possible_crtcs) { struct xilinx_drm_plane *plane; int i; int err_ret; xilinx_drm_plane_create_property(manager); /* find if there any available plane, and create if available */ for (i = 0; i < manager->num_planes; i++) { if (manager->planes[i]) continue; plane = xilinx_drm_plane_create(manager, possible_crtcs, false); if (IS_ERR(plane)) { DRM_ERROR("failed to allocate a plane\n"); err_ret = PTR_ERR(plane); goto err_out; } xilinx_drm_plane_attach_property(&plane->base); manager->planes[i] = plane; } return 0; err_out: xilinx_drm_plane_destroy_planes(manager); return err_ret; }
/* create a primary plane */ struct drm_plane * xilinx_drm_plane_create_primary(struct xilinx_drm_plane_manager *manager, unsigned int possible_crtcs) { struct xilinx_drm_plane *plane; plane = xilinx_drm_plane_create(manager, possible_crtcs, true); if (IS_ERR(plane)) { DRM_ERROR("failed to allocate a primary plane\n"); return ERR_CAST(plane); } return &plane->base; }
/* create extra planes */ int xilinx_drm_plane_create_planes(struct xilinx_drm_plane_manager *manager, unsigned int possible_crtcs) { struct xilinx_drm_plane *plane; int i; /* find if there any available plane, and create if available */ for (i = 0; i < manager->num_planes; i++) { if (manager->planes[i]) continue; plane = xilinx_drm_plane_create(manager, possible_crtcs, false); if (IS_ERR(plane)) { DRM_ERROR("failed to allocate a plane\n"); return PTR_ERR(plane); } manager->planes[i] = plane; } return 0; }