DMX glxproxy: Don't allocate & copy data just to free it unused
authorAlan Coopersmith <alan.coopersmith@oracle.com>
Wed, 4 Sep 2013 05:53:28 +0000 (22:53 -0700)
committerAlan Coopersmith <alan.coopersmith@oracle.com>
Tue, 15 Oct 2013 00:56:44 +0000 (17:56 -0700)
commit2704bdb24a2c7bac65b90e05f1a68438b34ecf58
tree72eb3ff1aacc4bd65ab34abb3b3e270ae3383905
parent6c06c268adbab63ebe7490489aa030724cbdc54b
DMX glxproxy: Don't allocate & copy data just to free it unused

Two functions in the DMX glxproxy code loop over all the backend
screens, starting at the highest numbered and counting down to
the lowest.

Previously, for each screen, the code would allocate a buffer
large enough to read the reply from the backend, copy that reply
into the buffer, and then if it wasn't the final screen, free it.
Only the buffer from the final screen is used, to pass on to the
client in the reply.

This modifies it to just immediately discard the responses from
the screens as we loop through it, only doing the allocate & copy
work for the one buffer we pass back to the client.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Alex Deucher <aleander.deucher@amd.com>
hw/dmx/glxProxy/glxsingle.c
hw/dmx/glxProxy/glxvendor.c