diff options
author | Ishan Mittal <imittal@nvidia.com> | 2014-05-15 18:21:20 +0530 |
---|---|---|
committer | Ishan Mittal <imittal@nvidia.com> | 2014-05-29 12:41:59 +0530 |
commit | 75c1032e7b6215de41e451a01033a342372105d4 (patch) | |
tree | 54fe571dd5a1c1e69f93c219e1cdf9c072e87d88 /include/video | |
parent | c436d07ff6b15f6540e7468c7c793ef15e55a921 (diff) | |
parent | c4db79235d21ba1dcd10d42154910ac1ba8e3ed3 (diff) |
Merge branch 'android-3.10' into rel-21
Bug 200004122
Bug 1511804
This merge takes AOSP commits from android-3.10 branch
Change-Id: I07ec2468114db0366d63777142c9572bbfadbc45
Signed-off-by: Ishan Mittal <imittal@nvidia.com>
Diffstat (limited to 'include/video')
-rw-r--r-- | include/video/adf.h | 18 | ||||
-rw-r--r-- | include/video/adf_fbdev.h | 67 |
2 files changed, 84 insertions, 1 deletions
diff --git a/include/video/adf.h b/include/video/adf.h index 2b742ab463dd..34f10e538f9e 100644 --- a/include/video/adf.h +++ b/include/video/adf.h @@ -193,10 +193,26 @@ struct adf_obj { }; /** + * struct adf_device_quirks - common display device quirks + * + * @buffer_padding: whether the last scanline of a buffer extends to the + * buffer's pitch (@ADF_BUFFER_PADDED_TO_PITCH) or just to the visible + * width (@ADF_BUFFER_UNPADDED) + */ +struct adf_device_quirks { + /* optional, defaults to ADF_BUFFER_PADDED_TO_PITCH */ + enum { + ADF_BUFFER_PADDED_TO_PITCH = 0, + ADF_BUFFER_UNPADDED = 1, + } buffer_padding; +}; + +/** * struct adf_device_ops - display device implementation ops * * @owner: device's module * @base: common operations (see &struct adf_obj_ops) + * @quirks: device's quirks (see &struct adf_device_quirks) * * @attach: attach overlay engine @eng to interface @intf. Return 0 on success * or error code (<0) on failure. @@ -228,6 +244,8 @@ struct adf_device_ops { /* required */ struct module *owner; const struct adf_obj_ops base; + /* optional */ + const struct adf_device_quirks quirks; /* optional */ int (*attach)(struct adf_device *dev, struct adf_overlay_engine *eng, diff --git a/include/video/adf_fbdev.h b/include/video/adf_fbdev.h index 9c349144b5cd..b722c6b3ab02 100644 --- a/include/video/adf_fbdev.h +++ b/include/video/adf_fbdev.h @@ -16,6 +16,7 @@ #define _VIDEO_ADF_FBDEV_H_ #include <linux/fb.h> +#include <linux/mutex.h> #include <video/adf.h> struct adf_fbdev { @@ -24,7 +25,8 @@ struct adf_fbdev { struct fb_info *info; u32 pseudo_palette[16]; - bool open; + unsigned int refcount; + struct mutex refcount_lock; struct dma_buf *dma_buf; u32 offset; @@ -37,6 +39,7 @@ struct adf_fbdev { u32 default_format; }; +#if IS_ENABLED(CONFIG_ADF_FBDEV) 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, @@ -55,5 +58,67 @@ 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); +#else +static inline void adf_modeinfo_to_fb_videomode(const struct drm_mode_modeinfo *mode, + struct fb_videomode *vmode) +{ + WARN_ONCE(1, "%s: CONFIG_ADF_FBDEV is disabled\n", __func__); +} + +static inline void adf_modeinfo_from_fb_videomode(const struct fb_videomode *vmode, + struct drm_mode_modeinfo *mode) +{ + WARN_ONCE(1, "%s: CONFIG_ADF_FBDEV is disabled\n", __func__); +} + +static inline 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, ...) +{ + return -ENODEV; +} + +static inline void adf_fbdev_destroy(struct adf_fbdev *fbdev) { } + +static inline int adf_fbdev_open(struct fb_info *info, int user) +{ + return -ENODEV; +} + +static inline int adf_fbdev_release(struct fb_info *info, int user) +{ + return -ENODEV; +} + +static inline int adf_fbdev_check_var(struct fb_var_screeninfo *var, + struct fb_info *info) +{ + return -ENODEV; +} + +static inline int adf_fbdev_set_par(struct fb_info *info) +{ + return -ENODEV; +} + +static inline int adf_fbdev_blank(int blank, struct fb_info *info) +{ + return -ENODEV; +} + +static inline int adf_fbdev_pan_display(struct fb_var_screeninfo *var, + struct fb_info *info) +{ + return -ENODEV; +} + +static inline int adf_fbdev_mmap(struct fb_info *info, + struct vm_area_struct *vma) +{ + return -ENODEV; +} +#endif #endif /* _VIDEO_ADF_FBDEV_H_ */ |