mirror of
https://github.com/raspberrypi/userland.git
synced 2025-12-06 04:49:12 +00:00
vc_dispmanx_display_open: allow display to be set with VC_DISPLAY env variable
Allow end-users to set the default display through a VC_DISPLAY environement variable. E.g. to force hello_teapot to display on HDMI one could execute: VC_DISPLAY=5 ./hello_teapot.bin Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
This commit is contained in:
@@ -25,6 +25,7 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "vchost_config.h"
|
||||
#include "vchost.h"
|
||||
@@ -510,6 +511,13 @@ VCHPRE_ int VCHPOST_ vc_dispmanx_resource_write_data_handle( DISPMANX_RESOURCE_H
|
||||
***********************************************************/
|
||||
VCHPRE_ DISPMANX_DISPLAY_HANDLE_T VCHPOST_ vc_dispmanx_display_open( uint32_t device ) {
|
||||
uint32_t display_handle;
|
||||
char *env = getenv("VC_DISPLAY");
|
||||
|
||||
if (device == 0 && env)
|
||||
{
|
||||
device = atoi(env);
|
||||
}
|
||||
|
||||
device = VC_HTOV32(device);
|
||||
display_handle = dispmanx_get_handle(EDispmanDisplayOpen,
|
||||
&device, sizeof(device));
|
||||
|
||||
Reference in New Issue
Block a user