]> git.karo-electronics.de Git - karo-tx-linux.git/blob - drivers/gpu/drm/rcar-du/rcar_du_plane.h
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[karo-tx-linux.git] / drivers / gpu / drm / rcar-du / rcar_du_plane.h
1 /*
2  * rcar_du_plane.h  --  R-Car Display Unit Planes
3  *
4  * Copyright (C) 2013 Renesas Corporation
5  *
6  * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  */
13
14 #ifndef __RCAR_DU_PLANE_H__
15 #define __RCAR_DU_PLANE_H__
16
17 struct drm_crtc;
18 struct drm_framebuffer;
19 struct rcar_du_device;
20 struct rcar_du_format_info;
21
22 /* The RCAR DU has 8 hardware planes, shared between KMS planes and CRTCs. As
23  * using KMS planes requires at least one of the CRTCs being enabled, no more
24  * than 7 KMS planes can be available. We thus create 7 KMS planes and
25  * 9 software planes (one for each KMS planes and one for each CRTC).
26  */
27
28 #define RCAR_DU_NUM_KMS_PLANES          7
29 #define RCAR_DU_NUM_HW_PLANES           8
30 #define RCAR_DU_NUM_SW_PLANES           9
31
32 struct rcar_du_plane {
33         struct rcar_du_device *dev;
34         struct drm_crtc *crtc;
35
36         bool enabled;
37
38         int hwindex;            /* 0-based, -1 means unused */
39         unsigned int alpha;
40         unsigned int colorkey;
41         unsigned int zpos;
42
43         const struct rcar_du_format_info *format;
44
45         unsigned long dma[2];
46         unsigned int pitch;
47
48         unsigned int width;
49         unsigned int height;
50
51         unsigned int src_x;
52         unsigned int src_y;
53         unsigned int dst_x;
54         unsigned int dst_y;
55 };
56
57 int rcar_du_plane_init(struct rcar_du_device *rcdu);
58 int rcar_du_plane_register(struct rcar_du_device *rcdu);
59 void rcar_du_plane_setup(struct rcar_du_plane *plane);
60 void rcar_du_plane_update_base(struct rcar_du_plane *plane);
61 void rcar_du_plane_compute_base(struct rcar_du_plane *plane,
62                                 struct drm_framebuffer *fb);
63 int rcar_du_plane_reserve(struct rcar_du_plane *plane,
64                           const struct rcar_du_format_info *format);
65 void rcar_du_plane_release(struct rcar_du_plane *plane);
66
67 #endif /* __RCAR_DU_PLANE_H__ */