Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
g2d.h
Go to the documentation of this file.
1 /*
2  * Samsung S5P G2D - 2D Graphics Accelerator Driver
3  *
4  * Copyright (c) 2011 Samsung Electronics Co., Ltd.
5  * Kamil Debski, <[email protected]>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by the
9  * Free Software Foundation; either version 2 of the
10  * License, or (at your option) any later version
11  */
12 
13 #include <media/v4l2-device.h>
14 #include <media/v4l2-ctrls.h>
15 
16 #define G2D_NAME "s5p-g2d"
17 
18 struct g2d_dev {
21  struct video_device *vfd;
22  struct mutex mutex;
25  struct vb2_alloc_ctx *alloc_ctx;
26  void __iomem *regs;
27  struct clk *clk;
28  struct clk *gate;
29  struct g2d_ctx *curr;
30  int irq;
32 };
33 
34 struct g2d_frame {
35  /* Original dimensions */
38  /* Crop size */
41  /* Offset */
44  /* Image format */
45  struct g2d_fmt *fmt;
46  /* Variables that can calculated once and reused */
51 };
52 
53 struct g2d_ctx {
54  struct v4l2_fh fh;
55  struct g2d_dev *dev;
57  struct g2d_frame in;
58  struct g2d_frame out;
64 };
65 
66 struct g2d_fmt {
67  char *name;
69  int depth;
71 };
72 
73 
74 void g2d_reset(struct g2d_dev *d);
75 void g2d_set_src_size(struct g2d_dev *d, struct g2d_frame *f);
76 void g2d_set_src_addr(struct g2d_dev *d, dma_addr_t a);
77 void g2d_set_dst_size(struct g2d_dev *d, struct g2d_frame *f);
78 void g2d_set_dst_addr(struct g2d_dev *d, dma_addr_t a);
79 void g2d_start(struct g2d_dev *d);
80 void g2d_clear_int(struct g2d_dev *d);
81 void g2d_set_rop4(struct g2d_dev *d, u32 r);
82 void g2d_set_flip(struct g2d_dev *d, u32 r);
84 void g2d_set_cmd(struct g2d_dev *d, u32 c);
85 
86