diff options
author | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2015-04-03 15:03:40 +0300 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2015-04-13 05:39:39 +0300 |
commit | 7ee14cdcbc4f813b9c5875d6e8e3daef71c366b3 (patch) | |
tree | 2c65b033db13c2ed7175f511fc773dfa6a5ee812 /drivers/gpu/drm/exynos/exynos_drm_plane.c | |
parent | 1be4b7ee800a57ca613131304e01cd91ec8bca2a (diff) | |
download | linux-7ee14cdcbc4f813b9c5875d6e8e3daef71c366b3.tar.xz |
drm/exynos: remove struct *_win_data abstraction on planes
struct {fimd,mixer,vidi}_win_data was just keeping the same data
as struct exynos_drm_plane thus get ride of it and use exynos_drm_plane
directly.
It changes how planes are created and remove .win_mode_set() callback
that was only filling all *_win_data structs.
v2: check for return of exynos_plane_init()
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_plane.c')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_plane.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index 8ad5b7294eb4..4014c746a534 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -92,7 +92,6 @@ void exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc, uint32_t src_w, uint32_t src_h) { struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); - struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); unsigned int actual_w; unsigned int actual_h; @@ -139,9 +138,6 @@ void exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc, exynos_plane->crtc_width, exynos_plane->crtc_height); plane->crtc = crtc; - - if (exynos_crtc->ops->win_mode_set) - exynos_crtc->ops->win_mode_set(exynos_crtc, exynos_plane); } int @@ -184,11 +180,8 @@ static int exynos_disable_plane(struct drm_plane *plane) static void exynos_plane_destroy(struct drm_plane *plane) { - struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); - exynos_disable_plane(plane); drm_plane_cleanup(plane); - kfree(exynos_plane); } static int exynos_plane_set_property(struct drm_plane *plane, @@ -233,24 +226,18 @@ static void exynos_plane_attach_zpos_property(struct drm_plane *plane) drm_object_attach_property(&plane->base, prop, 0); } -struct drm_plane *exynos_plane_init(struct drm_device *dev, - unsigned long possible_crtcs, - enum drm_plane_type type) +int exynos_plane_init(struct drm_device *dev, + struct exynos_drm_plane *exynos_plane, + unsigned long possible_crtcs, enum drm_plane_type type) { - struct exynos_drm_plane *exynos_plane; int err; - exynos_plane = kzalloc(sizeof(struct exynos_drm_plane), GFP_KERNEL); - if (!exynos_plane) - return ERR_PTR(-ENOMEM); - err = drm_universal_plane_init(dev, &exynos_plane->base, possible_crtcs, &exynos_plane_funcs, formats, ARRAY_SIZE(formats), type); if (err) { DRM_ERROR("failed to initialize plane\n"); - kfree(exynos_plane); - return ERR_PTR(err); + return err; } if (type == DRM_PLANE_TYPE_PRIMARY) @@ -258,5 +245,5 @@ struct drm_plane *exynos_plane_init(struct drm_device *dev, else exynos_plane_attach_zpos_property(&exynos_plane->base); - return &exynos_plane->base; + return 0; } |