hwc: Check for display connection before calling commit

In some transition scenarios for external display, it can be
disconnected just before the power mode setting's display commit
goes through. This will cause the display commit to fail, which is
harmless in this context, but it causes false-negatives in test
scripts.

This patch checks if the external display is still connected
(and thus implicitly if the fd is valid) before calling a commit.

Change-Id: I386f0a951344c2aba2f8944e712df40e203d10ae
1 file changed