]> git.baikalelectronics.ru Git - kernel.git/commit
drm/atomic_helper: Cope with plane->crtc == NULL in disable helper
authorJasper St. Pierre <jstpierre@mecheye.net>
Fri, 21 Nov 2014 03:59:15 +0000 (19:59 -0800)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 25 Nov 2014 12:12:43 +0000 (13:12 +0100)
commit1a687b3e1eca5f7c84baa3fbf4717d5437dee46b
treee73849bba9e2b569478a4cae4f8ae930ff9a8f21
parent97a8d5caf1ae3578833789f14691845323691965
drm/atomic_helper: Cope with plane->crtc == NULL in disable helper

The drm core can call the plane disable hook multiple times, which
means it can get called when plane->crtc is already NULL. That in turn
means we can't get at the implicit acquire ctx we use in the atomic
helpers for legacy entries points.

We could try to pass drm_modeset_legacy_acquire_ctx a drm_device
pointer so that it can cope with a NULL crtc. But that still doesn't
work since the cursor ioctls (remapped with the universal cursor plane
support code) only grabs the crtc locks. So the global acquire context
isn't set eitehr.

The real solution here would be to bite the bullet and wire up
explicit acquire context parameters to all relevant functions. We need
to do that anyway (to be able to get rid of some small allocations
which we can't cope with failing). But that's a lot of work and better
done once atomic has settled a bit.

So meanwhile just catch this case in the helper and bail out.

Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
[danvet: Completely rewrite commit message and comment but keep
Jasper's logic and author credits since his patch is the only
short-term solution that works.]
Tested-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_atomic_helper.c