Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Matt Roper and committed by
Rob Clark
af2b653b 0886327a

+9 -3
+8 -2
drivers/gpu/drm/i915/intel_display.c
··· 3423 3423 { 3424 3424 struct drm_device *dev = crtc->dev; 3425 3425 enum pipe pipe = to_intel_crtc(crtc)->pipe; 3426 + struct drm_plane *plane; 3426 3427 struct intel_plane *intel_plane; 3427 3428 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); 3429 3431 if (intel_plane->pipe == pipe) 3430 3432 intel_plane_restore(&intel_plane->base); 3433 + } 3431 3434 } 3432 3435 3433 3436 static void intel_disable_planes(struct drm_crtc *crtc) 3434 3437 { 3435 3438 struct drm_device *dev = crtc->dev; 3436 3439 enum pipe pipe = to_intel_crtc(crtc)->pipe; 3440 + struct drm_plane *plane; 3437 3441 struct intel_plane *intel_plane; 3438 3442 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); 3440 3445 if (intel_plane->pipe == pipe) 3441 3446 intel_plane_disable(&intel_plane->base); 3447 + } 3442 3448 } 3443 3449 3444 3450 void hsw_enable_ips(struct intel_crtc *crtc)
+1 -1
drivers/gpu/drm/i915/intel_pm.c
··· 2129 2129 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) 2130 2130 config->num_pipes_active += intel_crtc_active(crtc); 2131 2131 2132 - list_for_each_entry(plane, &dev->mode_config.plane_list, head) { 2132 + drm_for_each_legacy_plane(plane, &dev->mode_config.plane_list) { 2133 2133 struct intel_plane *intel_plane = to_intel_plane(plane); 2134 2134 2135 2135 if (intel_plane->pipe == pipe)