st/omx: straighten get/put_screen
authorEmil Velikov <emil.l.velikov@gmail.com>
Mon, 9 Nov 2015 11:03:01 +0000 (11:03 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Fri, 20 Nov 2015 10:56:10 +0000 (10:56 +0000)
commita8f45e0161c13fbda6f3b846219a3eb1d44b25de
tree7d73dea08f1eb3181551687d975c808d865890e9
parent7157085140a502a182ff0e23d30bd8e421212c42
st/omx: straighten get/put_screen

The current code is busted in a number of ways.

 - initially checks for omx_display (rather than omx_screen), which may
or may not be around.
 - blindly feeds the empty env variable string to loader_open_device()
 - reads the env variable every time get_screen is called
 - the latter manifests into memory leaks, and other issues as one sets
the variable between two get_screen calls.

Additionally it cleans up a couple of extra bits
 - drops unneeded set/check of omx_display.
 - make the teardown (put_screen) order was not symmetrical to the setup
(get_screen)

v2: Drop the "is empty string" check (Leo)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
src/gallium/state_trackers/omx/entrypoint.c