diff options
author | ivan.liu <xiaowen.liu@nxp.com> | 2018-08-16 14:54:34 +0800 |
---|---|---|
committer | Jason Liu <jason.hui.liu@nxp.com> | 2019-02-12 10:33:35 +0800 |
commit | 8c09153836989ad0ab5874a06d8aabe68c8eef6c (patch) | |
tree | 877279d0ff51dd7764dd78c31409bd7329e7c928 /drivers | |
parent | c35d4e7a78f019c29fe6a342d71510f624baf9b7 (diff) |
MA-12411 Enable in-fence function for DRM driver on IMX8 platform.
dcss_drm_atomic_commit and dpu_drm_atomic_commit will overide the in-fence.
Remove the common code from the driver to make in-fence can work.
And call pepare_fb() to do the same thing of set dma_buf fence.
The only difference is pepare_fb() won't set dma_buf fence if in-fence exists.
Change-Id: Idbaf3a765321e6d049aa9e39695a450eb0c760f0
Signed-off-by: ivan.liu <xiaowen.liu@nxp.com>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/imx/dcss/dcss-kms.c | 29 | ||||
-rw-r--r-- | drivers/gpu/drm/imx/dcss/dcss-plane.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/imx/dpu/dpu-kms.c | 29 | ||||
-rw-r--r-- | drivers/gpu/drm/imx/dpu/dpu-plane.c | 1 |
4 files changed, 4 insertions, 56 deletions
diff --git a/drivers/gpu/drm/imx/dcss/dcss-kms.c b/drivers/gpu/drm/imx/dcss/dcss-kms.c index dce1858268ae..4748236e0a72 100644 --- a/drivers/gpu/drm/imx/dcss/dcss-kms.c +++ b/drivers/gpu/drm/imx/dcss/dcss-kms.c @@ -51,33 +51,6 @@ static int dcss_drm_atomic_check(struct drm_device *drm, return drm_atomic_helper_check_modeset(drm, state); } -static int dcss_drm_atomic_commit(struct drm_device *drm, - struct drm_atomic_state *state, - bool nonblock) -{ - struct drm_plane_state *plane_state; - struct drm_plane *plane; - struct dma_buf *dma_buf; - int i; - - /* - * If the plane fb has an dma-buf attached, fish out the exclusive - * fence for the atomic helper to wait on. - */ - for_each_plane_in_state(state, plane, plane_state, i) { - if ((plane->state->fb != plane_state->fb) && plane_state->fb) { - dma_buf = drm_fb_cma_get_gem_obj(plane_state->fb, - 0)->base.dma_buf; - if (!dma_buf) - continue; - plane_state->fence = - reservation_object_get_excl_rcu(dma_buf->resv); - } - } - - return drm_atomic_helper_commit(drm, state, nonblock); -} - static void dcss_kms_setup_output_pipe(struct drm_atomic_state *state) { struct drm_crtc *crtc; @@ -127,7 +100,7 @@ const struct drm_mode_config_funcs dcss_drm_mode_config_funcs = { .fb_create = drm_fb_cma_create, .output_poll_changed = dcss_drm_output_poll_changed, .atomic_check = dcss_drm_atomic_check, - .atomic_commit = dcss_drm_atomic_commit, + .atomic_commit = drm_atomic_helper_commit, }; struct drm_mode_config_helper_funcs dcss_drm_mode_config_helpers = { diff --git a/drivers/gpu/drm/imx/dcss/dcss-plane.c b/drivers/gpu/drm/imx/dcss/dcss-plane.c index 8c9070ca9af8..11135e549176 100644 --- a/drivers/gpu/drm/imx/dcss/dcss-plane.c +++ b/drivers/gpu/drm/imx/dcss/dcss-plane.c @@ -629,6 +629,7 @@ static void dcss_plane_atomic_disable(struct drm_plane *plane, } static const struct drm_plane_helper_funcs dcss_plane_helper_funcs = { + .prepare_fb = drm_fb_cma_prepare_fb, .atomic_check = dcss_plane_atomic_check, .atomic_update = dcss_plane_atomic_update, .atomic_disable = dcss_plane_atomic_disable, diff --git a/drivers/gpu/drm/imx/dpu/dpu-kms.c b/drivers/gpu/drm/imx/dpu/dpu-kms.c index 5eb0cd838a46..34b582b35d47 100644 --- a/drivers/gpu/drm/imx/dpu/dpu-kms.c +++ b/drivers/gpu/drm/imx/dpu/dpu-kms.c @@ -550,36 +550,9 @@ static int dpu_drm_atomic_check(struct drm_device *dev, return ret; } -static int dpu_drm_atomic_commit(struct drm_device *dev, - struct drm_atomic_state *state, - bool nonblock) -{ - struct drm_plane_state *plane_state; - struct drm_plane *plane; - struct dma_buf *dma_buf; - int i; - - /* - * If the plane fb has an dma-buf attached, fish out the exclusive - * fence for the atomic helper to wait on. - */ - for_each_plane_in_state(state, plane, plane_state, i) { - if ((plane->state->fb != plane_state->fb) && plane_state->fb) { - dma_buf = drm_fb_cma_get_gem_obj(plane_state->fb, - 0)->base.dma_buf; - if (!dma_buf) - continue; - plane_state->fence = - reservation_object_get_excl_rcu(dma_buf->resv); - } - } - - return drm_atomic_helper_commit(dev, state, nonblock); -} - const struct drm_mode_config_funcs dpu_drm_mode_config_funcs = { .fb_create = drm_fb_cma_create, .output_poll_changed = dpu_drm_output_poll_changed, .atomic_check = dpu_drm_atomic_check, - .atomic_commit = dpu_drm_atomic_commit, + .atomic_commit = drm_atomic_helper_commit, }; diff --git a/drivers/gpu/drm/imx/dpu/dpu-plane.c b/drivers/gpu/drm/imx/dpu/dpu-plane.c index 7f41afb04f17..78d294e8498d 100644 --- a/drivers/gpu/drm/imx/dpu/dpu-plane.c +++ b/drivers/gpu/drm/imx/dpu/dpu-plane.c @@ -708,6 +708,7 @@ static void dpu_plane_atomic_update(struct drm_plane *plane, } static const struct drm_plane_helper_funcs dpu_plane_helper_funcs = { + .prepare_fb = drm_fb_cma_prepare_fb, .atomic_check = dpu_plane_atomic_check, .atomic_update = dpu_plane_atomic_update, }; |