diff options
author | Chen-Yu Tsai <wens@csie.org> | 2017-09-08 15:50:15 +0800 |
---|---|---|
committer | Maxime Ripard <maxime.ripard@free-electrons.com> | 2017-09-09 17:24:52 +0200 |
commit | 070badfab76711fc3a603237e3412f68b1bf5778 (patch) | |
tree | 33fe8ca128d69b06106d435ce7cea68928887ba4 /drivers | |
parent | 27e18de78e7b9c1679778b40dfd991e6d1ba6595 (diff) | |
download | linux-070badfab76711fc3a603237e3412f68b1bf5778.tar.gz linux-070badfab76711fc3a603237e3412f68b1bf5778.tar.bz2 linux-070badfab76711fc3a603237e3412f68b1bf5778.zip |
drm/sun4i: call drm_vblank_init with correct number of crtcs
If we want to have vblank on both pipelines at the same time, we need
to call drm_vblank_init with num_crtcs = 2.
Instead, since the crtc init calls correctly set mode_config.num_crtc,
we can move the drm_vblank_init call to after the crtc init code is
called, which is the component bind part. Then we can just pass
mode_config.num_crtc in.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170908075016.18657-8-wens@csie.org
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/sun4i/sun4i_drv.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index cee02710de74..6eddb8086075 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -98,11 +98,6 @@ static int sun4i_drv_bind(struct device *dev) goto free_drm; } - /* drm_vblank_init calls kcalloc, which can fail */ - ret = drm_vblank_init(drm, 1); - if (ret) - goto free_mem_region; - drm_mode_config_init(drm); ret = component_bind_all(drm->dev, drm); @@ -111,6 +106,11 @@ static int sun4i_drv_bind(struct device *dev) goto cleanup_mode_config; } + /* drm_vblank_init calls kcalloc, which can fail */ + ret = drm_vblank_init(drm, drm->mode_config.num_crtc); + if (ret) + goto free_mem_region; + drm->irq_enabled = true; /* Remove early framebuffers (ie. simplefb) */ |