diff options
author | Greg Hackmann <ghackmann@google.com> | 2013-07-09 13:07:26 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2014-03-19 13:10:31 -0700 |
commit | a1eadbd034a44e33191e5eefb1ca21f818bc0d43 (patch) | |
tree | e2460bc46b0f2ad86ff9ad10de9ce5871dc0ddee /include/video/adf_fbdev.h | |
parent | e50df0bf0d9d0d3c181b518857da13f53e85f730 (diff) |
video: adf: add fbdev compatibility helper
Change-Id: I2b82bb625f805e8edb27799743b290dda5befb97
Signed-off-by: Greg Hackmann <ghackmann@google.com>
Diffstat (limited to 'include/video/adf_fbdev.h')
-rw-r--r-- | include/video/adf_fbdev.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/include/video/adf_fbdev.h b/include/video/adf_fbdev.h new file mode 100644 index 00000000000..9c349144b5c --- /dev/null +++ b/include/video/adf_fbdev.h @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2013 Google, Inc. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef _VIDEO_ADF_FBDEV_H_ +#define _VIDEO_ADF_FBDEV_H_ + +#include <linux/fb.h> +#include <video/adf.h> + +struct adf_fbdev { + struct adf_interface *intf; + struct adf_overlay_engine *eng; + struct fb_info *info; + u32 pseudo_palette[16]; + + bool open; + + struct dma_buf *dma_buf; + u32 offset; + u32 pitch; + void *vaddr; + u32 format; + + u16 default_xres_virtual; + u16 default_yres_virtual; + u32 default_format; +}; + +void adf_modeinfo_to_fb_videomode(const struct drm_mode_modeinfo *mode, + struct fb_videomode *vmode); +void adf_modeinfo_from_fb_videomode(const struct fb_videomode *vmode, + struct drm_mode_modeinfo *mode); + +int adf_fbdev_init(struct adf_fbdev *fbdev, struct adf_interface *interface, + struct adf_overlay_engine *eng, + u16 xres_virtual, u16 yres_virtual, u32 format, + struct fb_ops *fbops, const char *fmt, ...); +void adf_fbdev_destroy(struct adf_fbdev *fbdev); + +int adf_fbdev_open(struct fb_info *info, int user); +int adf_fbdev_release(struct fb_info *info, int user); +int adf_fbdev_check_var(struct fb_var_screeninfo *var, struct fb_info *info); +int adf_fbdev_set_par(struct fb_info *info); +int adf_fbdev_blank(int blank, struct fb_info *info); +int adf_fbdev_pan_display(struct fb_var_screeninfo *var, struct fb_info *info); +int adf_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma); + +#endif /* _VIDEO_ADF_FBDEV_H_ */ |