forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/gpu/drm/rockchip/rockchip_drm_fb.h
....@@ -1,21 +1,16 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright (C) Fuzhou Rockchip Electronics Co.Ltd
34 * Author:Mark Yao <mark.yao@rock-chips.com>
4
- *
5
- * This software is licensed under the terms of the GNU General Public
6
- * License version 2, as published by the Free Software Foundation, and
7
- * may be copied, distributed, and modified under those terms.
8
- *
9
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
135 */
146
157 #ifndef _ROCKCHIP_DRM_FB_H
168 #define _ROCKCHIP_DRM_FB_H
179
18
-bool rockchip_fb_is_logo(struct drm_framebuffer *fb);
10
+#include "rockchip_drm_gem.h"
11
+
12
+#define ROCKCHIP_DRM_MODE_LOGO_FB (1<<31) /* used for kernel logo, follow the define: DRM_MODE_FB_MODIFIERS at drm_mode.h */
13
+
1914 struct drm_framebuffer *
2015 rockchip_drm_framebuffer_init(struct drm_device *dev,
2116 const struct drm_mode_fb_cmd2 *mode_cmd,
....@@ -24,20 +19,22 @@
2419
2520 void rockchip_drm_mode_config_init(struct drm_device *dev);
2621 struct drm_framebuffer *
22
+rockchip_drm_logo_fb_alloc(struct drm_device *dev, const struct drm_mode_fb_cmd2 *mode_cmd,
23
+ struct rockchip_logo *logo);
24
+struct drm_framebuffer *
2725 rockchip_fb_alloc(struct drm_device *dev, const struct drm_mode_fb_cmd2 *mode_cmd,
28
- struct drm_gem_object **obj, struct rockchip_logo *logo,
29
- unsigned int num_planes);
26
+ struct drm_gem_object **obj, unsigned int num_planes);
3027
31
-dma_addr_t rockchip_fb_get_dma_addr(struct drm_framebuffer *fb,
32
- unsigned int plane);
33
-void *rockchip_fb_get_kvaddr(struct drm_framebuffer *fb, unsigned int plane);
34
-#define to_rockchip_fb(x) container_of(x, struct rockchip_drm_fb, fb)
28
+#define to_rockchip_logo_fb(x) container_of(x, struct rockchip_drm_logo_fb, fb)
3529
36
-struct rockchip_drm_fb {
30
+struct rockchip_drm_logo_fb {
3731 struct drm_framebuffer fb;
38
- dma_addr_t dma_addr[ROCKCHIP_MAX_FB_BUFFER];
39
- void *kvaddr[ROCKCHIP_MAX_FB_BUFFER];
40
- struct drm_gem_object *obj[ROCKCHIP_MAX_FB_BUFFER];
4132 struct rockchip_logo *logo;
33
+ struct rockchip_gem_object rk_obj;
34
+ /*
35
+ * Used for delayed logo fb release
36
+ */
37
+ struct delayed_work destroy_work;
4238 };
39
+
4340 #endif /* _ROCKCHIP_DRM_FB_H */