Skip to content

Commit 140fd38

Browse files
mattropedanvet
authored andcommitted
drm/i915: Hold runtime PM during plane commit
During plane operations, we read/write some registers that only operate properly if we're not runtime suspended. At the moment we're not holding the runtime PM reference across the whole plane operation, so there's a potential for problems. This issue was already partially addressed by commit commit d6dd684 Author: Paulo Zanoni <paulo.r.zanoni@intel.com> Date: Fri Aug 15 15:59:32 2014 -0300 drm/i915: fix plane/cursor handling when runtime suspended which took care of holding the runtime PM reference during the pin and fence operations for plane updates. However there are still a few actual plane registers that we also need to hold the runtime PM reference for. Recent refactoring patches in preparation for atomic have rearranged the code and made it increasingly likely that the hardware will have time to suspend between the pin/fence operation and the actual register writes. Examples of such registers are the stuff touched by ivb_get_colorkey. The solution here grabs the runtime PM reference around the 'commit' operation for planes, which should cover all the relevant register reads/writes. Note that this has only been exposed with commit 6beb8c2 Author: Matt Roper <matthew.d.roper@intel.com> Date: Mon Dec 1 15:40:14 2014 -0800 drm/i915: Consolidate plane 'prepare' functions (v2) so doesn't need to be ported to 3.19. Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87180 Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Testcase: igt/pm-rpm/legacy-planes Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> [danvet: Augment commit message with information Paulo supplied.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
1 parent b1252bc commit 140fd38

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/gpu/drm/i915/intel_display.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11864,6 +11864,7 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
1186411864
uint32_t src_w, uint32_t src_h)
1186511865
{
1186611866
struct drm_device *dev = plane->dev;
11867+
struct drm_i915_private *dev_priv = dev->dev_private;
1186711868
struct drm_framebuffer *old_fb = plane->fb;
1186811869
struct intel_plane_state state;
1186911870
struct intel_plane *intel_plane = to_intel_plane(plane);
@@ -11903,7 +11904,9 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
1190311904
return ret;
1190411905
}
1190511906

11907+
intel_runtime_pm_get(dev_priv);
1190611908
intel_plane->commit_plane(plane, &state);
11909+
intel_runtime_pm_put(dev_priv);
1190711910

1190811911
if (fb != old_fb && old_fb) {
1190911912
if (intel_crtc->active)

0 commit comments

Comments
 (0)