Tizen 2.1 base
[adaptation/xorg/driver/xserver-xorg-video-emulfb.git] / src / xv / fbdev_video.h
1 /**************************************************************************
2
3 xserver-xorg-video-emulfb
4
5 Copyright 2010 - 2011 Samsung Electronics co., Ltd. All Rights Reserved.
6
7 Contact: Boram Park <boram1288.park@samsung.com>
8
9 Permission is hereby granted, free of charge, to any person obtaining a
10 copy of this software and associated documentation files (the
11 "Software"), to deal in the Software without restriction, including
12 without limitation the rights to use, copy, modify, merge, publish,
13 distribute, sub license, and/or sell copies of the Software, and to
14 permit persons to whom the Software is furnished to do so, subject to
15 the following conditions:
16
17 The above copyright notice and this permission notice (including the
18 next paragraph) shall be included in all copies or substantial portions
19 of the Software.
20
21 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
24 IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
25 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
26 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
29 **************************************************************************/
30 #ifndef FBDEV_VIDEO_H
31 #define FBDEV_VIDEO_H
32
33 typedef enum
34 {
35         PORT_MODE_INIT,
36         PORT_MODE_V4L2,
37         PORT_MODE_WAITING
38 } FBDevPortMode;
39
40 /* FBDEV port information structure */
41 typedef struct
42 {
43         int index;
44         FBDevPortMode mode;
45         int drawing;
46         int size;
47
48         RegionRec clip;
49
50         int rotate;
51         int hflip;
52         int vflip;
53         xRectangle    dst;
54         RegionRec     clipBoxes;
55         int preemption;    /* 1:high, 0:default, -1:low */
56         DrawablePtr pDraw;
57
58         int   v4l2_index;
59         void *v4l2_handle;
60
61         int need_streamon;
62 } FBDevPortPriv, *FBDevPortPrivPtr;
63
64 extern Bool fbdevVideoInit (ScreenPtr pScreen);
65 extern void fbdevVideoFini (ScreenPtr pScreen);
66 int fbdevVideoQueryImageAttributes (ScrnInfoPtr pScrnInfo,
67                                     int            id,
68                                     unsigned short *w,
69                                     unsigned short *h,
70                                     int            *pitches,
71                                     int            *offsets);
72
73 void fbdevVideoSetOffset (ScrnInfoPtr pScrnInfo, int x, int y);
74 void fbdevVideoGetV4l2Handles (ScrnInfoPtr pScrnInfo, void ***handles, int *cnt);
75
76 #endif // FBDEV_VIDEO_H