• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*sunxi_drm_fbdev.h
2  *
3  * Copyright (C) 2022 Allwinnertech Co., Ltd.
4  * Authors: zhengwanyu <zhengwanyu@allwinnertech.com>
5  * Authors: hongyaobin <hongyaobin@allwinnertech.com>
6  *
7  * This program is free software; you can redistribute  it and/or modify it
8  * under  the terms of  the GNU General  Public License as published by the
9  * Free Software Foundation;  either version 2 of the  License, or (at your
10  * option) any later version.
11  */
12 
13 #ifndef _SUNXI_DRM_FBDEV_H_
14 #define _SUNXI_DRM_FBDEV_H_
15 
16 #include <drm/drm_atomic.h>
17 #include <drm/drm_crtc.h>
18 #include <drm/drm_fb_helper.h>
19 #include <drm/drm_crtc_helper.h>
20 #include <linux/dma-buf.h>
21 #include <linux/dma-mapping.h>
22 #include <linux/module.h>
23 
24 #include "sunxi_drm_fb.h"
25 
26 #ifdef CONFIG_DRM_FBDEV_EMULATION_DUAL_DISPLAY_WITH_DIFFERENT_BUFFER
27 #define FBDEV_MAX_NUM 2
28 #else
29 #define FBDEV_MAX_NUM 1
30 #endif
31 
32 struct sunxi_drm_fbdev {
33 	struct sunxi_drm_fb *sunxi_fb;
34 	struct drm_fb_helper fb_helper;
35 };
36 
to_sunxi_fbdev(struct drm_fb_helper * helper)37 static inline struct sunxi_drm_fbdev *to_sunxi_fbdev(struct drm_fb_helper *helper)
38 {
39 	return container_of(helper, struct sunxi_drm_fbdev, fb_helper);
40 }
41 
42 struct sunxi_drm_fbdev *sunxi_drm_fbdev_get_fbdev(int index);
43 
44 void sunxi_drm_fbdev_output_poll_changed(struct drm_device *dev);
45 int sunxi_drm_fbdev_init(struct drm_device *dev);
46 void sunxi_drm_fbdev_exit(struct drm_device *dev);
47 #endif
48