1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 /* Hisilicon Hibmc SoC drm driver 3 * 4 * Based on the bochs drm driver. 5 * 6 * Copyright (c) 2016 Huawei Limited. 7 * 8 * Author: 9 * Rongrong Zou <zourongrong@huawei.com> 10 * Rongrong Zou <zourongrong@gmail.com> 11 * Jianhua Li <lijianhua@huawei.com> 12 */ 13 14 #ifndef HIBMC_DRM_DRV_H 15 #define HIBMC_DRM_DRV_H 16 17 #include <drm/drm_fb_helper.h> 18 #include <drm/drm_framebuffer.h> 19 20 struct drm_device; 21 22 struct hibmc_drm_private { 23 /* hw */ 24 void __iomem *mmio; 25 void __iomem *fb_map; 26 unsigned long fb_base; 27 unsigned long fb_size; 28 29 /* drm */ 30 struct drm_device *dev; 31 struct drm_plane primary_plane; 32 struct drm_crtc crtc; 33 struct drm_encoder encoder; 34 struct drm_connector connector; 35 bool mode_config_initialized; 36 }; 37 38 void hibmc_set_power_mode(struct hibmc_drm_private *priv, 39 unsigned int power_mode); 40 void hibmc_set_current_gate(struct hibmc_drm_private *priv, 41 unsigned int gate); 42 43 int hibmc_de_init(struct hibmc_drm_private *priv); 44 int hibmc_vdac_init(struct hibmc_drm_private *priv); 45 46 int hibmc_mm_init(struct hibmc_drm_private *hibmc); 47 void hibmc_mm_fini(struct hibmc_drm_private *hibmc); 48 int hibmc_dumb_create(struct drm_file *file, struct drm_device *dev, 49 struct drm_mode_create_dumb *args); 50 51 extern const struct drm_mode_config_funcs hibmc_mode_funcs; 52 53 #endif 54