From 12fb1ca0b5f4ba139889e6005a4aed6d03467864 Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Thu, 28 Sep 2017 13:01:08 +0100 Subject: base: Introducing utility for writing raw data in png format Originally it was possible to use a Bitmap writer class for dumping a framebuffer snapshot in a .bmp file. This patch enables you to choose another format. In particular it implements the writing of PNG Images using libpng library. The latter has to be already installed in your machine, otherwise gem5 will default to the Bitmap format. This configurable writer has been introduced in the VNC frame dumping mechanism, which is storing changed frame buffers from the VNC server Change-Id: Id7e5763c82235f1ce90381c8486b85a7cce734ce Reviewed-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/5181 Reviewed-by: Jason Lowe-Power Maintainer: Andreas Sandberg --- SConstruct | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'SConstruct') diff --git a/SConstruct b/SConstruct index 95efb8384..230232d7f 100755 --- a/SConstruct +++ b/SConstruct @@ -1,6 +1,6 @@ # -*- mode:python -*- -# Copyright (c) 2013, 2015, 2016 ARM Limited +# Copyright (c) 2013, 2015-2017 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall @@ -1134,6 +1134,14 @@ if not have_fenv: print "Warning: Header file not found." print " This host has no IEEE FP rounding mode control." +# Check for (libpng library needed if wanting to dump +# frame buffer image in png format) +have_png = conf.CheckHeader('png.h', '<>') +if not have_png: + print "Warning: Header file not found." + print " This host has no libpng library." + print " Disabling support for PNG framebuffers." + # Check if we should enable KVM-based hardware virtualization. The API # we rely on exists since version 2.6.36 of the kernel, but somehow # the KVM_API_VERSION does not reflect the change. We test for one of @@ -1278,8 +1286,11 @@ sticky_vars.AddVariables( False), BoolVariable('USE_POSIX_CLOCK', 'Use POSIX Clocks', have_posix_clock), BoolVariable('USE_FENV', 'Use IEEE mode control', have_fenv), - BoolVariable('CP_ANNOTATE', 'Enable critical path annotation capability', False), - BoolVariable('USE_KVM', 'Enable hardware virtualized (KVM) CPU models', have_kvm), + BoolVariable('USE_PNG', 'Enable support for PNG images', have_png), + BoolVariable('CP_ANNOTATE', 'Enable critical path annotation capability', + False), + BoolVariable('USE_KVM', 'Enable hardware virtualized (KVM) CPU models', + have_kvm), BoolVariable('USE_TUNTAP', 'Enable using a tap device to bridge to the host network', have_tuntap), @@ -1293,7 +1304,8 @@ sticky_vars.AddVariables( # These variables get exported to #defines in config/*.hh (see src/SConscript). export_vars += ['USE_FENV', 'SS_COMPATIBLE_FP', 'TARGET_ISA', 'TARGET_GPU_ISA', 'CP_ANNOTATE', 'USE_POSIX_CLOCK', 'USE_KVM', 'USE_TUNTAP', - 'PROTOCOL', 'HAVE_PROTOBUF', 'HAVE_PERF_ATTR_EXCLUDE_HOST'] + 'PROTOCOL', 'HAVE_PROTOBUF', 'HAVE_PERF_ATTR_EXCLUDE_HOST', + 'USE_PNG'] ################################################### # @@ -1486,6 +1498,14 @@ for variant_path in variant_paths: print "Warning: No IEEE FP rounding mode control in", variant_dir + "." print " FP results may deviate slightly from other platforms." + if not have_png and env['USE_PNG']: + print "Warning: not available; " \ + "forcing USE_PNG to False in", variant_dir + "." + env['USE_PNG'] = False + + if env['USE_PNG']: + env.Append(LIBS=['png']) + if env['EFENCE']: env.Append(LIBS=['efence']) -- cgit v1.2.3