Greg Hackmann | 16a2abf | 2012-05-29 13:14:45 -0700 | [diff] [blame] | 1 | /* include/linux/s3c-fb.h |
| 2 | * |
| 3 | * Copyright 2008 Openmoko Inc. |
| 4 | * Copyright 2008-2010 Simtec Electronics |
| 5 | * Ben Dooks <ben@simtec.co.uk> |
| 6 | * http://armlinux.simtec.co.uk/ |
| 7 | * |
| 8 | * Samsung SoC Framebuffer driver |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License version 2 as |
| 12 | * published by the Free Software FoundatIon. |
| 13 | */ |
| 14 | |
| 15 | #ifndef __S3C_FB_H__ |
| 16 | #define __S3C_FB_H__ |
| 17 | |
| 18 | struct s3c_fb_user_window { |
| 19 | int x; |
| 20 | int y; |
| 21 | }; |
| 22 | |
| 23 | struct s3c_fb_user_plane_alpha { |
| 24 | int channel; |
| 25 | unsigned char red; |
| 26 | unsigned char green; |
| 27 | unsigned char blue; |
| 28 | }; |
| 29 | |
| 30 | struct s3c_fb_user_chroma { |
| 31 | int enabled; |
| 32 | unsigned char red; |
| 33 | unsigned char green; |
| 34 | unsigned char blue; |
| 35 | }; |
| 36 | |
| 37 | struct s3c_fb_user_ion_client { |
| 38 | int fd; |
| 39 | int offset; |
| 40 | }; |
| 41 | |
| 42 | enum s3c_fb_pixel_format { |
| 43 | S3C_FB_PIXEL_FORMAT_RGBA_8888 = 0, |
| 44 | S3C_FB_PIXEL_FORMAT_RGB_888 = 1, |
| 45 | S3C_FB_PIXEL_FORMAT_RGB_565 = 2, |
| 46 | S3C_FB_PIXEL_FORMAT_BGRA_8888 = 3, |
| 47 | S3C_FB_PIXEL_FORMAT_RGBA_5551 = 4, |
| 48 | S3C_FB_PIXEL_FORMAT_RGBA_4444 = 5, |
| 49 | S3C_FB_PIXEL_FORMAT_MAX = 6, |
| 50 | }; |
| 51 | |
| 52 | struct s3c_fb_win_config { |
| 53 | enum { |
| 54 | S3C_FB_WIN_STATE_DISABLED = 0, |
| 55 | S3C_FB_WIN_STATE_COLOR, |
| 56 | S3C_FB_WIN_STATE_BUFFER, |
| 57 | } state; |
| 58 | |
| 59 | union { |
| 60 | __u32 color; |
| 61 | struct { |
| 62 | int fd; |
| 63 | __u32 offset; |
| 64 | __u32 stride; |
| 65 | int x; |
| 66 | int y; |
| 67 | __u32 w; |
| 68 | __u32 h; |
| 69 | enum s3c_fb_pixel_format format; |
| 70 | }; |
| 71 | }; |
| 72 | }; |
| 73 | |
| 74 | /* S3C_FB_MAX_WIN |
| 75 | * Set to the maximum number of windows that any of the supported hardware |
| 76 | * can use. Since the platform data uses this for an array size, having it |
| 77 | * set to the maximum of any version of the hardware can do is safe. |
| 78 | */ |
| 79 | #define S3C_FB_MAX_WIN (5) |
| 80 | |
| 81 | struct s3c_fb_win_config_data { |
| 82 | int fence; |
| 83 | struct s3c_fb_win_config config[S3C_FB_MAX_WIN]; |
| 84 | }; |
| 85 | |
| 86 | /* IOCTL commands */ |
| 87 | #define S3CFB_WIN_POSITION _IOW('F', 203, \ |
| 88 | struct s3c_fb_user_window) |
| 89 | #define S3CFB_WIN_SET_PLANE_ALPHA _IOW('F', 204, \ |
| 90 | struct s3c_fb_user_plane_alpha) |
| 91 | #define S3CFB_WIN_SET_CHROMA _IOW('F', 205, \ |
| 92 | struct s3c_fb_user_chroma) |
| 93 | #define S3CFB_SET_VSYNC_INT _IOW('F', 206, u32) |
| 94 | |
| 95 | #define S3CFB_GET_ION_USER_HANDLE _IOWR('F', 208, \ |
| 96 | struct s3c_fb_user_ion_client) |
| 97 | #define S3CFB_WIN_CONFIG _IOW('F', 209, \ |
| 98 | struct s3c_fb_win_config_data) |
| 99 | |
| 100 | #endif /* __S3C_FB_H__ */ |