drm: Simplify and defend later checks when disabling a crtc
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 31 Jan 2011 11:16:33 +0000 (11:16 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 31 Jan 2011 12:36:33 +0000 (12:36 +0000)
commitede3ff5204b0117d00609f4980df3b864cefe96f
treedda9eb0628576ad239f1315d05e94359db1f4770
parent9334ef755f060e251f3f395caeda1a58b6834ea3
drm: Simplify and defend later checks when disabling a crtc

By setting the FB of a CRTC to NULL, we are turning off the CRTC (and so
disable the unused encoders and connectors). As such we can simplify the
later tests by making sure the set->mode is NULL. Setting the
num_connectors to zero means that we do not need to loop over the unused
connectors.

All current usage appears correct, this only builds additional defense
into the routine.

References: https://bugzilla.kernel.org/show_bug.cgi?id=27722
Tested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/drm_crtc_helper.c