Skip to content

Commit af2b653

Browse files
mattroperobclark
authored andcommitted
drm/i915: Restrict plane loops to only operate on overlay planes (v2)
Ensure that existing driver loops over all planes do not change behavior when we begin adding new types of planes (primary and cursor) to the DRM plane list in future patches. v2: Switch to using drm_for_each_legacy_plane() Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
1 parent 0886327 commit af2b653

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

drivers/gpu/drm/i915/intel_display.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3423,22 +3423,28 @@ static void intel_enable_planes(struct drm_crtc *crtc)
34233423
{
34243424
struct drm_device *dev = crtc->dev;
34253425
enum pipe pipe = to_intel_crtc(crtc)->pipe;
3426+
struct drm_plane *plane;
34263427
struct intel_plane *intel_plane;
34273428

3428-
list_for_each_entry(intel_plane, &dev->mode_config.plane_list, base.head)
3429+
drm_for_each_legacy_plane(plane, &dev->mode_config.plane_list) {
3430+
intel_plane = to_intel_plane(plane);
34293431
if (intel_plane->pipe == pipe)
34303432
intel_plane_restore(&intel_plane->base);
3433+
}
34313434
}
34323435

34333436
static void intel_disable_planes(struct drm_crtc *crtc)
34343437
{
34353438
struct drm_device *dev = crtc->dev;
34363439
enum pipe pipe = to_intel_crtc(crtc)->pipe;
3440+
struct drm_plane *plane;
34373441
struct intel_plane *intel_plane;
34383442

3439-
list_for_each_entry(intel_plane, &dev->mode_config.plane_list, base.head)
3443+
drm_for_each_legacy_plane(plane, &dev->mode_config.plane_list) {
3444+
intel_plane = to_intel_plane(plane);
34403445
if (intel_plane->pipe == pipe)
34413446
intel_plane_disable(&intel_plane->base);
3447+
}
34423448
}
34433449

34443450
void hsw_enable_ips(struct intel_crtc *crtc)

drivers/gpu/drm/i915/intel_pm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2129,7 +2129,7 @@ static void ilk_compute_wm_parameters(struct drm_crtc *crtc,
21292129
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head)
21302130
config->num_pipes_active += intel_crtc_active(crtc);
21312131

2132-
list_for_each_entry(plane, &dev->mode_config.plane_list, head) {
2132+
drm_for_each_legacy_plane(plane, &dev->mode_config.plane_list) {
21332133
struct intel_plane *intel_plane = to_intel_plane(plane);
21342134

21352135
if (intel_plane->pipe == pipe)

0 commit comments

Comments
 (0)