Android 5.1.1 release 20
modes: Retry GETCONNECTOR if a hotplug event occurs between the two ioctls

BZ: 189856

If the available modes changes between the two GETCONNECTOR ioctls, that
caused the kernel to skip filling one array and led to a crash (as the size
of the allocated and initialised block of memory differed from the reported
size, and might be NULL if no modes were present at first).

this patch is ported from libdrm official:

    Fixes: http://bugs.freedesktop.org/show_bug.cgi?id=25912
           Crash whilst probing modes

    Based upon the similar fixes for the GETRESOURCES ioctls by Chris Wilson,
    in the following commits:

        commit e6c136ca7a4c54457b48be1aec2be024b3e4a28d
        commit 85fb3e55fdb7af9b5f59c1ec0f15d1950e601b05
        commit d1308f4fe7f94aae51ca9f70947aea8e09597f37

Change-Id: Ife5e182ddd62abcb2a8a219b0e67786467f794d5
Signed-off-by: Tan Wei <weix.z.tan@intel.com>
1 file changed