drm/exynos: remove struct exynos_drm_manager
Subsystems (3)
cover drm/exynos: remove struct exynos_drm_manager
From: Gustavo Padovan <[email protected]>
Following the removal of struct exynos_drm_overlay we now remove the manager one as well. This remove another abstrastraction layer from exynos drm. We can now use known names like CRTC and Planes instead of manager and overlay.
This patchset along with the ones I sent before[0][1] also helps clear the path for the upcoming atomic modesetting work.
The patchset is based on the other 2 patchset. So be sure to apply them first or pick everything from here:
https://git.kernel.org/cgit/linux/kernel/git/padovan/drm-exynos.git/log/?h=cleanup-try2
[0] http://www.spinics.net/lists/linux-samsung-soc/msg39502.html
[1] http://www.spinics.net/lists/linux-samsung-soc/msg39614.html
Gustavo Padovan (6):
drm/exynos: rename base object of struct exynos_drm_crtc to 'base' drm/exynos: add pipe param to exynos_drm_crtc_create() drm/exynos: remove pipe member of struct exynos_drm_manager drm/exynos: move 'type' from manager to crtc struct drm/exynos: remove drm_dev from struct exynos_drm_manager drm/exynos: remove struct exynos_drm_manager
drivers/gpu/drm/exynos/exynos_drm_crtc.c | 82 +++++++++---------- drivers/gpu/drm/exynos/exynos_drm_crtc.h | 6 +- drivers/gpu/drm/exynos/exynos_drm_drv.h | 65 ++++++--------- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 127 ++++++++++++++---------------- drivers/gpu/drm/exynos/exynos_drm_plane.c | 26 +++--- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 85 +++++++++----------- drivers/gpu/drm/exynos/exynos_mixer.c | 109 ++++++++++++------------- 7 files changed, 234 insertions(+), 266 deletions(-)
Signature · 1 line
1.9.3
PATCH 1/6 drm/exynos: rename base object of struct exynos_drm_crtc to 'base'
From: Gustavo Padovan <[email protected]>
'base' is more widely used name in the drm subsystem for the base object.
--- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 4 ++-- drivers/gpu/drm/exynos/exynos_drm_drv.h | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_crtc.c +2 -2
@@ -324,8 +324,8 @@ int exynos_drm_crtc_create(struct exynos_drm_manager *manager) goto err_plane; } - manager->crtc = &exynos_crtc->drm_crtc; - crtc = &exynos_crtc->drm_crtc; + manager->crtc = &exynos_crtc->base; + crtc = &exynos_crtc->base; private->crtc[manager->pipe] = crtc;
drivers/gpu/drm/exynos/exynos_drm_drv.h +3 -4
@@ -23,8 +23,7 @@#define MAX_FB_BUFFER 4#define DEFAULT_ZPOS -1 -#define to_exynos_crtc (x) container_of(x, struct exynos_drm_crtc,\ - drm_crtc) +#define to_exynos_crtc (x) container_of(x, struct exynos_drm_crtc, base)#define to_exynos_plane (x) container_of(x, struct exynos_drm_plane, base)/* This enumerates device type. */
@@ -229,7 +228,7 @@ enum exynos_crtc_mode {/* * Exynos specific crtc structure. * -* @drm_crtc: crtc object. +* @base: crtc object. * @manager: the manager associated with this crtc * @pipe: a crtc index created at load() with a new crtc object creation * and the crtc object would be set to private->crtc array
@@ -242,7 +241,7 @@ enum exynos_crtc_mode {* @mode: store the crtc mode value */ struct exynos_drm_crtc { -struct drm_crtc drm_crtc; +struct drm_crtc base;struct exynos_drm_manager *manager;unsigned int pipe;unsigned int dpms;
Signature · 6 lines
1.9.3 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/6 drm/exynos: add pipe param to exynos_drm_crtc_create()
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
Get the pipe value from a parameter instead of getting it from manager->pipe. We are removing manager->pipe.
--- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 8 ++++---- drivers/gpu/drm/exynos/exynos_drm_crtc.h | 2 +- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 2 +- drivers/gpu/drm/exynos/exynos_mixer.c | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_crtc.c +4 -4
@@ -299,7 +299,7 @@ static void exynos_drm_crtc_attach_mode_property(struct drm_crtc *crtc)drm_object_attach_property (&crtc->base, prop,0 ); } -int exynos_drm_crtc_create (struct exynos_drm_manager *manager) +int exynos_drm_crtc_create (struct exynos_drm_manager *manager,int pipe) {struct exynos_drm_crtc *exynos_crtc;struct drm_plane *plane;
@@ -316,8 +316,8 @@ int exynos_drm_crtc_create(struct exynos_drm_manager *manager) exynos_crtc->dpms =DRM_MODE_DPMS_OFF ; exynos_crtc->manager = manager; - exynos_crtc->pipe = manager->pipe; - plane =exynos_plane_init (manager->drm_dev,1 << manager->pipe, + exynos_crtc->pipe = pipe; + plane =exynos_plane_init (manager->drm_dev,1 << pipe,DRM_PLANE_TYPE_PRIMARY );if (IS_ERR (plane)) { ret =PTR_ERR (plane);
@@ -327,7 +327,7 @@ int exynos_drm_crtc_create(struct exynos_drm_manager *manager) manager->crtc = &exynos_crtc->base; crtc = &exynos_crtc->base; - private->crtc[manager->pipe] = crtc; + private->crtc[pipe] = crtc; ret =drm_crtc_init_with_planes (manager->drm_dev, crtc, plane,NULL , &exynos_crtc_funcs);
drivers/gpu/drm/exynos/exynos_drm_crtc.h +1 -1
@@ -17,7 +17,7 @@#include "exynos_drm_drv.h" -int exynos_drm_crtc_create (struct exynos_drm_manager *manager); +int exynos_drm_crtc_create (struct exynos_drm_manager *manager,int pipe);int exynos_drm_crtc_enable_vblank (struct drm_device *dev,int pipe);void exynos_drm_crtc_disable_vblank (struct drm_device *dev,int pipe);void exynos_drm_crtc_finish_pageflip (struct drm_device *dev,int pipe);
drivers/gpu/drm/exynos/exynos_drm_fimd.c +1 -1
@@ -1102,7 +1102,7 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)struct drm_device *drm_dev = data;fimd_mgr_initialize (&ctx->manager, drm_dev); -exynos_drm_crtc_create (&ctx->manager); +exynos_drm_crtc_create (&ctx->manager, ctx->pipe);if (ctx->display)exynos_drm_create_enc_conn (drm_dev, ctx->display);
drivers/gpu/drm/exynos/exynos_drm_vidi.c +1 -1
@@ -558,7 +558,7 @@ static int vidi_bind(struct device *dev, struct device *master, void *data)vidi_mgr_initialize (&ctx->manager, drm_dev); - ret =exynos_drm_crtc_create (&ctx->manager); + ret =exynos_drm_crtc_create (&ctx->manager, ctx->pipe);if (ret) {DRM_ERROR ("failed to create crtc.\n" );return ret;
drivers/gpu/drm/exynos/exynos_mixer.c +1 -1
@@ -1256,7 +1256,7 @@ static int mixer_bind(struct device *dev, struct device *manager, void *data)if (ret)return ret; - ret =exynos_drm_crtc_create (&ctx->manager); + ret =exynos_drm_crtc_create (&ctx->manager, ctx->pipe);if (ret) {mixer_mgr_remove (&ctx->manager);return ret;
Signature · 6 lines
1.9.3 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 3/6 drm/exynos: remove pipe member of struct exynos_drm_manager
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
It is not longer used. This is part of the process of removing struct exynos_drm_manager entirely.
--- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_drv.h | 2 -- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 2 +- drivers/gpu/drm/exynos/exynos_mixer.c | 2 +- 5 files changed, 4 insertions(+), 6 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_crtc.c +1 -1
@@ -436,7 +436,7 @@ int exynos_drm_crtc_get_pipe_from_type(struct drm_device *drm_dev, exynos_crtc =to_exynos_crtc (crtc);if (exynos_crtc->manager->type == out_type) -return exynos_crtc->manager->pipe; +return exynos_crtc->pipe; }return -EPERM ;
drivers/gpu/drm/exynos/exynos_drm_drv.h +0 -2
@@ -207,7 +207,6 @@ struct exynos_drm_manager_ops {* @type: one of EXYNOS_DISPLAY_TYPE_LCD and HDMI. * @drm_dev: pointer to the drm device * @crtc: crtc object. -* @pipe: the pipe number for this crtc/manager * @ops: pointer to callbacks for exynos drm specific functionality * @ctx: A pointer to the manager's implementation specific context */
@@ -216,7 +215,6 @@ struct exynos_drm_manager {enum exynos_drm_output_type type;struct drm_device *drm_dev;struct drm_crtc *crtc; -int pipe;struct exynos_drm_manager_ops *ops; };
drivers/gpu/drm/exynos/exynos_drm_fimd.c +1 -1
@@ -300,7 +300,7 @@ static int fimd_mgr_initialize(struct exynos_drm_manager *mgr, priv = drm_dev->dev_private; mgr->drm_dev = ctx->drm_dev = drm_dev; - mgr->pipe = ctx->pipe = priv->pipe++; + ctx->pipe = priv->pipe++;/* attach this sub driver to iommu mapping if supported. */ if (is_drm_iommu_supported (ctx->drm_dev)) {
drivers/gpu/drm/exynos/exynos_drm_vidi.c +1 -1
@@ -302,7 +302,7 @@ static int vidi_mgr_initialize(struct exynos_drm_manager *mgr,struct exynos_drm_private *priv = drm_dev->dev_private; mgr->drm_dev = ctx->drm_dev = drm_dev; - mgr->pipe = ctx->pipe = priv->pipe++; + ctx->pipe = priv->pipe++;return 0 ; }
drivers/gpu/drm/exynos/exynos_mixer.c +1 -1
@@ -863,7 +863,7 @@ static int mixer_initialize(struct exynos_drm_manager *mgr, priv = drm_dev->dev_private; mgr->drm_dev = mixer_ctx->drm_dev = drm_dev; - mgr->pipe = mixer_ctx->pipe = priv->pipe++; + mixer_ctx->pipe = priv->pipe++;/* acquire resources: regs, irqs, clocks */ ret =mixer_resources_init (mixer_ctx);
Signature · 1 line
1.9.3
PATCH 4/6 drm/exynos: move 'type' from manager to crtc struct
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
'type' is now part of the struct exynos_drm_crtc. This is just another step in the struct exynos_drm_manager removal.
--- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 6 ++++-- drivers/gpu/drm/exynos/exynos_drm_crtc.h | 3 ++- drivers/gpu/drm/exynos/exynos_drm_drv.h | 4 ++-- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 6 +++--- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 6 +++--- drivers/gpu/drm/exynos/exynos_mixer.c | 6 +++--- 6 files changed, 17 insertions(+), 14 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_crtc.c +4 -2
@@ -299,7 +299,8 @@ static void exynos_drm_crtc_attach_mode_property(struct drm_crtc *crtc)drm_object_attach_property (&crtc->base, prop,0 ); } -int exynos_drm_crtc_create (struct exynos_drm_manager *manager,int pipe) +int exynos_drm_crtc_create (struct exynos_drm_manager *manager,int pipe, +enum exynos_drm_output_type type) {struct exynos_drm_crtc *exynos_crtc;struct drm_plane *plane;
@@ -317,6 +318,7 @@ int exynos_drm_crtc_create(struct exynos_drm_manager *manager, int pipe) exynos_crtc->dpms =DRM_MODE_DPMS_OFF ; exynos_crtc->manager = manager; exynos_crtc->pipe = pipe; + exynos_crtc->type = type; plane =exynos_plane_init (manager->drm_dev,1 << pipe,DRM_PLANE_TYPE_PRIMARY );if (IS_ERR (plane)) {
@@ -435,7 +437,7 @@ int exynos_drm_crtc_get_pipe_from_type(struct drm_device *drm_dev,struct exynos_drm_crtc *exynos_crtc; exynos_crtc =to_exynos_crtc (crtc); -if (exynos_crtc->manager->type == out_type) +if (exynos_crtc->type == out_type)return exynos_crtc->pipe; }
drivers/gpu/drm/exynos/exynos_drm_crtc.h +2 -1
@@ -17,7 +17,8 @@#include "exynos_drm_drv.h" -int exynos_drm_crtc_create (struct exynos_drm_manager *manager,int pipe); +int exynos_drm_crtc_create (struct exynos_drm_manager *manager,int pipe, +enum exynos_drm_output_type type);int exynos_drm_crtc_enable_vblank (struct drm_device *dev,int pipe);void exynos_drm_crtc_disable_vblank (struct drm_device *dev,int pipe);void exynos_drm_crtc_finish_pageflip (struct drm_device *dev,int pipe);
drivers/gpu/drm/exynos/exynos_drm_drv.h +2 -2
@@ -204,7 +204,6 @@ struct exynos_drm_manager_ops {* Exynos drm common manager structure, maps 1:1 with a crtc * * @list: the list entry for this manager -* @type: one of EXYNOS_DISPLAY_TYPE_LCD and HDMI. * @drm_dev: pointer to the drm device * @crtc: crtc object. * @ops: pointer to callbacks for exynos drm specific functionality
@@ -212,7 +211,6 @@ struct exynos_drm_manager_ops {*/ struct exynos_drm_manager {struct list_head list; -enum exynos_drm_output_type type;struct drm_device *drm_dev;struct drm_crtc *crtc;struct exynos_drm_manager_ops *ops;
@@ -228,6 +226,7 @@ enum exynos_crtc_mode {* * @base: crtc object. * @manager: the manager associated with this crtc +* @type: one of EXYNOS_DISPLAY_TYPE_LCD and HDMI. * @pipe: a crtc index created at load() with a new crtc object creation * and the crtc object would be set to private->crtc array * to get a crtc object corresponding to this pipe from private->crtc
@@ -241,6 +240,7 @@ enum exynos_crtc_mode {struct exynos_drm_crtc {struct drm_crtc base;struct exynos_drm_manager *manager; +enum exynos_drm_output_type type;unsigned int pipe;unsigned int dpms;enum exynos_crtc_mode mode;
drivers/gpu/drm/exynos/exynos_drm_fimd.c +3 -3
@@ -1102,7 +1102,8 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)struct drm_device *drm_dev = data;fimd_mgr_initialize (&ctx->manager, drm_dev); -exynos_drm_crtc_create (&ctx->manager, ctx->pipe); +exynos_drm_crtc_create (&ctx->manager, ctx->pipe, +EXYNOS_DISPLAY_TYPE_LCD );if (ctx->display)exynos_drm_create_enc_conn (drm_dev, ctx->display);
@@ -1143,11 +1144,10 @@ static int fimd_probe(struct platform_device *pdev)if (!ctx)return -ENOMEM ; - ctx->manager.type =EXYNOS_DISPLAY_TYPE_LCD ; ctx->manager.ops = &fimd_manager_ops; ret =exynos_drm_component_add (dev,EXYNOS_DEVICE_TYPE_CRTC , - ctx->manager.type); +EXYNOS_DISPLAY_TYPE_LCD );if (ret)return ret;
drivers/gpu/drm/exynos/exynos_drm_vidi.c +3 -3
@@ -558,7 +558,8 @@ static int vidi_bind(struct device *dev, struct device *master, void *data)vidi_mgr_initialize (&ctx->manager, drm_dev); - ret =exynos_drm_crtc_create (&ctx->manager, ctx->pipe); + ret =exynos_drm_crtc_create (&ctx->manager, ctx->pipe, +EXYNOS_DISPLAY_TYPE_VIDI );if (ret) {DRM_ERROR ("failed to create crtc.\n" );return ret;
@@ -593,7 +594,6 @@ static int vidi_probe(struct platform_device *pdev)if (!ctx)return -ENOMEM ; - ctx->manager.type =EXYNOS_DISPLAY_TYPE_VIDI ; ctx->manager.ops = &vidi_manager_ops; ctx->display.type =EXYNOS_DISPLAY_TYPE_VIDI ; ctx->display.ops = &vidi_display_ops;
@@ -601,7 +601,7 @@ static int vidi_probe(struct platform_device *pdev) ctx->pdev = pdev; ret =exynos_drm_component_add (&pdev->dev,EXYNOS_DEVICE_TYPE_CRTC , - ctx->manager.type); +EXYNOS_DISPLAY_TYPE_VIDI );if (ret)return ret;
drivers/gpu/drm/exynos/exynos_mixer.c +3 -3
@@ -1256,7 +1256,8 @@ static int mixer_bind(struct device *dev, struct device *manager, void *data)if (ret)return ret; - ret =exynos_drm_crtc_create (&ctx->manager, ctx->pipe); + ret =exynos_drm_crtc_create (&ctx->manager, ctx->pipe, +EXYNOS_DISPLAY_TYPE_HDMI );if (ret) {mixer_mgr_remove (&ctx->manager);return ret;
@@ -1296,7 +1297,6 @@ static int mixer_probe(struct platform_device *pdev)mutex_init (&ctx->mixer_mutex); - ctx->manager.type =EXYNOS_DISPLAY_TYPE_HDMI ; ctx->manager.ops = &mixer_manager_ops;if (dev->of_node) {
@@ -1320,7 +1320,7 @@ static int mixer_probe(struct platform_device *pdev)platform_set_drvdata (pdev, ctx); ret =exynos_drm_component_add (&pdev->dev,EXYNOS_DEVICE_TYPE_CRTC , - ctx->manager.type); +EXYNOS_DISPLAY_TYPE_HDMI );if (ret)return ret;
Signature · 1 line
1.9.3
PATCH 5/6 drm/exynos: remove drm_dev from struct exynos_drm_manager
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
manager-drm_dev is only accessed by exynos_drm_crtc_create() so this patch pass drm_dev as argument on exynos_drm_crtc_create() and remove it from struct exynos_drm_manager.
--- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 9 +++++---- drivers/gpu/drm/exynos/exynos_drm_crtc.h | 3 ++- drivers/gpu/drm/exynos/exynos_drm_drv.h | 1 - drivers/gpu/drm/exynos/exynos_drm_fimd.c | 4 ++-- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 4 ++-- drivers/gpu/drm/exynos/exynos_mixer.c | 4 ++-- 6 files changed, 13 insertions(+), 12 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_crtc.c +5 -4
@@ -299,12 +299,13 @@ static void exynos_drm_crtc_attach_mode_property(struct drm_crtc *crtc)drm_object_attach_property (&crtc->base, prop,0 ); } -int exynos_drm_crtc_create (struct exynos_drm_manager *manager,int pipe, +int exynos_drm_crtc_create (struct exynos_drm_manager *manager, +struct drm_device *drm_dev,int pipe,enum exynos_drm_output_type type) {struct exynos_drm_crtc *exynos_crtc;struct drm_plane *plane; -struct exynos_drm_private *private = manager->drm_dev->dev_private; +struct exynos_drm_private *private = drm_dev->dev_private;struct drm_crtc *crtc;int ret;
@@ -319,7 +320,7 @@ int exynos_drm_crtc_create(struct exynos_drm_manager *manager, int pipe, exynos_crtc->manager = manager; exynos_crtc->pipe = pipe; exynos_crtc->type = type; - plane =exynos_plane_init (manager->drm_dev,1 << pipe, + plane =exynos_plane_init (drm_dev,1 << pipe,DRM_PLANE_TYPE_PRIMARY );if (IS_ERR (plane)) { ret =PTR_ERR (plane);
@@ -331,7 +332,7 @@ int exynos_drm_crtc_create(struct exynos_drm_manager *manager, int pipe, private->crtc[pipe] = crtc; - ret =drm_crtc_init_with_planes (manager->drm_dev, crtc, plane,NULL , + ret =drm_crtc_init_with_planes (drm_dev, crtc, plane,NULL , &exynos_crtc_funcs);if (ret <0 ) goto err_crtc;
drivers/gpu/drm/exynos/exynos_drm_crtc.h +2 -1
@@ -17,7 +17,8 @@#include "exynos_drm_drv.h" -int exynos_drm_crtc_create (struct exynos_drm_manager *manager,int pipe, +int exynos_drm_crtc_create (struct exynos_drm_manager *manager, +struct drm_device *drm_dev,int pipe,enum exynos_drm_output_type type);int exynos_drm_crtc_enable_vblank (struct drm_device *dev,int pipe);void exynos_drm_crtc_disable_vblank (struct drm_device *dev,int pipe);
drivers/gpu/drm/exynos/exynos_drm_drv.h +0 -1
@@ -211,7 +211,6 @@ struct exynos_drm_manager_ops {*/ struct exynos_drm_manager {struct list_head list; -struct drm_device *drm_dev;struct drm_crtc *crtc;struct exynos_drm_manager_ops *ops; };
drivers/gpu/drm/exynos/exynos_drm_fimd.c +2 -2
@@ -299,7 +299,7 @@ static int fimd_mgr_initialize(struct exynos_drm_manager *mgr,struct exynos_drm_private *priv; priv = drm_dev->dev_private; - mgr->drm_dev = ctx->drm_dev = drm_dev; + ctx->drm_dev = drm_dev; ctx->pipe = priv->pipe++;/* attach this sub driver to iommu mapping if supported. */
@@ -1102,7 +1102,7 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)struct drm_device *drm_dev = data;fimd_mgr_initialize (&ctx->manager, drm_dev); -exynos_drm_crtc_create (&ctx->manager, ctx->pipe, +exynos_drm_crtc_create (&ctx->manager, drm_dev, ctx->pipe,EXYNOS_DISPLAY_TYPE_LCD );if (ctx->display)exynos_drm_create_enc_conn (drm_dev, ctx->display);
drivers/gpu/drm/exynos/exynos_drm_vidi.c +2 -2
@@ -301,7 +301,7 @@ static int vidi_mgr_initialize(struct exynos_drm_manager *mgr,struct vidi_context *ctx =manager_to_vidi (mgr);struct exynos_drm_private *priv = drm_dev->dev_private; - mgr->drm_dev = ctx->drm_dev = drm_dev; + ctx->drm_dev = drm_dev; ctx->pipe = priv->pipe++;return 0 ;
@@ -558,7 +558,7 @@ static int vidi_bind(struct device *dev, struct device *master, void *data)vidi_mgr_initialize (&ctx->manager, drm_dev); - ret =exynos_drm_crtc_create (&ctx->manager, ctx->pipe, + ret =exynos_drm_crtc_create (&ctx->manager, drm_dev, ctx->pipe,EXYNOS_DISPLAY_TYPE_VIDI );if (ret) {DRM_ERROR ("failed to create crtc.\n" );
drivers/gpu/drm/exynos/exynos_mixer.c +2 -2
@@ -862,7 +862,7 @@ static int mixer_initialize(struct exynos_drm_manager *mgr,struct exynos_drm_private *priv; priv = drm_dev->dev_private; - mgr->drm_dev = mixer_ctx->drm_dev = drm_dev; + mixer_ctx->drm_dev = drm_dev; mixer_ctx->pipe = priv->pipe++;/* acquire resources: regs, irqs, clocks */
@@ -1256,7 +1256,7 @@ static int mixer_bind(struct device *dev, struct device *manager, void *data)if (ret)return ret; - ret =exynos_drm_crtc_create (&ctx->manager, ctx->pipe, + ret =exynos_drm_crtc_create (&ctx->manager, drm_dev, ctx->pipe,EXYNOS_DISPLAY_TYPE_HDMI );if (ret) {mixer_mgr_remove (&ctx->manager);
Signature · 1 line
1.9.3
PATCH 6/6 drm/exynos: remove struct exynos_drm_manager
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
exynos_drm_manager was just a redundant struct to represent the crtc as well. In this commit we merge exynos_drm_manager into exynos_drm_crtc to remove an unnecessary level of indirection easing the understand of the flow on exynos.
--- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 67 ++++++++--------- drivers/gpu/drm/exynos/exynos_drm_crtc.h | 8 +- drivers/gpu/drm/exynos/exynos_drm_drv.h | 51 +++++-------- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 121 ++++++++++++++---------------- drivers/gpu/drm/exynos/exynos_drm_plane.c | 26 +++---- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 79 +++++++++---------- drivers/gpu/drm/exynos/exynos_mixer.c | 103 ++++++++++++------------- 7 files changed, 211 insertions(+), 244 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_crtc.c +32 -35
@@ -23,7 +23,6 @@static void exynos_drm_crtc_dpms (struct drm_crtc *crtc,int mode) {struct exynos_drm_crtc *exynos_crtc =to_exynos_crtc (crtc); -struct exynos_drm_manager *manager = exynos_crtc->manager;DRM_DEBUG_KMS ("crtc[%d] mode[%d]\n" , crtc->base.id, mode);
@@ -41,8 +40,8 @@ static void exynos_drm_crtc_dpms(struct drm_crtc *crtc, int mode)drm_crtc_vblank_off (crtc); } -if (manager->ops->dpms) - manager->ops->dpms (manager, mode); +if (exynos_crtc->ops->dpms) + exynos_crtc->ops->dpms (exynos_crtc, mode); exynos_crtc->dpms = mode;
@@ -58,16 +57,15 @@ static void exynos_drm_crtc_prepare(struct drm_crtc *crtc)static void exynos_drm_crtc_commit (struct drm_crtc *crtc) {struct exynos_drm_crtc *exynos_crtc =to_exynos_crtc (crtc); -struct exynos_drm_manager *manager = exynos_crtc->manager;struct exynos_drm_plane *exynos_plane =to_exynos_plane (crtc->primary);exynos_drm_crtc_dpms (crtc,DRM_MODE_DPMS_ON ); -if (manager->ops->win_commit) - manager->ops->win_commit (manager, exynos_plane->zpos); +if (exynos_crtc->ops->win_commit) + exynos_crtc->ops->win_commit (exynos_crtc, exynos_plane->zpos); -if (manager->ops->commit) - manager->ops->commit (manager); +if (exynos_crtc->ops->commit) + exynos_crtc->ops->commit (exynos_crtc);exynos_plane_dpms (crtc->primary,DRM_MODE_DPMS_ON ); }
@@ -78,10 +76,10 @@ exynos_drm_crtc_mode_fixup(struct drm_crtc *crtc, struct drm_display_mode *adjusted_mode) {struct exynos_drm_crtc *exynos_crtc =to_exynos_crtc (crtc); -struct exynos_drm_manager *manager = exynos_crtc->manager; -if (manager->ops->mode_fixup) -return manager->ops->mode_fixup (manager, mode, adjusted_mode); +if (exynos_crtc->ops->mode_fixup) +return exynos_crtc->ops->mode_fixup (exynos_crtc, mode, + adjusted_mode);return true; }
@@ -92,7 +90,6 @@ exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode, struct drm_framebuffer *old_fb) {struct exynos_drm_crtc *exynos_crtc =to_exynos_crtc (crtc); -struct exynos_drm_manager *manager = exynos_crtc->manager;struct drm_framebuffer *fb = crtc->primary->fb;unsigned int crtc_w;unsigned int crtc_h;
@@ -106,8 +103,8 @@ exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode, crtc_w = fb->width - x; crtc_h = fb->height - y; -if (manager->ops->mode_set) - manager->ops->mode_set (manager, &crtc->mode); +if (exynos_crtc->ops->mode_set) + exynos_crtc->ops->mode_set (exynos_crtc, &crtc->mode);return exynos_plane_mode_set (crtc->primary, crtc, fb,0 ,0 , crtc_w, crtc_h, x, y, crtc_w, crtc_h);
@@ -299,9 +296,11 @@ static void exynos_drm_crtc_attach_mode_property(struct drm_crtc *crtc)drm_object_attach_property (&crtc->base, prop,0 ); } -int exynos_drm_crtc_create (struct exynos_drm_manager *manager, -struct drm_device *drm_dev,int pipe, -enum exynos_drm_output_type type) +struct exynos_drm_crtc *exynos_drm_crtc_create (struct drm_device *drm_dev, +int pipe, +enum exynos_drm_output_type type, +struct exynos_drm_crtc_ops *ops, +void *ctx) {struct exynos_drm_crtc *exynos_crtc;struct drm_plane *plane;
@@ -311,15 +310,16 @@ int exynos_drm_crtc_create(struct exynos_drm_manager *manager, exynos_crtc =kzalloc (sizeof (*exynos_crtc),GFP_KERNEL );if (!exynos_crtc) -return -ENOMEM ; +return ERR_PTR (-ENOMEM );init_waitqueue_head (&exynos_crtc->pending_flip_queue);atomic_set (&exynos_crtc->pending_flip,0 ); exynos_crtc->dpms =DRM_MODE_DPMS_OFF ; - exynos_crtc->manager = manager; exynos_crtc->pipe = pipe; exynos_crtc->type = type; + exynos_crtc->ops = ops; + exynos_crtc->ctx = ctx; plane =exynos_plane_init (drm_dev,1 << pipe,DRM_PLANE_TYPE_PRIMARY );if (IS_ERR (plane)) {
@@ -327,7 +327,6 @@ int exynos_drm_crtc_create(struct exynos_drm_manager *manager, goto err_plane; } - manager->crtc = &exynos_crtc->base; crtc = &exynos_crtc->base; private->crtc[pipe] = crtc;
@@ -341,13 +340,13 @@ int exynos_drm_crtc_create(struct exynos_drm_manager *manager,exynos_drm_crtc_attach_mode_property (crtc); -return 0 ; +return exynos_crtc; err_crtc: plane->funcs->destroy (plane); err_plane:kfree (exynos_crtc); -return ret; +return ERR_PTR (ret); }int exynos_drm_crtc_enable_vblank (struct drm_device *dev,int pipe)
@@ -355,13 +354,12 @@ int exynos_drm_crtc_enable_vblank(struct drm_device *dev, int pipe)struct exynos_drm_private *private = dev->dev_private;struct exynos_drm_crtc *exynos_crtc =to_exynos_crtc (private->crtc[pipe]); -struct exynos_drm_manager *manager = exynos_crtc->manager;if (exynos_crtc->dpms !=DRM_MODE_DPMS_ON )return -EPERM ; -if (manager->ops->enable_vblank) - manager->ops->enable_vblank (manager); +if (exynos_crtc->ops->enable_vblank) + exynos_crtc->ops->enable_vblank (exynos_crtc);return 0 ; }
@@ -371,13 +369,12 @@ void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int pipe)struct exynos_drm_private *private = dev->dev_private;struct exynos_drm_crtc *exynos_crtc =to_exynos_crtc (private->crtc[pipe]); -struct exynos_drm_manager *manager = exynos_crtc->manager;if (exynos_crtc->dpms !=DRM_MODE_DPMS_ON )return ; -if (manager->ops->disable_vblank) - manager->ops->disable_vblank (manager); +if (exynos_crtc->ops->disable_vblank) + exynos_crtc->ops->disable_vblank (exynos_crtc); }void exynos_drm_crtc_finish_pageflip (struct drm_device *dev,int pipe)
@@ -408,7 +405,7 @@ void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int pipe)void exynos_drm_crtc_complete_scanout (struct drm_framebuffer *fb) { -struct exynos_drm_manager *manager; +struct exynos_drm_crtc *exynos_crtc;struct drm_device *dev = fb->dev;struct drm_crtc *crtc;
@@ -417,15 +414,15 @@ void exynos_drm_crtc_complete_scanout(struct drm_framebuffer *fb)* for all encoders. */ list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { - manager =to_exynos_crtc (crtc)->manager; + exynos_crtc =to_exynos_crtc (crtc);/* * wait for vblank interrupt * - this makes sure that overlay data are updated to * real hardware. */ -if (manager->ops->wait_for_vblank) - manager->ops->wait_for_vblank (manager); +if (exynos_crtc->ops->wait_for_vblank) + exynos_crtc->ops->wait_for_vblank (exynos_crtc); } }
@@ -447,8 +444,8 @@ int exynos_drm_crtc_get_pipe_from_type(struct drm_device *drm_dev,void exynos_drm_crtc_te_handler (struct drm_crtc *crtc) { -struct exynos_drm_manager *manager =to_exynos_crtc (crtc)->manager; +struct exynos_drm_crtc *exynos_crtc =to_exynos_crtc (crtc); -if (manager->ops->te_handler) - manager->ops->te_handler (manager); +if (exynos_crtc->ops->te_handler) + exynos_crtc->ops->te_handler (exynos_crtc); }
drivers/gpu/drm/exynos/exynos_drm_crtc.h +5 -3
@@ -17,9 +17,11 @@#include "exynos_drm_drv.h" -int exynos_drm_crtc_create (struct exynos_drm_manager *manager, -struct drm_device *drm_dev,int pipe, -enum exynos_drm_output_type type); +struct exynos_drm_crtc *exynos_drm_crtc_create (struct drm_device *drm_dev, +int pipe, +enum exynos_drm_output_type type, +struct exynos_drm_crtc_ops *ops, +void *context);int exynos_drm_crtc_enable_vblank (struct drm_device *dev,int pipe);void exynos_drm_crtc_disable_vblank (struct drm_device *dev,int pipe);void exynos_drm_crtc_finish_pageflip (struct drm_device *dev,int pipe);
drivers/gpu/drm/exynos/exynos_drm_drv.h +19 -32
88 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_drm_fimd.c +58 -63
341 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_drm_plane.c +13 -13
@@ -68,7 +68,7 @@ int 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_manager *manager =to_exynos_crtc (crtc)->manager; +struct exynos_drm_crtc *exynos_crtc =to_exynos_crtc (crtc);unsigned int actual_w;unsigned int actual_h;int nr;
@@ -133,8 +133,8 @@ int exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc, plane->crtc = crtc; -if (manager->ops->win_mode_set) - manager->ops->win_mode_set (manager, exynos_plane); +if (exynos_crtc->ops->win_mode_set) + exynos_crtc->ops->win_mode_set (exynos_crtc, exynos_plane);return 0 ; }
@@ -142,24 +142,24 @@ int exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc,void exynos_plane_dpms (struct drm_plane *plane,int mode) {struct exynos_drm_plane *exynos_plane =to_exynos_plane (plane); -struct exynos_drm_manager *manager; +struct exynos_drm_crtc *exynos_crtc =to_exynos_crtc (plane->crtc);if (mode ==DRM_MODE_DPMS_ON ) {if (exynos_plane->enabled)return ; - manager =to_exynos_crtc (plane->crtc)->manager; -if (manager->ops->win_enable) - manager->ops->win_enable (manager, exynos_plane->zpos); +if (exynos_crtc->ops->win_enable) + exynos_crtc->ops->win_enable (exynos_crtc, + exynos_plane->zpos); exynos_plane->enabled = true; }else {if (!exynos_plane->enabled)return ; - manager =to_exynos_crtc (plane->crtc)->manager; -if (manager->ops->win_disable) - manager->ops->win_disable (manager, exynos_plane->zpos); +if (exynos_crtc->ops->win_disable) + exynos_crtc->ops->win_disable (exynos_crtc, + exynos_plane->zpos); exynos_plane->enabled = false; }
@@ -173,7 +173,7 @@ exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, uint32_t src_w, uint32_t src_h) { -struct exynos_drm_manager *manager =to_exynos_crtc (crtc)->manager; +struct exynos_drm_crtc *exynos_crtc =to_exynos_crtc (crtc);struct exynos_drm_plane *exynos_plane =to_exynos_plane (plane);int ret;
@@ -183,8 +183,8 @@ exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,if (ret <0 )return ret; -if (manager->ops->win_commit) - manager->ops->win_commit (manager, exynos_plane->zpos); +if (exynos_crtc->ops->win_commit) + exynos_crtc->ops->win_commit (exynos_crtc, exynos_plane->zpos);return 0 ; }
drivers/gpu/drm/exynos/exynos_drm_vidi.c +35 -44
209 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_mixer.c +49 -54
267 lines not on this page · raw message
Signature · 1 line
1.9.3