18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * Copyright © 2006 Keith Packard 38c2ecf20Sopenharmony_ci * Copyright © 2007-2008 Dave Airlie 48c2ecf20Sopenharmony_ci * Copyright © 2007-2008 Intel Corporation 58c2ecf20Sopenharmony_ci * Jesse Barnes <jesse.barnes@intel.com> 68c2ecf20Sopenharmony_ci * 78c2ecf20Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a 88c2ecf20Sopenharmony_ci * copy of this software and associated documentation files (the "Software"), 98c2ecf20Sopenharmony_ci * to deal in the Software without restriction, including without limitation 108c2ecf20Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense, 118c2ecf20Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the 128c2ecf20Sopenharmony_ci * Software is furnished to do so, subject to the following conditions: 138c2ecf20Sopenharmony_ci * 148c2ecf20Sopenharmony_ci * The above copyright notice and this permission notice shall be included in 158c2ecf20Sopenharmony_ci * all copies or substantial portions of the Software. 168c2ecf20Sopenharmony_ci * 178c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 188c2ecf20Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 198c2ecf20Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 208c2ecf20Sopenharmony_ci * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 218c2ecf20Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 228c2ecf20Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 238c2ecf20Sopenharmony_ci * OTHER DEALINGS IN THE SOFTWARE. 248c2ecf20Sopenharmony_ci */ 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ci/* 278c2ecf20Sopenharmony_ci * The DRM mode setting helper functions are common code for drivers to use if 288c2ecf20Sopenharmony_ci * they wish. Drivers are not forced to use this code in their 298c2ecf20Sopenharmony_ci * implementations but it would be useful if they code they do use at least 308c2ecf20Sopenharmony_ci * provides a consistent interface and operation to userspace 318c2ecf20Sopenharmony_ci */ 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci#ifndef __DRM_CRTC_HELPER_H__ 348c2ecf20Sopenharmony_ci#define __DRM_CRTC_HELPER_H__ 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ci#include <linux/spinlock.h> 378c2ecf20Sopenharmony_ci#include <linux/types.h> 388c2ecf20Sopenharmony_ci#include <linux/idr.h> 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ci#include <linux/fb.h> 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_ci#include <drm/drm_crtc.h> 438c2ecf20Sopenharmony_ci#include <drm/drm_modeset_helper_vtables.h> 448c2ecf20Sopenharmony_ci#include <drm/drm_modeset_helper.h> 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_civoid drm_helper_disable_unused_functions(struct drm_device *dev); 478c2ecf20Sopenharmony_ciint drm_crtc_helper_set_config(struct drm_mode_set *set, 488c2ecf20Sopenharmony_ci struct drm_modeset_acquire_ctx *ctx); 498c2ecf20Sopenharmony_cibool drm_crtc_helper_set_mode(struct drm_crtc *crtc, 508c2ecf20Sopenharmony_ci struct drm_display_mode *mode, 518c2ecf20Sopenharmony_ci int x, int y, 528c2ecf20Sopenharmony_ci struct drm_framebuffer *old_fb); 538c2ecf20Sopenharmony_cibool drm_helper_crtc_in_use(struct drm_crtc *crtc); 548c2ecf20Sopenharmony_cibool drm_helper_encoder_in_use(struct drm_encoder *encoder); 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ciint drm_helper_connector_dpms(struct drm_connector *connector, int mode); 578c2ecf20Sopenharmony_ci 588c2ecf20Sopenharmony_civoid drm_helper_resume_force_mode(struct drm_device *dev); 598c2ecf20Sopenharmony_ciint drm_helper_force_disable_all(struct drm_device *dev); 608c2ecf20Sopenharmony_ci 618c2ecf20Sopenharmony_ci#endif 62