Handle screendumps for all framebuffer sizes

readx() treats a partial read as an error but also consumes the data,
Now exactly the amount of data needed for the screendump is requested.

This bug showed up for framebuffers that were not a multiple of 640
bytes.

Also fix a compiler warning related to handing pipe() failure.

Change-Id: I8b1713923e156d4e3424784152e5dc5cbc7d478d
fix valgrind ioctl warning.

Initialize local variable to avoid syscall ioctl warning.

Change-Id: Ibad5b86cd799f147c71f182d654e61318e2ac15e
Origin-Change-Id: Iedf5b128ae1743f633d2821ac3e402942ad6642b
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 62797
Fix build with gcc-4.8 and array boundaries issue

Remove unused parameters of static functions to avoid warning with 4.8.
Fix array index out of bounds issue when register number exceeds limit.
It shouldn't occur in real world, but static verifiers can detect it.

Change-Id: Id237df905b40bad02fc8cbbeac31084040f58076
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>