drm/rockchip: fb: implement rockchip_drm_atomic_helper_commit_tail_rpm

implement rockchip_drm_atomic_helper_commit_tail_rpm() to instead of
drm_atomic_helper_commit_tail_rpm(), this is prepare to add some rockchip
private implement, just like calculate bandwidth and make sure commit
planes is mutually-exclusive.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I2ac87f672a3ef06611b5047781f7cf53aa4b3700
This commit is contained in:
Sandy Huang
2021-07-22 10:18:56 +08:00
committed by Tao Huang
parent 66af96482f
commit 4713955fb8

View File

@@ -53,8 +53,37 @@ rockchip_fb_alloc(struct drm_device *dev, const struct drm_mode_fb_cmd2 *mode_cm
return fb;
}
/**
* rockchip_drm_atomic_helper_commit_tail_rpm - commit atomic update to hardware
* @old_state: new modeset state to be committed
*
* This is an alternative implementation for the
* &drm_mode_config_helper_funcs.atomic_commit_tail hook, for drivers
* that support runtime_pm or need the CRTC to be enabled to perform a
* commit. Otherwise, one should use the default implementation
* drm_atomic_helper_commit_tail().
*/
static void rockchip_drm_atomic_helper_commit_tail_rpm(struct drm_atomic_state *old_state)
{
struct drm_device *dev = old_state->dev;
drm_atomic_helper_commit_modeset_disables(dev, old_state);
drm_atomic_helper_commit_modeset_enables(dev, old_state);
drm_atomic_helper_commit_planes(dev, old_state, DRM_PLANE_COMMIT_ACTIVE_ONLY);
drm_atomic_helper_fake_vblank(old_state);
drm_atomic_helper_commit_hw_done(old_state);
drm_atomic_helper_wait_for_vblanks(dev, old_state);
drm_atomic_helper_cleanup_planes(dev, old_state);
}
static const struct drm_mode_config_helper_funcs rockchip_mode_config_helpers = {
.atomic_commit_tail = drm_atomic_helper_commit_tail_rpm,
.atomic_commit_tail = rockchip_drm_atomic_helper_commit_tail_rpm,
};
static struct drm_framebuffer *