diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-04-23 09:15:32 -0400 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2014-04-24 09:04:30 -0400 |
commit | 2b4c36612efac173397756398000921a7771fdda (patch) | |
tree | e85c7af76a25f1c787627ed682bf90f044eab62a /drivers/gpu | |
parent | cbfbbabb89b37f6bad05f478d906a385149f288d (diff) |
drm/tegra: restrict plane loops to legacy planes
In Matt Ropers primary plane series a set of prep patches like
commit af2b653bfb4ef40931b4d101ca842ce0c5da57ef
Author: Matt Roper <matthew.d.roper@intel.com>
Date: Tue Apr 1 15:22:32 2014 -0700
drm/i915: Restrict plane loops to only operate on overlay planes (v2)
ensured that all exisiting users of the mode_config->plane_list
wouldn't change behaviour. Unfortunately tegra seems to have fallen
through the cracks. Fix it.
This regression was introduced in
commit e13161af80c185ecd8dc4641d0f5df58f9e3e0af
Author: Matt Roper <matthew.d.roper@intel.com>
Date: Tue Apr 1 15:22:38 2014 -0700
drm: Add drm_crtc_init_with_planes() (v2)
The result was that we've unref'ed the fb for the primary plane twice,
leading to a use-after free bug. This is because the drm core will
already set crtc->primary->fb to NULL and do the unref for us, and the
crtc disable hook is called by the drm crtc helpers for exactly this
case.
Aside: Now that the fbdev helpers clean up planes there's no longer a
need to do this in drivers. So this could probably be nuked entirely
in linux-next.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/tegra/dc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 36c717af6cf9..edb871d7d395 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c | |||
@@ -312,7 +312,7 @@ static void tegra_crtc_disable(struct drm_crtc *crtc) | |||
312 | struct drm_device *drm = crtc->dev; | 312 | struct drm_device *drm = crtc->dev; |
313 | struct drm_plane *plane; | 313 | struct drm_plane *plane; |
314 | 314 | ||
315 | list_for_each_entry(plane, &drm->mode_config.plane_list, head) { | 315 | drm_for_each_legacy_plane(plane, &drm->mode_config.plane_list) { |
316 | if (plane->crtc == crtc) { | 316 | if (plane->crtc == crtc) { |
317 | tegra_plane_disable(plane); | 317 | tegra_plane_disable(plane); |
318 | plane->crtc = NULL; | 318 | plane->crtc = NULL; |