diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2016-12-28 09:41:37 +0300 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2017-01-28 05:17:40 +0300 |
commit | 98ae9869d187ab737b5b231e7879d15e1e9a763d (patch) | |
tree | a70a2d240e7cb20ec43e58f9ef3b558c4678cb4d /drivers/gpu/drm/zte/zx_plane.h | |
parent | 83d7115250c181da6dacd187671e174f8be71dfd (diff) | |
download | linux-98ae9869d187ab737b5b231e7879d15e1e9a763d.tar.xz |
drm: zte: make zx_plane accessible from zx_vou driver
Move struct zx_plane from zx_plane.c to zx_plane.h, so that it can be
accessed from zx_vou driver, and we can save the use of struct
zx_layer_data completely. More importantly, those additional data used
by VOU controller to enable/disable graphic and video layers can later
be added and accessed much more easily from zx_vou driver.
While at it, we make two changes to zx_plane_init() interface:
- Encode struct device pointer in zx_plane, so that we do not need to
pass it as a parameter.
- Change return of zx_plane_init() from struct drm_plane pointer to
error code, since we can get the pointer from zx_plane in zx_vou
driver now.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Diffstat (limited to 'drivers/gpu/drm/zte/zx_plane.h')
-rw-r--r-- | drivers/gpu/drm/zte/zx_plane.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/gpu/drm/zte/zx_plane.h b/drivers/gpu/drm/zte/zx_plane.h index 2b82cd558d9d..264a92e0b532 100644 --- a/drivers/gpu/drm/zte/zx_plane.h +++ b/drivers/gpu/drm/zte/zx_plane.h @@ -11,16 +11,19 @@ #ifndef __ZX_PLANE_H__ #define __ZX_PLANE_H__ -struct zx_layer_data { +struct zx_plane { + struct drm_plane plane; + struct device *dev; void __iomem *layer; void __iomem *csc; void __iomem *hbsc; void __iomem *rsz; }; -struct drm_plane *zx_plane_init(struct drm_device *drm, struct device *dev, - struct zx_layer_data *data, - enum drm_plane_type type); +#define to_zx_plane(plane) container_of(plane, struct zx_plane, plane) + +int zx_plane_init(struct drm_device *drm, struct zx_plane *zplane, + enum drm_plane_type type); void zx_plane_set_update(struct drm_plane *plane); #endif /* __ZX_PLANE_H__ */ |