71 lines
1.6 KiB
C
71 lines
1.6 KiB
C
/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
|
|||
|
|
/*
|
||
|
|
* Copyright (c) 2019 Amlogic, Inc. All rights reserved.
|
||
|
|
*/
|
||
|
|
|
||
|
|
#ifndef __AM_MESON_FBDEV_H
|
||
|
|
#define __AM_MESON_FBDEV_H
|
||
|
|
|
||
|
|
#include <drm/drm_fb_helper.h>
|
||
|
|
|
||
|
|
int am_meson_drm_fbdev_init(struct drm_device *dev);
|
||
|
|
void am_meson_drm_fbdev_fini(struct drm_device *dev);
|
||
|
|
|
||
|
|
/*keep sync with amlogic osd/fbdev.*/
|
||
|
|
#define FBIOGET_OSD_DMABUF 0x46fc
|
||
|
|
#define FBIOSET_OSD_DST_RESOLUTION 0x46fd
|
||
|
|
#define FBIOGET_OSD_ZORDER 0x46fe
|
||
|
|
#define FBIOSET_OSD_ZORDER 0x46ff
|
||
|
|
|
||
|
|
#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
|
||
|
|
#define FBIO_WAITFORVSYNC_64 _IOW('F', 0x21, __u32)
|
||
|
|
|
||
|
|
#define AFBC_PIXELS_PER_BLOCK 16
|
||
|
|
#define AFBC_HEADER_BYTES_PER_BLOCKENTRY 16
|
||
|
|
#define AFBC_BODY_BYTE_ALIGNMENT 1024
|
||
|
|
#define AFBC_TILED_HEADERS_WIDEBLK_WIDTH_ALIGN 256
|
||
|
|
#define AFBC_TILED_HEADERS_WIDEBLK_HEIGHT_ALIGN 64
|
||
|
|
|
||
|
|
struct region {
|
||
|
|
int x;
|
||
|
|
int y;
|
||
|
|
u32 w;
|
||
|
|
u32 h;
|
||
|
|
};
|
||
|
|
|
||
|
|
struct fb_dmabuf_export {
|
||
|
|
/*idx only used in legacy android implement, not used now.*/
|
||
|
|
__u32 buffer_idx;
|
||
|
|
__u32 fd;
|
||
|
|
__u32 flags;
|
||
|
|
};
|
||
|
|
|
||
|
|
struct meson_drm_fbdev_config {
|
||
|
|
u32 ui_w;
|
||
|
|
u32 ui_h;
|
||
|
|
u32 fb_w;
|
||
|
|
u32 fb_h;
|
||
|
|
u32 fb_bpp;
|
||
|
|
u32 overlay_ui_w;
|
||
|
|
u32 overlay_ui_h;
|
||
|
|
u32 overlay_fb_w;
|
||
|
|
u32 overlay_fb_h;
|
||
|
|
u32 overlay_fb_bpp;
|
||
|
|
int overlay_flag;
|
||
|
|
};
|
||
|
|
|
||
|
|
struct meson_drm_fbdev {
|
||
|
|
struct drm_fb_helper base;
|
||
|
|
struct drm_plane *plane;
|
||
|
|
//struct am_meson_fb * fb;
|
||
|
|
struct drm_gem_object *fb_gem;
|
||
|
|
struct drm_mode_set modeset;
|
||
|
|
u32 zorder;
|
||
|
|
u32 fbdev_rec_palette[256];
|
||
|
|
bool blank;
|
||
|
|
bool vscreen_info_changed;
|
||
|
|
struct region dst_changed;
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif /* __AM_MESON_FBDEV_H */
|