Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1595879
| From | Chen-Yu Tsai <wens@csie.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 05/11] drm/sun4i: Pass pointers for associated backend and tcon into crtc init |
| Date | 2017-03-09 11:10 +0100 |
| Message-ID | <tj3bd-3I3-43@gated-at.bofh.it> (permalink) |
| References | <tj3bb-3I3-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
sun4i_crtc controls the backend and tcon hardware blocks of the display
pipeline.
Pass pointers to the underlying devices into the crtc init function,
instead of trying to fetch them from the drm_device structure. This
avoids the headache of trying to figure out which devices the crtc
is actually associated with.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
drivers/gpu/drm/sun4i/sun4i_crtc.c | 9 +++++----
drivers/gpu/drm/sun4i/sun4i_crtc.h | 4 +++-
drivers/gpu/drm/sun4i/sun4i_tcon.c | 2 +-
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/sun4i/sun4i_crtc.c b/drivers/gpu/drm/sun4i/sun4i_crtc.c
index 5323e3485988..221e6d5ee970 100644
--- a/drivers/gpu/drm/sun4i/sun4i_crtc.c
+++ b/drivers/gpu/drm/sun4i/sun4i_crtc.c
@@ -134,9 +134,10 @@ static const struct drm_crtc_funcs sun4i_crtc_funcs = {
.disable_vblank = sun4i_crtc_disable_vblank,
};
-struct sun4i_crtc *sun4i_crtc_init(struct drm_device *drm)
+struct sun4i_crtc *sun4i_crtc_init(struct drm_device *drm,
+ struct sun4i_backend *backend,
+ struct sun4i_tcon *tcon)
{
- struct sun4i_drv *drv = drm->dev_private;
struct sun4i_crtc *scrtc;
struct drm_plane *primary = NULL, *cursor = NULL;
int ret, i;
@@ -144,8 +145,8 @@ struct sun4i_crtc *sun4i_crtc_init(struct drm_device *drm)
scrtc = devm_kzalloc(drm->dev, sizeof(*scrtc), GFP_KERNEL);
if (!scrtc)
return ERR_PTR(-ENOMEM);
- scrtc->backend = drv->backend;
- scrtc->tcon = drv->tcon;
+ scrtc->backend = backend;
+ scrtc->tcon = tcon;
/* Create our layers */
scrtc->layers = sun4i_layers_init(drm);
diff --git a/drivers/gpu/drm/sun4i/sun4i_crtc.h b/drivers/gpu/drm/sun4i/sun4i_crtc.h
index cd0e633cce3a..230cb8f0d601 100644
--- a/drivers/gpu/drm/sun4i/sun4i_crtc.h
+++ b/drivers/gpu/drm/sun4i/sun4i_crtc.h
@@ -27,6 +27,8 @@ static inline struct sun4i_crtc *drm_crtc_to_sun4i_crtc(struct drm_crtc *crtc)
return container_of(crtc, struct sun4i_crtc, crtc);
}
-struct sun4i_crtc *sun4i_crtc_init(struct drm_device *drm);
+struct sun4i_crtc *sun4i_crtc_init(struct drm_device *drm,
+ struct sun4i_backend *backend,
+ struct sun4i_tcon *tcon);
#endif /* _SUN4I_CRTC_H_ */
diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
index c52c482c8fd0..3ced0b1cef6e 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
@@ -528,7 +528,7 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master,
goto err_free_dotclock;
}
- tcon->crtc = sun4i_crtc_init(drm);
+ tcon->crtc = sun4i_crtc_init(drm, drv->backend, tcon);
if (IS_ERR(tcon->crtc)) {
dev_err(dev, "Couldn't create our CRTC\n");
ret = PTR_ERR(tcon->crtc);
--
2.11.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/11] drm/sun4i: Support two display pipelines Chen-Yu Tsai <wens@csie.org> - 2017-03-09 11:10 +0100 [PATCH 02/11] drm/sun4i: Fix tcon channel 0 comment about backporch = backporch + hsync Chen-Yu Tsai <wens@csie.org> - 2017-03-09 11:10 +0100 [PATCH 04/11] drm/sun4i: tv: Get tcon and backend pointers from associated crtc Chen-Yu Tsai <wens@csie.org> - 2017-03-09 11:10 +0100 [PATCH 11/11] ARM: dts: sun6i: Enable tcon0 by default Chen-Yu Tsai <wens@csie.org> - 2017-03-09 11:10 +0100 [PATCH 05/11] drm/sun4i: Pass pointers for associated backend and tcon into crtc init Chen-Yu Tsai <wens@csie.org> - 2017-03-09 11:10 +0100 [PATCH 10/11] ARM: dts: sun6i: Add second display pipeline device nodes Chen-Yu Tsai <wens@csie.org> - 2017-03-09 11:10 +0100 [PATCH 06/11] drm/sun4i: Pass pointer for underlying backend into layer init Chen-Yu Tsai <wens@csie.org> - 2017-03-09 11:10 +0100 Re: [PATCH 00/11] drm/sun4i: Support two display pipelines Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-03-09 11:40 +0100
csiph-web