Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright (c) 2016 Linaro Limited.
0004  * Copyright (c) 2014-2016 HiSilicon Limited.
0005  */
0006 
0007 #ifndef __KIRIN_DRM_DRV_H__
0008 #define __KIRIN_DRM_DRV_H__
0009 
0010 #define to_kirin_crtc(crtc) \
0011     container_of(crtc, struct kirin_crtc, base)
0012 
0013 #define to_kirin_plane(plane) \
0014     container_of(plane, struct kirin_plane, base)
0015 
0016 /* kirin-format translate table */
0017 struct kirin_format {
0018     u32 pixel_format;
0019     u32 hw_format;
0020 };
0021 
0022 struct kirin_crtc {
0023     struct drm_crtc base;
0024     void *hw_ctx;
0025     bool enable;
0026 };
0027 
0028 struct kirin_plane {
0029     struct drm_plane base;
0030     void *hw_ctx;
0031     u32 ch;
0032 };
0033 
0034 /* display controller init/cleanup ops */
0035 struct kirin_drm_data {
0036     const u32 *channel_formats;
0037     u32 channel_formats_cnt;
0038     int config_max_width;
0039     int config_max_height;
0040     u32 num_planes;
0041     u32 prim_plane;
0042 
0043     const struct drm_driver *driver;
0044     const struct drm_crtc_helper_funcs *crtc_helper_funcs;
0045     const struct drm_crtc_funcs *crtc_funcs;
0046     const struct drm_plane_helper_funcs *plane_helper_funcs;
0047     const struct drm_plane_funcs  *plane_funcs;
0048     const struct drm_mode_config_funcs *mode_config_funcs;
0049 
0050     void *(*alloc_hw_ctx)(struct platform_device *pdev,
0051                   struct drm_crtc *crtc);
0052     void (*cleanup_hw_ctx)(void *hw_ctx);
0053 };
0054 
0055 extern struct kirin_drm_data ade_driver_data;
0056 
0057 #endif /* __KIRIN_DRM_DRV_H__ */