Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
0002 /*
0003  * File: include/linux/omapfb.h
0004  *
0005  * Framebuffer driver for TI OMAP boards
0006  *
0007  * Copyright (C) 2004 Nokia Corporation
0008  * Author: Imre Deak <imre.deak@nokia.com>
0009  *
0010  * This program is free software; you can redistribute it and/or modify it
0011  * under the terms of the GNU General Public License as published by the
0012  * Free Software Foundation; either version 2 of the License, or (at your
0013  * option) any later version.
0014  *
0015  * This program is distributed in the hope that it will be useful, but
0016  * WITHOUT ANY WARRANTY; without even the implied warranty of
0017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0018  * General Public License for more details.
0019  *
0020  * You should have received a copy of the GNU General Public License along
0021  * with this program; if not, write to the Free Software Foundation, Inc.,
0022  * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
0023  */
0024 
0025 #ifndef _UAPI__LINUX_OMAPFB_H__
0026 #define _UAPI__LINUX_OMAPFB_H__
0027 
0028 #include <linux/fb.h>
0029 #include <linux/ioctl.h>
0030 #include <linux/types.h>
0031 
0032 /* IOCTL commands. */
0033 
0034 #define OMAP_IOW(num, dtype)    _IOW('O', num, dtype)
0035 #define OMAP_IOR(num, dtype)    _IOR('O', num, dtype)
0036 #define OMAP_IOWR(num, dtype)   _IOWR('O', num, dtype)
0037 #define OMAP_IO(num)        _IO('O', num)
0038 
0039 #define OMAPFB_MIRROR       OMAP_IOW(31, int)
0040 #define OMAPFB_SYNC_GFX     OMAP_IO(37)
0041 #define OMAPFB_VSYNC        OMAP_IO(38)
0042 #define OMAPFB_SET_UPDATE_MODE  OMAP_IOW(40, int)
0043 #define OMAPFB_GET_CAPS     OMAP_IOR(42, struct omapfb_caps)
0044 #define OMAPFB_GET_UPDATE_MODE  OMAP_IOW(43, int)
0045 #define OMAPFB_LCD_TEST     OMAP_IOW(45, int)
0046 #define OMAPFB_CTRL_TEST    OMAP_IOW(46, int)
0047 #define OMAPFB_UPDATE_WINDOW_OLD OMAP_IOW(47, struct omapfb_update_window_old)
0048 #define OMAPFB_SET_COLOR_KEY    OMAP_IOW(50, struct omapfb_color_key)
0049 #define OMAPFB_GET_COLOR_KEY    OMAP_IOW(51, struct omapfb_color_key)
0050 #define OMAPFB_SETUP_PLANE  OMAP_IOW(52, struct omapfb_plane_info)
0051 #define OMAPFB_QUERY_PLANE  OMAP_IOW(53, struct omapfb_plane_info)
0052 #define OMAPFB_UPDATE_WINDOW    OMAP_IOW(54, struct omapfb_update_window)
0053 #define OMAPFB_SETUP_MEM    OMAP_IOW(55, struct omapfb_mem_info)
0054 #define OMAPFB_QUERY_MEM    OMAP_IOW(56, struct omapfb_mem_info)
0055 #define OMAPFB_WAITFORVSYNC OMAP_IO(57)
0056 #define OMAPFB_MEMORY_READ  OMAP_IOR(58, struct omapfb_memory_read)
0057 #define OMAPFB_GET_OVERLAY_COLORMODE OMAP_IOR(59, struct omapfb_ovl_colormode)
0058 #define OMAPFB_WAITFORGO    OMAP_IO(60)
0059 #define OMAPFB_GET_VRAM_INFO    OMAP_IOR(61, struct omapfb_vram_info)
0060 #define OMAPFB_SET_TEARSYNC OMAP_IOW(62, struct omapfb_tearsync_info)
0061 #define OMAPFB_GET_DISPLAY_INFO OMAP_IOR(63, struct omapfb_display_info)
0062 
0063 #define OMAPFB_CAPS_GENERIC_MASK    0x00000fff
0064 #define OMAPFB_CAPS_LCDC_MASK       0x00fff000
0065 #define OMAPFB_CAPS_PANEL_MASK      0xff000000
0066 
0067 #define OMAPFB_CAPS_MANUAL_UPDATE   0x00001000
0068 #define OMAPFB_CAPS_TEARSYNC        0x00002000
0069 #define OMAPFB_CAPS_PLANE_RELOCATE_MEM  0x00004000
0070 #define OMAPFB_CAPS_PLANE_SCALE     0x00008000
0071 #define OMAPFB_CAPS_WINDOW_PIXEL_DOUBLE 0x00010000
0072 #define OMAPFB_CAPS_WINDOW_SCALE    0x00020000
0073 #define OMAPFB_CAPS_WINDOW_OVERLAY  0x00040000
0074 #define OMAPFB_CAPS_WINDOW_ROTATE   0x00080000
0075 #define OMAPFB_CAPS_SET_BACKLIGHT   0x01000000
0076 
0077 /* Values from DSP must map to lower 16-bits */
0078 #define OMAPFB_FORMAT_MASK      0x00ff
0079 #define OMAPFB_FORMAT_FLAG_DOUBLE   0x0100
0080 #define OMAPFB_FORMAT_FLAG_TEARSYNC 0x0200
0081 #define OMAPFB_FORMAT_FLAG_FORCE_VSYNC  0x0400
0082 #define OMAPFB_FORMAT_FLAG_ENABLE_OVERLAY   0x0800
0083 #define OMAPFB_FORMAT_FLAG_DISABLE_OVERLAY  0x1000
0084 
0085 #define OMAPFB_MEMTYPE_SDRAM        0
0086 #define OMAPFB_MEMTYPE_SRAM     1
0087 #define OMAPFB_MEMTYPE_MAX      1
0088 
0089 #define OMAPFB_MEM_IDX_ENABLED  0x80
0090 #define OMAPFB_MEM_IDX_MASK 0x7f
0091 
0092 enum omapfb_color_format {
0093     OMAPFB_COLOR_RGB565 = 0,
0094     OMAPFB_COLOR_YUV422,
0095     OMAPFB_COLOR_YUV420,
0096     OMAPFB_COLOR_CLUT_8BPP,
0097     OMAPFB_COLOR_CLUT_4BPP,
0098     OMAPFB_COLOR_CLUT_2BPP,
0099     OMAPFB_COLOR_CLUT_1BPP,
0100     OMAPFB_COLOR_RGB444,
0101     OMAPFB_COLOR_YUY422,
0102 
0103     OMAPFB_COLOR_ARGB16,
0104     OMAPFB_COLOR_RGB24U,    /* RGB24, 32-bit container */
0105     OMAPFB_COLOR_RGB24P,    /* RGB24, 24-bit container */
0106     OMAPFB_COLOR_ARGB32,
0107     OMAPFB_COLOR_RGBA32,
0108     OMAPFB_COLOR_RGBX32,
0109 };
0110 
0111 struct omapfb_update_window {
0112     __u32 x, y;
0113     __u32 width, height;
0114     __u32 format;
0115     __u32 out_x, out_y;
0116     __u32 out_width, out_height;
0117     __u32 reserved[8];
0118 };
0119 
0120 struct omapfb_update_window_old {
0121     __u32 x, y;
0122     __u32 width, height;
0123     __u32 format;
0124 };
0125 
0126 enum omapfb_plane {
0127     OMAPFB_PLANE_GFX = 0,
0128     OMAPFB_PLANE_VID1,
0129     OMAPFB_PLANE_VID2,
0130 };
0131 
0132 enum omapfb_channel_out {
0133     OMAPFB_CHANNEL_OUT_LCD = 0,
0134     OMAPFB_CHANNEL_OUT_DIGIT,
0135 };
0136 
0137 struct omapfb_plane_info {
0138     __u32 pos_x;
0139     __u32 pos_y;
0140     __u8  enabled;
0141     __u8  channel_out;
0142     __u8  mirror;
0143     __u8  mem_idx;
0144     __u32 out_width;
0145     __u32 out_height;
0146     __u32 reserved2[12];
0147 };
0148 
0149 struct omapfb_mem_info {
0150     __u32 size;
0151     __u8  type;
0152     __u8  reserved[3];
0153 };
0154 
0155 struct omapfb_caps {
0156     __u32 ctrl;
0157     __u32 plane_color;
0158     __u32 wnd_color;
0159 };
0160 
0161 enum omapfb_color_key_type {
0162     OMAPFB_COLOR_KEY_DISABLED = 0,
0163     OMAPFB_COLOR_KEY_GFX_DST,
0164     OMAPFB_COLOR_KEY_VID_SRC,
0165 };
0166 
0167 struct omapfb_color_key {
0168     __u8  channel_out;
0169     __u32 background;
0170     __u32 trans_key;
0171     __u8  key_type;
0172 };
0173 
0174 enum omapfb_update_mode {
0175     OMAPFB_UPDATE_DISABLED = 0,
0176     OMAPFB_AUTO_UPDATE,
0177     OMAPFB_MANUAL_UPDATE
0178 };
0179 
0180 struct omapfb_memory_read {
0181     __u16 x;
0182     __u16 y;
0183     __u16 w;
0184     __u16 h;
0185     size_t buffer_size;
0186     void __user *buffer;
0187 };
0188 
0189 struct omapfb_ovl_colormode {
0190     __u8 overlay_idx;
0191     __u8 mode_idx;
0192     __u32 bits_per_pixel;
0193     __u32 nonstd;
0194     struct fb_bitfield red;
0195     struct fb_bitfield green;
0196     struct fb_bitfield blue;
0197     struct fb_bitfield transp;
0198 };
0199 
0200 struct omapfb_vram_info {
0201     __u32 total;
0202     __u32 free;
0203     __u32 largest_free_block;
0204     __u32 reserved[5];
0205 };
0206 
0207 struct omapfb_tearsync_info {
0208     __u8 enabled;
0209     __u8 reserved1[3];
0210     __u16 line;
0211     __u16 reserved2;
0212 };
0213 
0214 struct omapfb_display_info {
0215     __u16 xres;
0216     __u16 yres;
0217     __u32 width;    /* phys width of the display in micrometers */
0218     __u32 height;   /* phys height of the display in micrometers */
0219     __u32 reserved[5];
0220 };
0221 
0222 
0223 #endif /* _UAPI__LINUX_OMAPFB_H__ */