Fix drmmode_copy_from_to
Fix drmmode_copy_from_to

The number of useful data pixels in a buffer row is its width.  The total
storage (in bytes) of that row, including padding, is its pitch.

The previous version of drmmode_copy_from_to() would try to copy the
entire row pitch, including padding, instead of just its width.

This was arguably inefficient when copying from a bigger buffer into a
smaller buffer as it would also fill the padding bytes.
It was wrong when copying from a smaller buffer into a bigger buffer
as it would also copy from the padding region, overwriting existing data
bytes in the bigger buffer.

Signed-off-by: Daniel Kurtz <31914e832df1cd8e5daa417106c0c6f5297b27d7@chromium.org>

BUG=chromium-os:36241
TEST=No X crashes on HDMI plug/unplug.
     No corruption seen when switching between blit & flip mode
     (Tested by starting a non-full screen X app, such as xev or mtplot)

Change-Id: Id203d052090c69167a6fa47091033df2411449c2
Reviewed-on: https://gerrit.chromium.org/gerrit/37811
Reviewed-by: Stéphane Marchesin <e16f69845633a0cf74affe1e5a677caa6296c937@chromium.org>
Commit-Ready: Daniel Kurtz <31914e832df1cd8e5daa417106c0c6f5297b27d7@chromium.org>
Reviewed-by: Daniel Kurtz <31914e832df1cd8e5daa417106c0c6f5297b27d7@chromium.org>
Tested-by: Daniel Kurtz <31914e832df1cd8e5daa417106c0c6f5297b27d7@chromium.org>

markyzq/armsoc-rockchip,markyzq/armsoc-rockchip