Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1452336
| Path | csiph.com!news.mixmin.net!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Bibby Hsieh <bibby.hsieh@mediatek.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH 7/7] drm/mediatek: Fix mtk_atomic_complete for runtime_pm |
| Date | Fri, 29 Jul 2016 11:10:01 +0200 |
| Message-ID | <s0bXP-2EU-13@gated-at.bofh.it> (permalink) |
| References | <s0bXP-2EU-3@gated-at.bofh.it> |
| X-Mailer | git-send-email 1.7.9.5 |
| MIME-Version | 1.0 |
| Content-Type | text/plain |
| X-Mtk | N |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 52 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Yingjoe Chen <yingjoe.chen@mediatek.com>, Cawa Cheng <cawa.cheng@mediatek.com>, Daniel Kurtz <djkurtz@chromium.org>, Bibby Hsieh <bibby.hsieh@mediatek.com>, Philipp Zabel <p.zabel@pengutronix.de>, YT Shen <yt.shen@mediatek.com>, Thierry Reding <thierry.reding@gmail.com>, CK Hu <ck.hu@mediatek.com>, Mao Huang <littlecvr@chromium.org>, <linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org>, Sascha Hauer <kernel@pengutronix.de> |
| X-Original-Date | Fri, 29 Jul 2016 17:04:14 +0800 |
| X-Original-Message-ID | <1469783054-54567-8-git-send-email-bibby.hsieh@mediatek.com> |
| X-Original-References | <1469783054-54567-1-git-send-email-bibby.hsieh@mediatek.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1452336 |
Show key headers only | View raw
To properly implement atomic w/ runtime pm, we move drm_atomic_helper_commit_modeset_enables() above drm_atomic_helper_commit_planes() to ensure CRTCs are enabled before modifying plane registers, and set active_only to true to filter out plane update notifications when the CRTC is disabled. According to the document from linux kernel: Set the active_only parameters to true in order not to receive plane update notifications related to a disabled CRTC. This avoids the need to manually ignore plane updates in driver code when the driver and/or hardware can't or just don't need to deal with updates on disabled CRTCs, for example when supporting runtime PM. Signed-off-by: Bibby Hsieh <bibby.hsieh@mediatek.com> Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> --- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c index b1223d5..507392a 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c @@ -61,10 +61,25 @@ static void mtk_atomic_complete(struct mtk_drm_private *private, mtk_atomic_wait_for_fences(state); + /* + * Mediatek drm supports runtime PM, so plane registers cannot be + * written when their crtc is disabled. + * + * The comment for drm_atomic_helper_commit states: + * For drivers supporting runtime PM the recommended sequence is + * + * drm_atomic_helper_commit_modeset_disables(dev, state); + * drm_atomic_helper_commit_modeset_enables(dev, state); + * drm_atomic_helper_commit_planes(dev, state, true); + * + * See the kerneldoc entries for these three functions for more details. + */ drm_atomic_helper_commit_modeset_disables(drm, state); - drm_atomic_helper_commit_planes(drm, state, false); drm_atomic_helper_commit_modeset_enables(drm, state); + drm_atomic_helper_commit_planes(drm, state, true); + drm_atomic_helper_wait_for_vblanks(drm, state); + drm_atomic_helper_cleanup_planes(drm, state); drm_atomic_state_free(state); } -- 1.7.9.5
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 7/7] drm/mediatek: Fix mtk_atomic_complete for runtime_pm Bibby Hsieh <bibby.hsieh@mediatek.com> - 2016-07-29 11:10 +0200
csiph-web