Re: [Intel-gfx] [PATCH] tests/kms_color:Color IGT
Please make sure your patch is tagged with "i-g-t" so it is correctly identified by patchwork, as described in: http://lists.freedesktop.org/archives/intel-gfx/2015-November/079712.html It would also be helpful if the subject line briefly mentions what the patch does. On 20 November 2015 at 10:27, Dhanya Pillai wrote: > From: Dhanya > > This patch will verify color correction capability of a display driver. > Gamma/CSC/De-gamma verifications are supported. I have made a few specific comments below about this patch, but it would be good to include tests that verify the various features by comparing CRCs of a reference image and the output pipe. This would ensure that what is displayed on screen exactly corresponds to the expected state. > > Signed-off-by: Dhanya > --- > tests/Makefile.sources |1 + > tests/kms_color.c | 1070 > Please also add the binary name to .gitignore. > 2 files changed, 1071 insertions(+) > create mode 100644 tests/kms_color.c > > diff --git a/tests/Makefile.sources b/tests/Makefile.sources > index 8fb2de8..906c14f 100644 > --- a/tests/Makefile.sources > +++ b/tests/Makefile.sources > @@ -64,6 +64,7 @@ TESTS_progs_M = \ > gem_write_read_ring_switch \ > kms_addfb_basic \ > kms_atomic \ > + kms_color \ > kms_cursor_crc \ > kms_draw_crc \ > kms_fbc_crc \ > diff --git a/tests/kms_color.c b/tests/kms_color.c > new file mode 100644 > index 000..c261c3f > --- /dev/null > +++ b/tests/kms_color.c This test produces a lot of compiler warnings and an error with the default CFLAGS. I have not mentioned them individually below, but please check and make sure the problems are addressed. > @@ -0,0 +1,1070 @@ > +/* > + * Copyright © 2015 Intel Corporation > + * > + * Permission is hereby granted, free of charge, to any person obtaining a > + * copy of this software and associated documentation files (the "Software"), > + * to deal in the Software without restriction, including without limitation > + * the rights to use, copy, modify, merge, publish, distribute, sublicense, > + * and/or sell copies of the Software, and to permit persons to whom the > + * Software is furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice (including the next > + * paragraph) shall be included in all copies or substantial portions of the > + * Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER > DEALINGS > + * IN THE SOFTWARE. > + * > + */ > + > +#include > +#include "drmtest.h" > +#include "drm.h" > +#include "igt_debugfs.h" > +#include "igt_kms.h" > +#include "igt_core.h" > +#include "intel_io.h" > +#include "intel_chipset.h" > +#include "igt_aux.h" > +#include > +#include > +#include > +#include > + > + > +IGT_TEST_DESCRIPTION("Test Color Features at Pipe level"); It would be helpful if a more detailed description of the test could also be included here as a comment, specifying what specific featues are under test and how the results are verified. > +typedef unsigned char u8; > +typedef uint16_t u16; > +typedef uint32_t u32; These typedefs are not used anywhere, so can be removed. > + > +#define CSC_MAX_VALS9 > + > +#define GEN9_SPLITGAMMA_MAX_VALS512 > +#define GEN9_8BIT_GAMMA_MAX_VALS256 > +#define GEN9_10BIT_GAMMA_MAX_VALS 1024 > +#define GEN9_12BIT_GAMMA_MAX_VALS 513 > +#define BDW_MAX_GAMMA ((1 << 24) - 1) > + > + > +#define CSC_COEFF_MAX 0x3FE00 > +#define CSC_COEFF_MIN 0xFFFC The above defines are not used anywhere. > + > +#define VAR_LEN 100 > +/*OFFSETS*/ > + > +#define _PIPE_A_CSC_COEFF 0x49010 > +#define _PIPE_B_CSC_COEFF 0x49110 > +#define GAMMA_8BIT_PIPEA 0x4A000 > +#define GAMMA_8BIT_PIPEB 0x4A800 > +#define GAMMA_8BIT_PIPEC 0x4B000 > + > +#define GAMMA_10BIT_PIPEA 0x4A404 > +#define GAMMA_10BIT_PIPEB 0x4AC04 > +#define GAMMA_10BIT_PIPEC 0x4B404 The PIPEC defines are not used. > + > +#define CSC_TEST 0 > +#define GAMMA_TEST 1 > +#define DEGAMMA_TEST 2 > +#define ENABLE 0 > +#define DISABLE 1 > +#define RED 0 > +#define GREEN 1 > +#define BLUE 2 > +#define UNITY 3 > +#define GAMMA_1 0 > +#define GAMMA_2 1 > +#define GAMMA_2_2 2 > +#define PRIMARY 0 > +#define SECONDARY 1 The SECONDARY define is not used, and the PRIMARY define appears to be used in two different contexts. Could this be clarified? > + > +#define CSC_COEFF_UNITY 0x1 > + > +
Re: [Intel-gfx] [PATCH i-g-t] scripts: Add feature list file for piglit 'summary feature'
On 25 November 2015 at 12:12, Gabriel Feceoru wrote: > This is a placeholder for the feature list file. Its content is just > an example. It would be useful if the example applied directly to intel-gpu-tools tests. Perhaps just a single feature to start with? Since this isn't a script as such, would it be better placed in the tests directory where the test list is generated? It would probably be useful to integrate it with the run-tests.sh script as well. > This needs to be filled in by feature owners with the feature name > and the corresponding tests regex. > > Please refer to this piglit commit for more info on this feature. > > commit f16d011db75b08ceae241e7370599146691340ab > Author: Feceoru, Gabriel > Date: Tue Nov 3 17:50:41 2015 +0200 > > framework: Add support for feature readiness. > > Signed-off-by: Gabriel Feceoru > --- > scripts/feat_profile.json | 12 > 1 file changed, 12 insertions(+) > create mode 100644 scripts/feat_profile.json > > diff --git a/scripts/feat_profile.json b/scripts/feat_profile.json > new file mode 100644 > index 000..f3a21a3 > --- /dev/null > +++ b/scripts/feat_profile.json > @@ -0,0 +1,12 @@ > +{ > +"glsl" : { > +"include_tests" : "glsl", > +"exclude_tests" : "", > +"target_rate" : 90 > +}, > +"arb" : { > +"include_tests" : "ARB_shader|deqp.arb shader", > +"exclude_tests" : "", > +"target_rate" : 10 > +} > +} > -- > 1.9.1 > > ___ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH i-g-t] scripts: Add support to retest tests wich changed results
On 27 November 2015 at 12:40, Gabriel Feceoru wrote: > This script takes multiple test results and prints the diffs, useful > for detecting noise in subsequent executions. > It gives the option to re-run these tests. This feature might be useful in Piglit itself. It sounds similar to the ideas mentioned in this thread: http://lists.freedesktop.org/archives/piglit/2015-November/018197.html > > Signed-off-by: Gabriel Feceoru > --- > scripts/retest-diff.sh | 72 > ++ > 1 file changed, 72 insertions(+) > create mode 100755 scripts/retest-diff.sh > > diff --git a/scripts/retest-diff.sh b/scripts/retest-diff.sh > new file mode 100755 > index 000..aee1d05 > --- /dev/null > +++ b/scripts/retest-diff.sh > @@ -0,0 +1,72 @@ > +#!/bin/bash > +# > +# Copyright © 2015 Intel Corporation > +# > +# Permission is hereby granted, free of charge, to any person obtaining a > +# copy of this software and associated documentation files (the "Software"), > +# to deal in the Software without restriction, including without limitation > +# the rights to use, copy, modify, merge, publish, distribute, sublicense, > +# and/or sell copies of the Software, and to permit persons to whom the > +# Software is furnished to do so, subject to the following conditions: > +# > +# The above copyright notice and this permission notice (including the next > +# paragraph) shall be included in all copies or substantial portions of the > +# Software. > +# > +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER > DEALINGS > +# IN THE SOFTWARE. > + > +ROOT="`dirname $0`" > +ROOT="`readlink -f $ROOT/..`" > +IGT_TEST_ROOT="$ROOT/tests" > +RESULTS="$ROOT/results" > +PIGLIT="$ROOT/piglit/piglit" > + > +if [ ! -d "$IGT_TEST_ROOT" ]; then > + echo "Error: could not find tests directory." > + exit 1 > +fi > + > +function print_help { > + echo "Usage: $0 [ ...]" > + echo "" > +} > + > + > +if [ $# -lt 2 ]; then > + print_help > + exit 1 > +fi > + > +RESULT_FILES=$@ > + > +for result in $RESULT_FILES; do > +if [ ! -e $result ]; then > +echo "Wrong result paths" > +exit 1 > +fi > +done > + > + > +TESTS=`$PIGLIT summary console -d $RESULT_FILES | grep igt | cut -d':' -f1` > +if [[ -z $TESTS ]]; then > +exit 1 > +else > +RED='\033[0;31m' > +NC='\033[0m' > +printf "$RED $TESTS $NC " | sed -e 's/ /\n/g' > +fi > + > + > +read -p "Dow you want to run these tests [y/N]? " -n 2 -r > +if [[ $REPLY =~ ^[Yy]$ ]]; then > +mkdir -p $RESULTS > +TEST_LIST=($TESTS) > +TEST_PARAMS=`printf "%s " "${TEST_LIST[@]/#/-t }"` > +sudo IGT_TEST_ROOT=$IGT_TEST_ROOT $PIGLIT run igt $RESULTS $TEST_PARAMS > +fi > -- > 1.9.1 > > ___ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t] tests/gem_request_retire: add test description
Cc: Tvrtko Ursulin Signed-off-by: Thomas Wood --- tests/gem_request_retire.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/gem_request_retire.c b/tests/gem_request_retire.c index 0c7c45e..545a245 100644 --- a/tests/gem_request_retire.c +++ b/tests/gem_request_retire.c @@ -49,6 +49,9 @@ #include "intel_bufmgr.h" +IGT_TEST_DESCRIPTION("Collection of tests targeting request retirement code" +" paths."); + #define WIDTH 4096 #define HEIGHT 4096 #define BO_SIZE (WIDTH * HEIGHT * sizeof(uint32_t)) -- 1.9.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH i-g-t 1/3] tests/kms_force_connector: Fixes
On 1 December 2015 at 08:08, Daniel Vetter wrote: > Two things: > - Somehow the kernel's mode list changed with our EDID. No idea > whether that's the right thing here since I'm not really an EDID > expert. But then again the testcase wants to check that the > injection works, not validate the kernel's parser. If only checking that the injection worked, perhaps it would be more robust just to check that at least one of the expected modes is present, in any position in the array. Ideally this would be a mode that isn't included in the default modes when a connector is enabled. > > - We need to disable the forcing _before_ we reprobe to check whether > everything is back to normal: With the EDID gone but the connection > still force to on the kernel will fall back to a default low-res > mode list, making the testcase fail. This should be taken into account with the value of start_n_modes, since this is calculated after the connector is enabled. > > Signed-off-by: Daniel Vetter > --- > tests/kms_force_connector.c | 8 +--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c > index 838a3b0ae2e6..5f3f4a5400f5 100644 > --- a/tests/kms_force_connector.c > +++ b/tests/kms_force_connector.c > @@ -153,20 +153,22 @@ int main(int argc, char **argv) > CHECK_MODE(temp->modes[1], 1280, 720, 60); > CHECK_MODE(temp->modes[2], 1024, 768, 60); > CHECK_MODE(temp->modes[3], 800, 600, 60); > - CHECK_MODE(temp->modes[4], 640, 480, 60); > + CHECK_MODE(temp->modes[4], 800, 600, 56); > + CHECK_MODE(temp->modes[5], 848, 480, 60); > + CHECK_MODE(temp->modes[6], 640, 480, 60); > > drmModeFreeConnector(temp); > > /* remove edid */ > kmstest_force_edid(drm_fd, vga_connector, NULL, 0); > + kmstest_force_connector(drm_fd, vga_connector, > + FORCE_CONNECTOR_UNSPECIFIED); > temp = drmModeGetConnector(drm_fd, > vga_connector->connector_id); > /* the connector should now have the same number of modes that > * it started with */ > igt_assert_eq(temp->count_modes, start_n_modes); > drmModeFreeConnector(temp); > > - kmstest_force_connector(drm_fd, vga_connector, > - FORCE_CONNECTOR_UNSPECIFIED); > } > > igt_fixture { > -- > 2.1.0 > > ___ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH i-g-t 3/3] tests/kms_force_connector: Include in BAT set
On 1 December 2015 at 10:24, Daniel Vetter wrote: > Forcing connector state is a basic piece of our test infrastructure > that we use in all the kms_ tests. It allows us to run tests even if > no outputs are connected. > > They're also really fast, so perfect candidates for inclusion into the > BAT set. > > Signed-off-by: Daniel Vetter > --- > tests/.gitignore | 2 +- > tests/Makefile.sources| 2 +- > tests/kms_force_connector.c | 189 > -- > tests/kms_force_connector_basic.c | 189 > ++ Would it be worth renaming the subtests instead, in case there are future tests that would make sense in kms_force_connector but that shouldn't be included in the BAT list? > 4 files changed, 191 insertions(+), 191 deletions(-) > delete mode 100644 tests/kms_force_connector.c > create mode 100644 tests/kms_force_connector_basic.c > > diff --git a/tests/.gitignore b/tests/.gitignore > index 43d63d3abac9..900c681caec9 100644 > --- a/tests/.gitignore > +++ b/tests/.gitignore > @@ -138,7 +138,7 @@ kms_fence_pin_leak > kms_flip > kms_flip_event_leak > kms_flip_tiling > -kms_force_connector > +kms_force_connector_basic > kms_frontbuffer_tracking > kms_legacy_colorkey > kms_mmio_vs_cs_flip > diff --git a/tests/Makefile.sources b/tests/Makefile.sources > index b70bca060253..63de439d8717 100644 > --- a/tests/Makefile.sources > +++ b/tests/Makefile.sources > @@ -163,7 +163,7 @@ TESTS_progs = \ > gen7_forcewake_mt \ > kms_3d \ > kms_fence_pin_leak \ > - kms_force_connector \ > + kms_force_connector_basic \ > kms_pwrite_crc \ > kms_sink_crc_basic \ > prime_udl \ > diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c > deleted file mode 100644 > index 637f625a852f.. > --- a/tests/kms_force_connector.c > +++ /dev/null > @@ -1,189 +0,0 @@ > -/* > - * Copyright © 2014 Intel Corporation > - * > - * Permission is hereby granted, free of charge, to any person obtaining a > - * copy of this software and associated documentation files (the "Software"), > - * to deal in the Software without restriction, including without limitation > - * the rights to use, copy, modify, merge, publish, distribute, sublicense, > - * and/or sell copies of the Software, and to permit persons to whom the > - * Software is furnished to do so, subject to the following conditions: > - * > - * The above copyright notice and this permission notice (including the next > - * paragraph) shall be included in all copies or substantial portions of the > - * Software. > - * > - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER > DEALINGS > - * IN THE SOFTWARE. > - * > - */ > - > -#include "igt.h" > - > -IGT_TEST_DESCRIPTION("Check the debugfs force connector/edid features work" > -" correctly."); > - > -#define CHECK_MODE(m, h, w, r) \ > - igt_assert_eq(m.hdisplay, h); igt_assert_eq(m.vdisplay, w); \ > - igt_assert_eq(m.vrefresh, r); > - > -static void reset_connectors(void) > -{ > - int drm_fd = 0; > - drmModeRes *res; > - drmModeConnector *connector = NULL; > - > - drm_fd = drm_open_driver_master(DRIVER_INTEL); > - res = drmModeGetResources(drm_fd); > - > - for (int i = 0; i < res->count_connectors; i++) { > - > - connector = drmModeGetConnectorCurrent(drm_fd, > - res->connectors[i]); > - > - kmstest_force_connector(drm_fd, connector, > - FORCE_CONNECTOR_UNSPECIFIED); > - > - kmstest_force_edid(drm_fd, connector, NULL, 0); > - > - drmModeFreeConnector(connector); > - } > -} > - > -static int opt_handler(int opt, int opt_index, void *data) > -{ > - switch (opt) { > - case 'r': > - reset_connectors(); > - exit(0); > - break; > - } > - > - return 0; > -} > - > -int main(int argc, char **argv) > -{ > - /* force the VGA output and test that it worked */ > - int drm_fd = 0; > - drmModeRes *res; > - drmModeConnector *vga_connector = NULL, *temp; > - int start_n_modes, start_connection; > - struct option long_opts[] = { > - {"reset", 0, 0, 'r'}, > - {0, 0, 0, 0} > - }; > - const char *help_str = > - " --reset\t\tReset all connector force states and edid.\n"; > - > - igt_subtest_init_
[Intel-gfx] [PATCH i-g-t 1/3] lib: add missing documentation for drm open functions
Signed-off-by: Thomas Wood --- lib/drmtest.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/drmtest.c b/lib/drmtest.c index 16a3638..2896af0 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -225,11 +225,10 @@ int drm_get_card(void) /** * __drm_open_driver: + * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL * * Open the first DRM device we can find, searching up to 16 device nodes * - * @chipset: OR'd flags for each chipset to search, eg. DRIVER_INTEL - * * Returns: * An open DRM fd or -1 on error */ @@ -313,6 +312,7 @@ static void quiescent_gpu_at_exit_render(int sig) /** * drm_open_driver: + * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL * * Open a drm legacy device node. This function always returns a valid * file descriptor. @@ -340,6 +340,7 @@ int drm_open_driver(int chipset) /** * drm_open_driver_master: + * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL * * Open a drm legacy device node and ensure that it is drm master. * @@ -359,6 +360,7 @@ int drm_open_driver_master(int chipset) /** * drm_open_driver_render: + * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL * * Open a drm render device node. * -- 1.9.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 2/3] lib: document intel_pipe_crc_source enum values
Signed-off-by: Thomas Wood --- lib/igt_debugfs.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h index ee9ff40..3d5a811 100644 --- a/lib/igt_debugfs.h +++ b/lib/igt_debugfs.h @@ -77,6 +77,17 @@ typedef struct { /** * intel_pipe_crc_source: + * @INTEL_PIPE_CRC_SOURCE_NONE: No source + * @INTEL_PIPE_CRC_SOURCE_PLANE1: Plane 1 + * @INTEL_PIPE_CRC_SOURCE_PLANE2: Plane 2 + * @INTEL_PIPE_CRC_SOURCE_PF: Panel Fitter + * @INTEL_PIPE_CRC_SOURCE_PIPE: Pipe + * @INTEL_PIPE_CRC_SOURCE_TV: TV + * @INTEL_PIPE_CRC_SOURCE_DP_B: DisplayPort B + * @INTEL_PIPE_CRC_SOURCE_DP_C: DisplayPort C + * @INTEL_PIPE_CRC_SOURCE_DP_D: DisplayPort D + * @INTEL_PIPE_CRC_SOURCE_AUTO: Automatic source selection + * @INTEL_PIPE_CRC_SOURCE_MAX: Number of available sources * * Enumeration of all supported pipe CRC sources. Not all platforms and all * outputs support all of them. Generic tests should just use -- 1.9.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 3/3] docs: exclude gpgpu_fill.h
gpgpu_fill.h is only used internally by the library. Signed-off-by: Thomas Wood --- docs/reference/intel-gpu-tools/Makefile.am | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/reference/intel-gpu-tools/Makefile.am b/docs/reference/intel-gpu-tools/Makefile.am index 0363014..f5719d4 100644 --- a/docs/reference/intel-gpu-tools/Makefile.am +++ b/docs/reference/intel-gpu-tools/Makefile.am @@ -125,9 +125,10 @@ EXTRA_HFILES= # Header files or dirs to ignore when scanning. Use base file/dir names # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h private_code IGNORE_HFILES=gen6_render.h gen7_media.h gen7_render.h gen8_media.h \ - gen8_render.h i830_reg.h i915_3d.h i915_pciids.h i915_reg.h \ - intel_reg.h debug.h instdone.h media_fill.h rendercopy.h \ - media_spin.h media_fill_gen9.h gen9_render.h version.h + gen8_render.h gpgpu_fill.h i830_reg.h i915_3d.h i915_pciids.h \ + i915_reg.h intel_reg.h debug.h instdone.h media_fill.h \ + rendercopy.h media_spin.h media_fill_gen9.h gen9_render.h \ + version.h # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png -- 1.9.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 2/2] tests/core_setmaster_vs_auth: add test description macro
Signed-off-by: Thomas Wood --- tests/core_setmaster_vs_auth.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/core_setmaster_vs_auth.c b/tests/core_setmaster_vs_auth.c index 44ec752..97add9c 100644 --- a/tests/core_setmaster_vs_auth.c +++ b/tests/core_setmaster_vs_auth.c @@ -45,6 +45,9 @@ # include #endif +IGT_TEST_DESCRIPTION("Check that drop/setMaster correctly transfer master " +"state"): + igt_simple_main { int master1, master2, client; -- 1.9.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 1/2] tests/core_setmaster_vs_auth: use igt_simple_main
This test has no subtests, so should use igt_simple_main. Signed-off-by: Thomas Wood --- tests/core_setmaster_vs_auth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/core_setmaster_vs_auth.c b/tests/core_setmaster_vs_auth.c index efb27b1..44ec752 100644 --- a/tests/core_setmaster_vs_auth.c +++ b/tests/core_setmaster_vs_auth.c @@ -45,7 +45,7 @@ # include #endif -igt_main +igt_simple_main { int master1, master2, client; drm_magic_t magic; -- 1.9.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [ANNOUNCE] intel-gpu-tools 1.13
A new intel-gpu-tools quarterly release is available with the following changes: - New test: kms_atomic tests atomic mode setting (Daniel Stone) - New test: core_prop_blob tests blob properties (Daniel Stone) - New test: gem_request_retire targets request retirement code paths (Tvrtko Ursulin) - New test: core_setmaster_vs_auth checks that drop/setMaster correctly transfer master state (Thomas Hellstrom/Daniel Vetter) - Wildcard characters are now accepted when using the --run-subtest command line option to specify multiple subtests to run. (Thomas Wood) - Add support for Broxton in intel_audio_dump (Han Lu) - Added Kabylake support (Rodrigo Vivi/Wayne Boyer) - Many other bug fixes and improvements Complete list of changes since 1.12: Ander Conselvan de Oliveira (1): testdisplay: Fix segfault after first modeset fails Ben Widawsky (1): igt/intel_aubdump: Use the right ring Chris Wilson (24): benchmarks: Measure BLT performance benchmarks/gem_blt: Fix compilation after rebase and add batch-size tests/gem_pwrite_snooped: Fix use of GCC pragmas lib: Fix querying context GTT size Update CONTEXT_PARAM for GTT_SIZE reporting igt/gem_concurrent_all: Add snoop concurrency tests benchmark/gem_wait: poc for benchmarking i915_wait_request overhead benchmarks/gem_wait: Remove pthread_cancel() igt/gem_userptr_blits: Correct the number of objects required lib: Make instdone initialisation fail gracefully lib: Add missing #include benchmarks/gem_blt: Report peak throughput benchmarks: Add README igt/gem_concurrent_all: Add testcases that split the copying across rings igt/gem_mmap_gtt: Require SET_TILING to work before doing large tiled tests benchmarks/gem_blt: Fixup a couple of non-llc foibles overlay: Show power consumption without i915-pmu drmtest: Use standard gem_execbuf() calls in gem_quiescent_gpu() benchmarks: Add a set-domain benchmark igt/drm_read: Check handling of pagefault on destination buffer igt/drm_read: Clear O_NONBLOCK between tests igt/gem_cs_prefetch: Convert to intel_require_memory() benchmarks/gem_exec_ctx: Measure switching between fds lib: gem_set_caching() use drmIoctl() rather than ioctl() Daniel Stone (10): lib/igt_core: Add igt_assert_neq_*() variants lib/igt_core: Add igt_assert_fd lib/igt.cocci: Add greater-than to igt_assert_lt* lib/drmtest: Add do_ioctl_err to expect failure lib/igt.cocci: De-opencode ioctls tests: Add blob-property test lib/tests: Add igt_assert_*() self-tests tests: Run igt.cocci tests/core_prop_blob: Add multiple blobs per connection kms_atomic: Add basic atomic modesetting tests Daniel Vetter (5): lib/core: Fix docs for igt_assert_lt(e) tests: Rename drm_auth to core_auth tests: add core_setmaster_vs_auth tests/pm_rpm: Don't compare edid blob IDs tests: Add core_setmaster_vs_auth.c Daniele Ceraolo Spurio (1): tests/gem_ctx_param_basic.c: fix non-root-set-no-zeromap subtest Derek Morton (4): benchmarks: Fix build errors on Android M-Dessert tests/core_prop_blob: Fix core_prop_blob for android benchmarks/gem_blt: Include igt.h in gem_blt.c tests/gem_exec_nop: Improved test run time Jani Nikula (3): scripts: remove display_debug.sh as obsolete tools: fix intel_gpu_abrt to use intel_reg tests: fix ddx_intel_after_fbdev to use intel_reg Joonas Lahtinen (1): lib/igt_core: Prefer CLOCK_MONOTONIC_RAW Lu, Han (1): tools/intel_audio_dump: add support for Broxton Maarten Lankhorst (1): tests/kms_setmode: Handle MST correctly. Marius Vlad (1): tests/pm_rpm tests for set_caching and set_tiling ioctl(s) Matt Roper (2): kms_universal_plane: Add gen9-specific test kms_cursor_crc: Add test for unthrottled cursor movement Matt Turner (1): tools/aubdump: Link with -ldl. Mika Kuoppala (2): lib: Add Skylake Intel Graphics GT4 PCI IDs tests/drm_import_export: Always loop with mutex held Paulo Zanoni (19): lib/igt_fb: don't forget to close parens on message printed kms_frontbuffer_tracking: change pattern 1's last rect to 1x1 kms_frontbuffer_tracking: set the universal planes cap in the setup kms_frontbuffer_tracking: add scaledprimary subtest kms_frontbuffer_tracking: don't mode unset when checking sink CRC support kms_frontbuffer_tracking: add fliptrack subtest kms_frontbuffer_tracking: unset crtcs after getting the base blue CRC kms_frontbuffer_tracking: add flag to not assert feature status kms_frontbuffer_tracking: add stridechange subtest kms_frontbuffer_tracking: remove opt.only_feature lib/igt_fb: fix fb->size when provided by the user lib/igt_fb: fix igt_create_fb_with_bo_size() documentation lib/igt_f
Re: [Intel-gfx] [PATCH i-g-t 2/3] tests/drm_lib.sh: Skip when i915 debugfs wasn't found
On 3 December 2015 at 06:45, Daniel Vetter wrote: > Instead of failing. We might want to move this into i915 tests > eventually, but this is good for now. > > Signed-off-by: Daniel Vetter > --- > tests/drm_lib.sh | 7 ++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh > index c50664c7730d..e7ec4a1cfcb5 100755 > --- a/tests/drm_lib.sh > +++ b/tests/drm_lib.sh > @@ -28,6 +28,11 @@ for arg in $@ ; do > esac > done > > +skip() { > + echo "$@" > + exit 1 Shouldn't this be 77 to indicate skip? > +} > + > die() { > echo "$@" > exit 1 > @@ -54,7 +59,7 @@ for minor in `seq 0 16`; do > done > > if [ $i915_dfs_path = "x" ] ; then > - die " i915 debugfs path not found." > + skip " i915 debugfs path not found." > fi > > # read everything we can > -- > 2.5.1 > > ___ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH i-g-t 2/3] tests/drm_lib.sh: Skip when i915 debugfs wasn't found
On 3 December 2015 at 10:46, Morton, Derek J wrote: >> >> >>-Original Message- >>From: Intel-gfx [mailto:intel-gfx-boun...@lists.freedesktop.org] On Behalf Of >>Thomas Wood >>Sent: Thursday, December 3, 2015 10:08 AM >>To: Daniel Vetter >>Cc: Intel Graphics Development >>Subject: Re: [Intel-gfx] [PATCH i-g-t 2/3] tests/drm_lib.sh: Skip when i915 >>debugfs wasn't found >> >>On 3 December 2015 at 06:45, Daniel Vetter wrote: >>> Instead of failing. We might want to move this into i915 tests >>> eventually, but this is good for now. >>> >>> Signed-off-by: Daniel Vetter >>> --- >>> tests/drm_lib.sh | 7 ++- >>> 1 file changed, 6 insertions(+), 1 deletion(-) >>> >>> diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh index >>> c50664c7730d..e7ec4a1cfcb5 100755 >>> --- a/tests/drm_lib.sh >>> +++ b/tests/drm_lib.sh >>> @@ -28,6 +28,11 @@ for arg in $@ ; do >>> esac >>> done >>> >>> +skip() { >>> + echo "$@" >>> + exit 1 >> >>Shouldn't this be 77 to indicate skip? > > Why have hard coded values at all? IGT_EXIT_SKIP is already defined as the > value returned when a test skips. The code is more maintainable if fixed > values are only defined in 1 place. These aren't actually defined for the shell scripts, but it would probably be a good idea to do so for the reason you mention. > > //Derek > >> >> >>> +} >>> + >>> die() { >>> echo "$@" >>> exit 1 >>> @@ -54,7 +59,7 @@ for minor in `seq 0 16`; do done >>> >>> if [ $i915_dfs_path = "x" ] ; then >>> - die " i915 debugfs path not found." >>> + skip " i915 debugfs path not found." >>> fi >>> >>> # read everything we can >>> -- >>> 2.5.1 >>> >>> ___ >>> Intel-gfx mailing list >>> Intel-gfx@lists.freedesktop.org >>> http://lists.freedesktop.org/mailman/listinfo/intel-gfx >>___ >>Intel-gfx mailing list >>Intel-gfx@lists.freedesktop.org >>http://lists.freedesktop.org/mailman/listinfo/intel-gfx >> ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t] tests: add exit value constants for shell script tests
Signed-off-by: Thomas Wood --- tests/check_drm_clients | 2 +- tests/debugfs_emon_crash | 2 +- tests/drm_lib.sh | 22 ++ tests/drv_debugfs_reader | 2 +- tests/drv_missed_irq_hang | 14 +++--- tests/drv_module_reload_basic | 8 tests/kms_sysfs_edid_timing | 4 ++-- tests/sysfs_l3_parity | 6 +++--- tests/test_rte_check | 2 +- tests/tools_test | 2 +- 10 files changed, 35 insertions(+), 29 deletions(-) diff --git a/tests/check_drm_clients b/tests/check_drm_clients index eb12416..2a891b8 100755 --- a/tests/check_drm_clients +++ b/tests/check_drm_clients @@ -3,4 +3,4 @@ SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )" . $SOURCE_DIR/drm_lib.sh -exit 0 +exit $IGT_EXIT_SUCCESS diff --git a/tests/debugfs_emon_crash b/tests/debugfs_emon_crash index 809bfab..1dbfcb2 100755 --- a/tests/debugfs_emon_crash +++ b/tests/debugfs_emon_crash @@ -13,4 +13,4 @@ done # If we got here, we haven't crashed -exit 0 +exit $IGT_EXIT_SUCCESS diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh index c50664c..d2c6420 100755 --- a/tests/drm_lib.sh +++ b/tests/drm_lib.sh @@ -1,20 +1,26 @@ #!/bin/sh +IGT_EXIT_TIMEOUT=78 +IGT_EXIT_SKIP=77 +IGT_EXIT_SUCCESS=0 +IGT_EXIT_INVALID=79 +IGT_EXIT_FAILURE=99 + # hacked-up long option parsing for arg in $@ ; do case $arg in --list-subtests) - exit 79 + exit $IGT_EXIT_INVALID ;; --run-subtest) - exit 79 + exit $IGT_EXIT_INVALID ;; --debug) IGT_LOG_LEVEL=debug ;; --help-description) echo $IGT_TEST_DESCRIPTION - exit 0 + exit $IGT_EXIT_SUCCESS ;; --help) echo "Usage: `basename $0` [OPTIONS]" @@ -23,18 +29,18 @@ for arg in $@ ; do echo " --debug" echo " --help-description" echo " --help" - exit 0 + exit $IGT_EXIT_SUCCESS ;; esac done die() { echo "$@" - exit 1 + exit $IGT_EXIT_FAILURE } do_or_die() { - $@ > /dev/null 2>&1 || (echo "FAIL: $@ ($?)" && exit -1) + $@ > /dev/null 2>&1 || (echo "FAIL: $@ ($?)" && exit $IGT_EXIT_FAILURE) } if [ -d /debug/dri ] ; then @@ -63,7 +69,7 @@ if [ `cat $i915_dfs_path/clients | wc -l` -gt "2" ] ; then die "ERROR: other drm clients running" fi -whoami | grep -q root || ( echo ERROR: not running as root; exit 1 ) +whoami | grep -q root || ( echo ERROR: not running as root; exit $IGT_EXIT_FAILURE ) i915_sfs_path= if [ -d /sys/class/drm ] ; then @@ -76,7 +82,7 @@ fi function drmtest_skip_on_simulation() { - [ -n "$INTEL_SIMULATION" ] && exit 77 + [ -n "$INTEL_SIMULATION" ] && exit $IGT_EXIT_SKIP } drmtest_skip_on_simulation diff --git a/tests/drv_debugfs_reader b/tests/drv_debugfs_reader index 9e2845e..6ea4e64 100755 --- a/tests/drv_debugfs_reader +++ b/tests/drv_debugfs_reader @@ -6,4 +6,4 @@ SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )" # read everything we can cat $i915_dfs_path/* > /dev/null 2>&1 -exit 0 +exit $IGT_EXIT_SUCCESS diff --git a/tests/drv_missed_irq_hang b/tests/drv_missed_irq_hang index 6e8cfc2..8083fe5 100755 --- a/tests/drv_missed_irq_hang +++ b/tests/drv_missed_irq_hang @@ -19,20 +19,20 @@ function blt_wait { function check_for_missed_irq { if test `cat i915_ring_missed_irq` = 0x; then echo "missed interrupts undetected" - exit 1 + exit $IGT_EXIT_FAILURE fi } function check_for_hang { if cat i915_error_state | grep -v "no error state collected" > /dev/null ; then echo "gpu hang reported" - exit 2 + exit $IGT_EXIT_FAILURE fi } if [ ! -f i915_ring_missed_irq ] ; then echo "kernel doesn't support interrupt masking" - exit 77 + exit $IGT_EXIT_SKIP fi # clear error state first @@ -43,7 +43,7 @@ echo 0xf > i915_ring_test_irq echo "Interrupts masked" if test `cat i915_ring_test_irq` != 0x000f; then echo "Failed to set interrupt mask" - exit 3 + exit $IGT_EXIT_FAILURE fi blt_wait @@ -57,7 +57,7 @@ echo 0 > i915_ring_test_irq echo "Interrupts unmasked" if test `cat i915_ring_test_irq` != 0x; then echo "Fa
[Intel-gfx] [PATCH i-g-t] tests: update .gitignore and add a Makefile rule to create it
Signed-off-by: Thomas Wood --- tests/.gitignore | 13 +++-- tests/Makefile.am | 4 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/.gitignore b/tests/.gitignore index ba1becd..9dfc7f3 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -1,7 +1,6 @@ -# Please keep sorted alphabetically core_auth -core_get_client_auth core_getclient +core_get_client_auth core_getstats core_getversion core_prop_blob @@ -27,6 +26,7 @@ gem_close_race gem_concurrent_all gem_concurrent_blit gem_cpu_reloc +gem_create gem_cs_prefetch gem_cs_tlb gem_ctx_bad_destroy @@ -51,9 +51,9 @@ gem_exec_nop gem_exec_params gem_exec_parse gem_fd_exhaustion +gem_fenced_exec_thrash gem_fence_thrash gem_fence_upload -gem_fenced_exec_thrash gem_flink_basic gem_flink_race gem_gpgpu_fill @@ -94,14 +94,16 @@ gem_render_linear_blits gem_render_tiled_blits gem_request_retire gem_reset_stats +gem_ringfill gem_ring_sync_copy gem_ring_sync_loop -gem_ringfill gem_seqno_wrap gem_set_tiling_vs_blt gem_set_tiling_vs_gtt gem_set_tiling_vs_pwrite +gem_stolen gem_storedw_batches_loop +gem_storedw_loop gem_streaming_writes gem_stress gem_threaded_access_tiled @@ -167,6 +169,5 @@ prime_nv_test prime_self_import prime_udl template -test-list.txt testdisplay -gem_storedw_loop +test-list.txt diff --git a/tests/Makefile.am b/tests/Makefile.am index c4f1f01..c22d7a4 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -32,6 +32,10 @@ dist_pkgdata_DATA = \ $(IMAGES) \ $(NULL) + +.gitignore: Makefile.sources + @echo "$(pkglibexec_PROGRAMS) $(HANG) test-list.txt" | sed 's/\s\+/\n/g' | sort > $@ + pkgdata_DATA = test-list.txt EXTRA_PROGRAMS = $(HANG) -- 1.9.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH i-g-t] tests: add exit value constants for shell script tests
On 3 December 2015 at 12:17, Morton, Derek J wrote: > 1 comment / question inline, otherwise looks ok to me. > > //Derek > >> >> >>-Original Message- >>From: Intel-gfx [mailto:intel-gfx-boun...@lists.freedesktop.org] On Behalf Of >>Thomas Wood >>Sent: Thursday, December 3, 2015 11:31 AM >>To: intel-gfx@lists.freedesktop.org >>Subject: [Intel-gfx] [PATCH i-g-t] tests: add exit value constants for shell >>script tests >> >>Signed-off-by: Thomas Wood >>--- >> tests/check_drm_clients | 2 +- >> tests/debugfs_emon_crash | 2 +- >> tests/drm_lib.sh | 22 ++ >> tests/drv_debugfs_reader | 2 +- >> tests/drv_missed_irq_hang | 14 +++--- >> tests/drv_module_reload_basic | 8 >> tests/kms_sysfs_edid_timing | 4 ++-- >> tests/sysfs_l3_parity | 6 +++--- >> tests/test_rte_check | 2 +- >> tests/tools_test | 2 +- >> 10 files changed, 35 insertions(+), 29 deletions(-) >> >>diff --git a/tests/check_drm_clients b/tests/check_drm_clients index >>eb12416..2a891b8 100755 >>--- a/tests/check_drm_clients >>+++ b/tests/check_drm_clients >>@@ -3,4 +3,4 @@ >> SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )" >> . $SOURCE_DIR/drm_lib.sh >> >>-exit 0 >>+exit $IGT_EXIT_SUCCESS >>diff --git a/tests/debugfs_emon_crash b/tests/debugfs_emon_crash index >>809bfab..1dbfcb2 100755 >>--- a/tests/debugfs_emon_crash >>+++ b/tests/debugfs_emon_crash >>@@ -13,4 +13,4 @@ done >> >> # If we got here, we haven't crashed >> >>-exit 0 >>+exit $IGT_EXIT_SUCCESS >>diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh index c50664c..d2c6420 100755 >>--- a/tests/drm_lib.sh >>+++ b/tests/drm_lib.sh >>@@ -1,20 +1,26 @@ >> #!/bin/sh >> >>+IGT_EXIT_TIMEOUT=78 >>+IGT_EXIT_SKIP=77 >>+IGT_EXIT_SUCCESS=0 >>+IGT_EXIT_INVALID=79 >>+IGT_EXIT_FAILURE=99 >>+ >> # hacked-up long option parsing >> for arg in $@ ; do >> case $arg in >> --list-subtests) >>- exit 79 >>+ exit $IGT_EXIT_INVALID >> ;; >> --run-subtest) >>- exit 79 >>+ exit $IGT_EXIT_INVALID >> ;; >> --debug) >> IGT_LOG_LEVEL=debug >> ;; >> --help-description) >> echo $IGT_TEST_DESCRIPTION >>- exit 0 >>+ exit $IGT_EXIT_SUCCESS >> ;; >> --help) >> echo "Usage: `basename $0` [OPTIONS]" >>@@ -23,18 +29,18 @@ for arg in $@ ; do >> echo " --debug" >> echo " --help-description" >> echo " --help" >>- exit 0 >>+ exit $IGT_EXIT_SUCCESS >> ;; >> esac >> done >> >> die() { >> echo "$@" >>- exit 1 >>+ exit $IGT_EXIT_FAILURE >> } >> >> do_or_die() { >>- $@ > /dev/null 2>&1 || (echo "FAIL: $@ ($?)" && exit -1) >>+ $@ > /dev/null 2>&1 || (echo "FAIL: $@ ($?)" && exit > > Would exit $? Be helpful here to pass the error value on? The value would have a different meaning depending on $@, so I don't think it would be immediately useful to a test runner (it may even conflict with the exit codes defined above). The value of $? is printed out so at least it can be inspected in the logs. > >>+$IGT_EXIT_FAILURE) >> } >> >> if [ -d /debug/dri ] ; then >>@@ -63,7 +69,7 @@ if [ `cat $i915_dfs_path/clients | wc -l` -gt "2" ] ; then >> die "ERROR: other drm clients running" >> fi >> >>-whoami | grep -q root || ( echo ERROR: not running as root; exit 1 ) >>+whoami | grep -q root || ( echo ERROR: not running as root; exit >>+$IGT_EXIT_FAILURE ) >> >> i915_sfs_path= >> if [ -d /sys/class/drm ] ; then >>@@ -76,7 +82,7 @@ fi >> >> function drmtest_skip_on_simulation() >> { >>- [ -n "$INTEL_SIMULATION" ] && exit 77 >>+ [ -n "$INTEL_SIMULATION" ] && exit $IGT_EXIT_SKIP >> } >> >> drmtes
[Intel-gfx] [PATCH i-g-t v2] tests: update .gitignore and add a Makefile rule to create it
v2: generate the .gitignore file with the default target Signed-off-by: Thomas Wood --- tests/.gitignore | 13 +++-- tests/Makefile.am | 4 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/.gitignore b/tests/.gitignore index 6377007..f127bfc 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -1,7 +1,6 @@ -# Please keep sorted alphabetically core_auth -core_get_client_auth core_getclient +core_get_client_auth core_getstats core_getversion core_prop_blob @@ -27,6 +26,7 @@ gem_close_race gem_concurrent_all gem_concurrent_blit gem_cpu_reloc +gem_create gem_cs_prefetch gem_cs_tlb gem_ctx_bad_destroy @@ -51,9 +51,9 @@ gem_exec_nop gem_exec_params gem_exec_parse gem_fd_exhaustion +gem_fenced_exec_thrash gem_fence_thrash gem_fence_upload -gem_fenced_exec_thrash gem_flink_basic gem_flink_race gem_gpgpu_fill @@ -94,14 +94,16 @@ gem_render_linear_blits gem_render_tiled_blits gem_request_retire gem_reset_stats +gem_ringfill gem_ring_sync_copy gem_ring_sync_loop -gem_ringfill gem_seqno_wrap gem_set_tiling_vs_blt gem_set_tiling_vs_gtt gem_set_tiling_vs_pwrite +gem_stolen gem_storedw_batches_loop +gem_storedw_loop gem_streaming_writes gem_stress gem_threaded_access_tiled @@ -167,6 +169,5 @@ prime_nv_test prime_self_import prime_udl template -test-list.txt testdisplay -gem_storedw_loop +test-list.txt diff --git a/tests/Makefile.am b/tests/Makefile.am index c4f1f01..2b25cd3 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -32,6 +32,10 @@ dist_pkgdata_DATA = \ $(IMAGES) \ $(NULL) +all-local: .gitignore +.gitignore: Makefile.sources + @echo "$(pkglibexec_PROGRAMS) $(HANG) test-list.txt" | sed 's/\s\+/\n/g' | sort > $@ + pkgdata_DATA = test-list.txt EXTRA_PROGRAMS = $(HANG) -- 1.9.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH i-g-t 1/2] lib/kms: Turn the based_edid into a template
based_edid should be "base edid"? On 4 December 2015 at 14:08, wrote: > From: Ville Syrjälä > > Signed-off-by: Ville Syrjälä > --- > lib/Makefile.sources| 1 + > lib/igt_edid_template.h | 74 > lib/igt_kms.c | 90 > +++-- > 3 files changed, 95 insertions(+), 70 deletions(-) > create mode 100644 lib/igt_edid_template.h > > diff --git a/lib/Makefile.sources b/lib/Makefile.sources > index cb20f030cbec..4999868052b1 100644 > --- a/lib/Makefile.sources > +++ b/lib/Makefile.sources > @@ -11,6 +11,7 @@ libintel_tools_la_SOURCES = \ > igt_debugfs.h \ > igt_aux.c \ > igt_aux.h \ > + igt_edid_template.h \ Since this new header doesn't have any public API, please add it to IGNORE_HFILES in docs/reference/intel-gpu-tools/Makefile.am > igt_gt.c\ > igt_gt.h\ > igt_stats.c \ > diff --git a/lib/igt_edid_template.h b/lib/igt_edid_template.h > new file mode 100644 > index ..de421e080a88 > --- /dev/null > +++ b/lib/igt_edid_template.h > @@ -0,0 +1,74 @@ > +#define GAMMA(x) (((x) * 100) - 100) > + > +#define MANUFACTURER_ID(a, b, c) (a - '@') << 2 | (b - '@') >> 3, \ > +(b - '@') << 5 | (c - '@') > + > + > +#define ab(x, y) ((x) & 0xff), ((y) & 0xff), (((x) & 0xf00) >> 4) | (((y) & > 0xf00) >> 8) > +#define op(ho, hp, vo, vp) ((ho) & 0xff), ((hp) & 0xff), \ > + (((vo) & 0xf) << 4) | ((vp) & 0xf), \ > + (((ho) & 0x300) >> 2) | (((hp) & 0x300) >> 4) \ > + | (((vo) & 0x30) >> 2) | ((vp) & 0x30 >> 4) > + > +static unsigned char EDID_NAME[EDID_LENGTH] = { > + 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, /* header */ > + MANUFACTURER_ID('I', 'G', 'T'), > + /* product code, serial number, week and year of manufacture */ > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + 0x01, 0x03, /* edid version (1.3) */ > + /* basic display parameters */ > + /* digital display, maximum horizontal image size, maximum vertical > +* image size, gamma, features: RGB 4:4:4, native pixel format and > +* refresh rate in descriptor 1 */ > + 0x80, HSIZE, VSIZE, GAMMA(2.20), 0x02, > + /* chromaticity coordinates */ > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + /* established timings: 640x480 60Hz, 800x600 60Hz, 1024x768 60Hz */ > + 0x21, 0x08, 0x00, > + /* standard timings */ > + 0xd1, 0xc0, /* 1920x1080 60Hz */ > + 0x81, 0xc0, /* 1280x720 60Hz */ > + 0x61, 0x40, /* 1024x768 60Hz */ > + 0x45, 0x40, /* 800x600 60Hz */ > + 0x31, 0x40, /* 640x480 60Hz */ > + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, > + /* descriptor 1 (preferred timing) */ > + (CLOCK / 10) & 0x00ff, ((CLOCK / 10) & 0xff00) >> 8, > + ab(HACTIVE, HBLANK), ab(VACTIVE, VBLANK), > + op(HOFFSET, HPULSE, VOFFSET, VPULSE), > + ab(HSIZE * 10, VSIZE * 10), > + 0x00, 0x00, 0x00, > + /* descriptor 2 (monitor range limits) */ > + 0x00, 0x00, 0x00, 0xfd, 0x00, > + VFREQ - 1, VFREQ + 1, /* minimum, maximum vertical field rate */ > + (CLOCK / (HACTIVE + HBLANK)) - 1, /* minimum horizontal line rate */ > + (CLOCK / (HACTIVE + HBLANK)) + 1, /* maximum horizontal line rate */ > + (CLOCK / 1) + 1, /* maximum pixel clock rate */ > + 0x00, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, > + /* descriptor 3 (name descriptor) */ > + 0x00, 0x00, 0x00, 0xfc, 0x00, 'I', 'G', 'T', 0x0a, > + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, > + /* descriptor 4 */ > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + /* extensions, checksum */ > + 0x00, 0x00 > +}; > + > +#undef EDID_NAME > +#undef VFREQ > +#undef CLOCK > +#undef HACTIVE > +#undef HBLANK > +#undef VACTIVE > +#undef VBLANK > +#undef HOFFSET > +#undef HPULSE > +#undef VOFFSET > +#undef VPULSE > +#undef HSIZE > +#undef VSIZE > +#undef GAMMA > +#undef MANUFACTURER_ID > +#undef ab > +#undef op > diff --git a/lib/igt_kms.c b/lib/igt_kms.c > index fd4f05e81f3d..da49f5676641 100644 > --- a/lib/igt_kms.c > +++ b/lib/igt_kms.c > @@ -53,6 +53,23 @@ > #define MAX_CONNECTORS 32 > static char *forced_connectors[MAX_CONNECTORS + 1]; > > +static void update_edid_csum(unsigned char *edid) > +{ > + int i, sum = 0; > + struct tm *tm; > + time_t t; > + > + /* year of manufacture */ > + t = time(NULL); > + tm = localtime(&t); > + edid[17] = tm->tm_year - 90; > + > + /* calculate checksum */ > + for (i = 0; i < 127; i++) { > + sum = sum + edid[i]; > + } > + edid[127] = 256 - sum; > +} > > #define VFREQ 60 > #define
Re: [Intel-gfx] [PATCH i-g-t v2] tests: update .gitignore and add a Makefile rule to create it
On 10 December 2015 at 09:27, Morton, Derek J wrote: >> >> >>-Original Message- >>From: Intel-gfx [mailto:intel-gfx-boun...@lists.freedesktop.org] On Behalf Of >>Daniel Vetter >>Sent: Thursday, December 10, 2015 9:07 AM >>To: Wood, Thomas >>Cc: intel-gfx@lists.freedesktop.org >>Subject: Re: [Intel-gfx] [PATCH i-g-t v2] tests: update .gitignore and add a >>Makefile rule to create it >> >>On Mon, Dec 07, 2015 at 03:12:15PM +, Thomas Wood wrote: >>> v2: generate the .gitignore file with the default target >>> >>> Signed-off-by: Thomas Wood >> >>Hm, committing files that the build system updates is generally a bad idea. I >>think if we do this, we should remove the .gitignore here. Not sure how that >>will work in general. >> >>But since I screw this up every 2nd time I really like the idea. >>-Daniel > > This does not apply to the android build system so .gitignore would never be > generated during android builds. However the android build system does not > put the test binaries in the same place as the source code so perhaps it does > not matter. I had kept the file in the repository because it wouldn't be generated by the Android build system. However, since it doesn't apply to Android builds, I'll remove .gitignore from the repository and then it will always be created by the automake build system. > > //Derek > >> >>> --- >>> tests/.gitignore | 13 +++-- >>> tests/Makefile.am | 4 >>> 2 files changed, 11 insertions(+), 6 deletions(-) >>> >>> diff --git a/tests/.gitignore b/tests/.gitignore index >>> 6377007..f127bfc 100644 >>> --- a/tests/.gitignore >>> +++ b/tests/.gitignore >>> @@ -1,7 +1,6 @@ >>> -# Please keep sorted alphabetically >>> core_auth >>> -core_get_client_auth >>> core_getclient >>> +core_get_client_auth >>> core_getstats >>> core_getversion >>> core_prop_blob >>> @@ -27,6 +26,7 @@ gem_close_race >>> gem_concurrent_all >>> gem_concurrent_blit >>> gem_cpu_reloc >>> +gem_create >>> gem_cs_prefetch >>> gem_cs_tlb >>> gem_ctx_bad_destroy >>> @@ -51,9 +51,9 @@ gem_exec_nop >>> gem_exec_params >>> gem_exec_parse >>> gem_fd_exhaustion >>> +gem_fenced_exec_thrash >>> gem_fence_thrash >>> gem_fence_upload >>> -gem_fenced_exec_thrash >>> gem_flink_basic >>> gem_flink_race >>> gem_gpgpu_fill >>> @@ -94,14 +94,16 @@ gem_render_linear_blits gem_render_tiled_blits >>> gem_request_retire gem_reset_stats >>> +gem_ringfill >>> gem_ring_sync_copy >>> gem_ring_sync_loop >>> -gem_ringfill >>> gem_seqno_wrap >>> gem_set_tiling_vs_blt >>> gem_set_tiling_vs_gtt >>> gem_set_tiling_vs_pwrite >>> +gem_stolen >>> gem_storedw_batches_loop >>> +gem_storedw_loop >>> gem_streaming_writes >>> gem_stress >>> gem_threaded_access_tiled >>> @@ -167,6 +169,5 @@ prime_nv_test >>> prime_self_import >>> prime_udl >>> template >>> -test-list.txt >>> testdisplay >>> -gem_storedw_loop >>> +test-list.txt >>> diff --git a/tests/Makefile.am b/tests/Makefile.am index >>> c4f1f01..2b25cd3 100644 >>> --- a/tests/Makefile.am >>> +++ b/tests/Makefile.am >>> @@ -32,6 +32,10 @@ dist_pkgdata_DATA = \ >>> $(IMAGES) \ >>> $(NULL) >>> >>> +all-local: .gitignore >>> +.gitignore: Makefile.sources >>> +@echo "$(pkglibexec_PROGRAMS) $(HANG) test-list.txt" | sed >>> +'s/\s\+/\n/g' | sort > $@ >>> + >>> pkgdata_DATA = test-list.txt >>> >>> EXTRA_PROGRAMS = $(HANG) >>> -- >>> 1.9.1 >>> >>> ___ >>> Intel-gfx mailing list >>> Intel-gfx@lists.freedesktop.org >>> http://lists.freedesktop.org/mailman/listinfo/intel-gfx >> >>-- >>Daniel Vetter >>Software Engineer, Intel Corporation >>http://blog.ffwll.ch >>___ >>Intel-gfx mailing list >>Intel-gfx@lists.freedesktop.org >>http://lists.freedesktop.org/mailman/listinfo/intel-gfx >> ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH i-g-t] lib/igt_pm: Lib for power management
On 15 December 2015 at 09:14, David Weinehall wrote: > Move power management related code to a separate library. > Initially this is done only for workarounds that apply to external > components. Modify the users of such workarounds accordingly. > This currently involves HD audio and SATA link power management. > For SATA link PM there's also code to save the previous settings, > to allow for resetting the values after we've finished testing. > > Signed-off-by: David Weinehall > --- > lib/Makefile.sources | 2 + > lib/igt.h| 1 + > lib/igt_aux.c| 15 +--- > lib/igt_pm.c | 233 > +++ > lib/igt_pm.h | 31 +++ > tests/pm_lpsp.c | 25 +- > tests/pm_rpm.c | 29 ++- igt_pm.xml needs including in docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml to make sure the new documentation is included in the output. > 7 files changed, 279 insertions(+), 57 deletions(-) > create mode 100644 lib/igt_pm.c > create mode 100644 lib/igt_pm.h > > diff --git a/lib/Makefile.sources b/lib/Makefile.sources > index 4999868052b1..2f0eb2075e14 100644 > --- a/lib/Makefile.sources > +++ b/lib/Makefile.sources > @@ -60,6 +60,8 @@ libintel_tools_la_SOURCES = \ > igt_core.h \ > igt_draw.c \ > igt_draw.h \ > + igt_pm.c\ > + igt_pm.h\ > $(NULL) > > .PHONY: version.h.tmp > diff --git a/lib/igt.h b/lib/igt.h > index 3be25511bb77..b8792141ee3c 100644 > --- a/lib/igt.h > +++ b/lib/igt.h > @@ -44,5 +44,6 @@ > #include "media_fill.h" > #include "media_spin.h" > #include "rendercopy.h" > +#include "igt_pm.h" It'd be nice to keep the list alphabetical. > > #endif /* IGT_H */ > diff --git a/lib/igt_aux.c b/lib/igt_aux.c > index 4d08d68bb932..cd7f14649fe2 100644 > --- a/lib/igt_aux.c > +++ b/lib/igt_aux.c > @@ -59,6 +59,7 @@ > #include "intel_reg.h" > #include "ioctl_wrappers.h" > #include "igt_kms.h" > +#include "igt_pm.h" > > /** > * SECTION:igt_aux > @@ -531,19 +532,7 @@ bool igt_setup_runtime_pm(void) > if (pm_status_fd >= 0) > return true; > > - /* The Audio driver can get runtime PM references, so we need to make > -* sure its runtime PM is enabled, so it can release the refs and > -* actually enable us to runtime suspend. */ > - fd = open("/sys/module/snd_hda_intel/parameters/power_save", > O_WRONLY); > - if (fd >= 0) { > - igt_assert(write(fd, "1\n", 2) == 2); > - close(fd); > - } > - fd = open("/sys/bus/pci/devices/:00:03.0/power/control", > O_WRONLY); > - if (fd >= 0) { > - igt_assert(write(fd, "auto\n", 5) == 5); > - close(fd); > - } > + igt_pm_enable_audio_runtime_pm(); > > /* Our implementation uses autosuspend. Try to set it to 0ms so the > test > * suite goes faster and we have a higher probability of triggering > race > diff --git a/lib/igt_pm.c b/lib/igt_pm.c > new file mode 100644 > index ..f2e13ba6a44e > --- /dev/null > +++ b/lib/igt_pm.c > @@ -0,0 +1,233 @@ > +/* > + * Copyright © 2013, 2015 Intel Corporation > + * > + * Permission is hereby granted, free of charge, to any person obtaining a > + * copy of this software and associated documentation files (the "Software"), > + * to deal in the Software without restriction, including without limitation > + * the rights to use, copy, modify, merge, publish, distribute, sublicense, > + * and/or sell copies of the Software, and to permit persons to whom the > + * Software is furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice (including the next > + * paragraph) shall be included in all copies or substantial portions of the > + * Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER > DEALINGS > + * IN THE SOFTWARE. > + * > + * Authors: > + *Paulo Zanoni > + *David Weinehall > + * > + */ > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include "drmtest.h" > +#include "igt_pm.h" > + > +enum { > + POLICY_UNKNOWN = -1, > + POLICY_MAX_PERFORMANCE = 0, > + POLICY_MEDIUM_POWER = 1, > + POLICY_MIN_POWER = 2 > +}; > + > +#define MAX_PERFORMANCE_STR"max_performance\n" > +#define MEDIUM_POWER_STR "medium_power\n" > +#define MIN_POWER_STR "min_power\n" > +/* Remember to f
Re: [Intel-gfx] [PATCH i-g-t 6/6] tests/kms_chv_cursor_fail: Add a test to exercise CHV pipe C cursor fail
On 18 December 2015 at 17:25, wrote: > From: Ville Syrjälä > > The test tries to anger CHV pipe C cursor by walking the edges of the > screen while moving the cursor across the screen edge. > > The actual hw issue only occurs on pipe C, and only on the left screen > edge. The testcase can walk all the edges though, and on all pipes, just > so I could make sure the failure doesn't occur there. > > Signed-off-by: Ville Syrjälä > --- > tests/Makefile.sources | 1 + > tests/kms_chv_cursor_fail.c | 425 > > 2 files changed, 426 insertions(+) > create mode 100644 tests/kms_chv_cursor_fail.c > > diff --git a/tests/Makefile.sources b/tests/Makefile.sources > index d5940388c483..104ed2be83ed 100644 > --- a/tests/Makefile.sources > +++ b/tests/Makefile.sources > @@ -68,6 +68,7 @@ TESTS_progs_M = \ > gem_write_read_ring_switch \ > kms_addfb_basic \ > kms_atomic \ > + kms_chv_cursor_fail \ > kms_cursor_crc \ > kms_draw_crc \ > kms_fbc_crc \ > diff --git a/tests/kms_chv_cursor_fail.c b/tests/kms_chv_cursor_fail.c > new file mode 100644 > index ..2ccdd4106597 > --- /dev/null > +++ b/tests/kms_chv_cursor_fail.c > @@ -0,0 +1,425 @@ > +/* > + * Copyright © 2015 Intel Corporation > + * > + * Permission is hereby granted, free of charge, to any person obtaining a > + * copy of this software and associated documentation files (the "Software"), > + * to deal in the Software without restriction, including without limitation > + * the rights to use, copy, modify, merge, publish, distribute, sublicense, > + * and/or sell copies of the Software, and to permit persons to whom the > + * Software is furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice (including the next > + * paragraph) shall be included in all copies or substantial portions of the > + * Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER > DEALINGS > + * IN THE SOFTWARE. > + * > + */ > + > +#include "igt.h" > +#include > +#include > +#include > +#include > +#include > + > +IGT_TEST_DESCRIPTION("Exercise CHV pipe C cursor fail"); > + > +#ifndef DRM_CAP_CURSOR_WIDTH > +#define DRM_CAP_CURSOR_WIDTH 0x8 > +#endif > +#ifndef DRM_CAP_CURSOR_HEIGHT > +#define DRM_CAP_CURSOR_HEIGHT 0x9 > +#endif > + > +typedef struct { > + int drm_fd; > + igt_display_t display; > + struct igt_fb primary_fb; > + struct igt_fb fb; > + igt_output_t *output; > + enum pipe pipe; > + igt_crc_t ref_crc; > + int curw, curh; /* cursor size */ > + igt_pipe_crc_t *pipe_crc; > + uint32_t devid; > + bool colored, jump, disable; > + int jump_x, jump_y; > +} data_t; > + > +enum { > + EDGE_LEFT = 0x1, > + EDGE_RIGHT = 0x2, > + EDGE_TOP = 0x4, > + EDGE_BOTTOM = 0x8, > +}; > + > +static void cursor_disable(data_t *data) > +{ > + igt_output_t *output = data->output; > + igt_plane_t *cursor; > + > + cursor = igt_output_get_plane(output, IGT_PLANE_CURSOR); > + igt_plane_set_fb(cursor, NULL); > +} > + > +static void create_cursor_fb(data_t *data, int cur_w, int cur_h) > +{ > + cairo_t *cr; > + uint32_t fb_id; > + > + fb_id = igt_create_fb(data->drm_fd, cur_w, cur_h, > + DRM_FORMAT_ARGB, > + LOCAL_DRM_FORMAT_MOD_NONE, > + &data->fb); > + igt_assert(fb_id); > + > + cr = igt_get_cairo_ctx(data->drm_fd, &data->fb); > + if (data->colored) > + igt_paint_color_alpha(cr, 0, 0, data->fb.width, > data->fb.height, > + 1.0, 0.0, 0.0, 1.0); > + else > + igt_paint_color_alpha(cr, 0, 0, data->fb.width, > data->fb.height, > + 0.0, 0.0, 0.0, 0.0); > + igt_assert(cairo_status(cr) == 0); > + cairo_destroy(cr); > +} > + > +static void cursor_move(data_t *data, int x, int y, int i) > +{ > + int crtc_id = data->output->config.crtc->crtc_id; > + > + igt_debug("[%d] x=%d, y=%d\n", i, x, y); > + > + /* > +* The "fixed" kernel will refuse the ioctl when pipe C cursor > +* would straddle the left screen edge (which is when the hw > +* fails). So let's accept a failure from the ioctl in that case. > +*/ > + igt_assert(drmModeMoveCursor(data->drm_fd, crtc_id, x, y) == 0 || > + (IS_CHERR
Re: [Intel-gfx] [PATCH i-g-t 2/6] lib: Extract ssme common fb create+fill methods into helpers
On 18 December 2015 at 17:25, wrote: > From: Ville Syrjälä > > Several tests do one or more of the followin: > * igt_create_fb() + igt_paint_test_pattern() > * igt_create_color_fb() + igt_paint_test_pattern() > * igt_create_fb() + igt_paint_image() > > Extract them into new helpes: igt_create_pattern_fb(), > igt_create_color_pattern_fb(), igt_create_image_fb(). Couple of typos above: "ssme", "followin", "helpes" > > Signed-off-by: Ville Syrjälä > --- > lib/igt_fb.c | 124 > ++ > lib/igt_fb.h | 11 > tests/kms_atomic.c| 30 --- > tests/kms_flip_tiling.c | 25 +++--- > tests/kms_panel_fitting.c | 42 > tests/kms_plane_scaling.c | 60 ++ > tests/kms_pwrite_crc.c| 9 +--- > tests/kms_setmode.c | 11 ++-- > tests/pm_lpsp.c | 11 +--- > tests/pm_rpm.c| 10 ++-- > tests/testdisplay.c | 8 ++- > 11 files changed, 188 insertions(+), 153 deletions(-) > > diff --git a/lib/igt_fb.c b/lib/igt_fb.c > index 3ea9915c42c4..b3c7840a22ae 100644 > --- a/lib/igt_fb.c > +++ b/lib/igt_fb.c > @@ -537,6 +537,130 @@ unsigned int igt_create_color_fb(int fd, int width, int > height, > return fb_id; > } > > +/** > + * igt_create_pattern_fb: > + * @fd: open i915 drm file descriptor > + * @width: width of the framebuffer in pixel > + * @height: height of the framebuffer in pixel > + * @format: drm fourcc pixel format code > + * @tiling: tiling layout of the framebuffer > + * @fb: pointer to an #igt_fb structure > + * > + * This function allocates a gem buffer object suitable to back a framebuffer > + * with the requested properties and then wraps it up in a drm framebuffer > + * object. All metadata is stored in @fb. > + * > + * Compared to igt_create_fb() this function also fills the entire > framebuffer > + * with the test pattern. > + * > + * Returns: > + * The kms id of the created framebuffer on success or a negative error code > on > + * failure. > + */ > +unsigned int igt_create_pattern_fb(int fd, int width, int height, > + uint32_t format, uint64_t tiling, > + struct igt_fb *fb /* out */) > +{ > + unsigned int fb_id; > + cairo_t *cr; > + > + fb_id = igt_create_fb(fd, width, height, format, tiling, fb); > + igt_assert(fb_id); > + > + cr = igt_get_cairo_ctx(fd, fb); > + igt_paint_test_pattern(cr, width, height); > + igt_assert(cairo_status(cr) == 0); > + cairo_destroy(cr); > + > + return fb_id; > +} > + > +/** > + * igt_create_pattern_fb: This should be igt_create_color_pattern_fb. > + * @fd: open i915 drm file descriptor > + * @width: width of the framebuffer in pixel > + * @height: height of the framebuffer in pixel > + * @format: drm fourcc pixel format code > + * @tiling: tiling layout of the framebuffer > + * @r: red value to use as fill color > + * @g: gree value to use as fill color Typo of "green" here. > + * @b: blue value to use as fill color > + * @fb: pointer to an #igt_fb structure > + * > + * This function allocates a gem buffer object suitable to back a framebuffer > + * with the requested properties and then wraps it up in a drm framebuffer > + * object. All metadata is stored in @fb. > + * > + * Compared to igt_create_fb() this function also fills the entire > framebuffer > + * with the test pattern. > + * > + * Returns: > + * The kms id of the created framebuffer on success or a negative error code > on > + * failure. > + */ > +unsigned int igt_create_color_pattern_fb(int fd, int width, int height, > +uint32_t format, uint64_t tiling, > +double r, double g, double b, > +struct igt_fb *fb /* out */) > +{ > + unsigned int fb_id; > + cairo_t *cr; > + > + fb_id = igt_create_fb(fd, width, height, format, tiling, fb); > + igt_assert(fb_id); > + > + cr = igt_get_cairo_ctx(fd, fb); > + igt_paint_color(cr, 0, 0, width, height, r, g, b); > + igt_paint_test_pattern(cr, width, height); > + igt_assert(cairo_status(cr) == 0); > + cairo_destroy(cr); > + > + return fb_id; > +} > + > +/** > + * igt_create_image_fb: > + * @drm_fd: open i915 drm file descriptor > + * @width: width of the framebuffer in pixel or 0 > + * @height: height of the framebuffer in pixel or 0 > + * @format: drm fourcc pixel format code > + * @tiling: tiling layout of the framebuffer > + * @filename: filename of the png image to draw @fb missing here. > + * > + * Create a framebuffer with the specified image. If @width is zero the > + * image width will be used. If @height is zero the image height will be > used. > + * > + * Returns: > + * The kms id of the created framebuffer on success or a negative error code > on > + * failure. > + */ > +unsigned
Re: [Intel-gfx] [PATCH i-g-t] core_prop_blob ioctl_wrappers: Fix new tests/benchmarks for android
On 13 October 2015 at 16:35, Daniel Vetter wrote: > On Tue, Oct 13, 2015 at 04:16:18PM +0100, Derek Morton wrote: >> Changes since #1b492e311 have broken the Android build. This patch >> fixes the build for Android. >> >> core_prop_blob was using ioctls not in the android kernel. Added a >> igt_require_propblob() function and local defines/structures so the >> test will compile and skip on kernels where the feature is unsupported. >> >> gem_blt - included igt.h >> >> Signed-off-by: Derek Morton >> --- >> benchmarks/gem_blt.c | 4 +--- >> lib/ioctl_wrappers.c | 13 + >> lib/ioctl_wrappers.h | 22 ++ >> tests/core_prop_blob.c | 37 ++--- >> 4 files changed, 54 insertions(+), 22 deletions(-) >> >> diff --git a/benchmarks/gem_blt.c b/benchmarks/gem_blt.c >> index 181a5f1..8ab5302 100644 >> --- a/benchmarks/gem_blt.c >> +++ b/benchmarks/gem_blt.c The gem_blt changes are unrelated to the rest of the patch, so need to be applied separately. >> @@ -25,6 +25,7 @@ >> * >> */ >> >> +#include "igt.h" >> #include >> #include >> #include >> @@ -39,9 +40,6 @@ >> #include >> >> #include "drm.h" >> -#include "ioctl_wrappers.h" >> -#include "drmtest.h" >> -#include "intel_chipset.h" >> >> #define LOCAL_I915_EXEC_NO_RELOC (1<<11) >> #define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) >> diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c >> index 80e1ec6..cf34f25 100644 >> --- a/lib/ioctl_wrappers.c >> +++ b/lib/ioctl_wrappers.c >> @@ -1219,6 +1219,19 @@ void igt_require_fb_modifiers(int fd) >> igt_require(has_modifiers); >> } >> >> +void igt_require_propblob(int fd) >> +{ >> + struct local_drm_mode_create_blob c; >> + struct local_drm_mode_destroy_blob d; >> + uint32_t blob_data; >> + c.data = &blob_data; >> + c.length = sizeof(blob_data); >> + >> + igt_require(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_CREATEPROPBLOB, &c) == >> 0); >> + d.blob_id = c.blob_id; >> + igt_require(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_DESTROYPROPBLOB, &d) == >> 0); >> +} > > If you want to do this in the library the usual way is to wrap the ioctls > as functions and put the relevant -ENOTTY check in there as an > igt_require, followed by an igt_assert for anything else that might have > gone wrong. > > I'd just keep this in the test as a static function though, since then you > don't have to write api docs ;-) It's also unlikely to be used elsewhere at the moment, so a local define and static function in the test is fine. > -Daniel > >> + >> int __kms_addfb(int fd, uint32_t handle, uint32_t width, uint32_t height, >> uint32_t stride, uint32_t pixel_format, uint64_t modifier, >> uint32_t flags, uint32_t *buf_id) >> diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h >> index f4deca6..aeb224c 100644 >> --- a/lib/ioctl_wrappers.h >> +++ b/lib/ioctl_wrappers.h >> @@ -149,6 +149,20 @@ struct local_drm_mode_fb_cmd2 { >> uint64_t modifier[4]; >> }; >> >> +struct local_drm_mode_get_blob { >> + uint32_t blob_id; >> + uint32_t length; >> + uint64_t data; >> +}; >> +struct local_drm_mode_create_blob { >> + uint64_t data; >> + uint32_t length; >> + uint32_t blob_id; >> +}; >> +struct local_drm_mode_destroy_blob { >> + uint32_t blob_id; >> +}; >> + >> #define LOCAL_DRM_MODE_FB_MODIFIERS (1<<1) >> >> #define LOCAL_DRM_FORMAT_MOD_VENDOR_INTEL0x01 >> @@ -165,9 +179,17 @@ struct local_drm_mode_fb_cmd2 { >> #define LOCAL_DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, \ >>struct local_drm_mode_fb_cmd2) >> >> +#define LOCAL_DRM_IOCTL_MODE_GETPROPBLOB DRM_IOWR(0xAC, \ >> + struct local_drm_mode_get_blob) >> +#define LOCAL_DRM_IOCTL_MODE_CREATEPROPBLOB DRM_IOWR(0xBD, \ >> + struct >> local_drm_mode_create_blob) >> +#define LOCAL_DRM_IOCTL_MODE_DESTROYPROPBLOB DRM_IOWR(0xBE, \ >> + struct >> local_drm_mode_destroy_blob) >> + >> #define LOCAL_DRM_CAP_ADDFB2_MODIFIERS 0x10 >> >> void igt_require_fb_modifiers(int fd); >> +void igt_require_propblob(int fd); >> >> /** >> * __kms_addfb: >> diff --git a/tests/core_prop_blob.c b/tests/core_prop_blob.c >> index d704158..ff56482 100644 >> --- a/tests/core_prop_blob.c >> +++ b/tests/core_prop_blob.c >> @@ -25,16 +25,12 @@ >> * Daniel Stone >> */ >> >> +#include "igt.h" >> #include >> #include >> #include >> #include >> >> -#include "drmtest.h" >> -#include "igt_debugfs.h" >> -#include "igt_kms.h" >> -#include "igt_aux.h" >> - >> IGT_TEST_DESCRIPTION("Tests behaviour of mass-data 'blob' properties."); >> >> static const struct drm_mode_modeinfo test_mode_valid = { >> @@ -64,19 +60,19 @@ static const struct drm_mode_modeinfo test_mode_valid = { >> static int >> validate_prop(int fd, uint32_t prop_id) >> { >> - struct drm_mode_ge
Re: [Intel-gfx] [PATCH i-g-t v2] tests/core_prop_blob: Fix core_prop_blob for android
On 14 October 2015 at 17:23, Derek Morton wrote: > core_prop_blob was using ioctls not in the android kernel. Added a > igt_require_propblob() function and local defines/structures so the > test will compile and skip on kernels where the feature is unsupported. > > v2: moved igt_require_propblob() to core_prop_blob.c (Daniel Vetter) > Moved gem_blt.c to a seperate patch (Thomas Wood) > > Signed-off-by: Derek Morton > --- > tests/core_prop_blob.c | 71 > -- > 1 file changed, 52 insertions(+), 19 deletions(-) > > diff --git a/tests/core_prop_blob.c b/tests/core_prop_blob.c > index d704158..4dc6d7d 100644 > --- a/tests/core_prop_blob.c > +++ b/tests/core_prop_blob.c > @@ -25,18 +25,35 @@ > * Daniel Stone > */ > > +#include "igt.h" > #include > #include > #include > #include > > -#include "drmtest.h" > -#include "igt_debugfs.h" > -#include "igt_kms.h" > -#include "igt_aux.h" > - > IGT_TEST_DESCRIPTION("Tests behaviour of mass-data 'blob' properties."); > > +struct local_drm_mode_get_blob { > + uint32_t blob_id; > + uint32_t length; > + uint64_t data; > +}; > +struct local_drm_mode_create_blob { > + uint64_t data; > + uint32_t length; > + uint32_t blob_id; > +}; > +struct local_drm_mode_destroy_blob { > + uint32_t blob_id; > +}; > + > +#define LOCAL_DRM_IOCTL_MODE_GETPROPBLOB DRM_IOWR(0xAC, \ > + struct > local_drm_mode_get_blob) > +#define LOCAL_DRM_IOCTL_MODE_CREATEPROPBLOBDRM_IOWR(0xBD, \ > + struct > local_drm_mode_create_blob) > +#define LOCAL_DRM_IOCTL_MODE_DESTROYPROPBLOB DRM_IOWR(0xBE, \ > + struct > local_drm_mode_destroy_blob) > + > static const struct drm_mode_modeinfo test_mode_valid = { > .clock = 1234, > .hdisplay = 640, > @@ -61,22 +78,35 @@ static const struct drm_mode_modeinfo test_mode_valid = { > return errno; \ > } > > +static void igt_require_propblob(int fd) > +{ > + struct local_drm_mode_create_blob c; > + struct local_drm_mode_destroy_blob d; > + uint32_t blob_data; > + c.data = &blob_data; Thanks for the patch. I fixed the compiler warning here (integer from pointer) and pushed along with the gem_blt.c patch. > + c.length = sizeof(blob_data); > + > + igt_require(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_CREATEPROPBLOB, &c) == > 0); > + d.blob_id = c.blob_id; > + igt_require(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_DESTROYPROPBLOB, &d) == > 0); > +} > + > static int > validate_prop(int fd, uint32_t prop_id) > { > - struct drm_mode_get_blob get; > + struct local_drm_mode_get_blob get; > struct drm_mode_modeinfo ret_mode; > > get.blob_id = prop_id; > get.length = 0; > get.data = (uintptr_t) 0; > - ioctl_or_ret_errno(fd, DRM_IOCTL_MODE_GETPROPBLOB, &get); > + ioctl_or_ret_errno(fd, LOCAL_DRM_IOCTL_MODE_GETPROPBLOB, &get); > > if (get.length != sizeof(test_mode_valid)) > return ENOMEM; > > get.data = (uintptr_t) &ret_mode; > - ioctl_or_ret_errno(fd, DRM_IOCTL_MODE_GETPROPBLOB, &get); > + ioctl_or_ret_errno(fd, LOCAL_DRM_IOCTL_MODE_GETPROPBLOB, &get); > > if (memcmp(&ret_mode, &test_mode_valid, sizeof(test_mode_valid)) != 0) > return EINVAL; > @@ -87,12 +117,12 @@ validate_prop(int fd, uint32_t prop_id) > static uint32_t > create_prop(int fd) > { > - struct drm_mode_create_blob create; > + struct local_drm_mode_create_blob create; > > create.length = sizeof(test_mode_valid); > create.data = (uintptr_t) &test_mode_valid; > > - do_ioctl(fd, DRM_IOCTL_MODE_CREATEPROPBLOB, &create); > + do_ioctl(fd, LOCAL_DRM_IOCTL_MODE_CREATEPROPBLOB, &create); > igt_assert_neq_u32(create.blob_id, 0); > > return create.blob_id; > @@ -101,10 +131,10 @@ create_prop(int fd) > static int > destroy_prop(int fd, uint32_t prop_id) > { > - struct drm_mode_destroy_blob destroy; > + struct local_drm_mode_destroy_blob destroy; > > destroy.blob_id = prop_id; > - ioctl_or_ret_errno(fd, DRM_IOCTL_MODE_DESTROYPROPBLOB, &destroy); > + ioctl_or_ret_errno(fd, LOCAL_DRM_IOCTL_MODE_DESTROYPROPBLOB, > &destroy); > > return 0; > } > @@ -112,8
Re: [Intel-gfx] [PATCH i-g-t] tests: Add gem_exec_nop_concurrent test
On 15 October 2015 at 09:05, Derek Morton wrote: > This test is based on gem_exec_nop but submits nop batch buffers concurrently > from different threads to check for ring hangs and other issues during > concurrent submissions. Is there any reason not to include this as extra subtests in gem_exec_nop so that related tests are grouped together? > > Signed-off-by: Derek Morton > --- > tests/.gitignore| 1 + > tests/Makefile.sources | 1 + > tests/gem_exec_nop_concurrent.c | 172 > > 3 files changed, 174 insertions(+) > create mode 100644 tests/gem_exec_nop_concurrent.c > > diff --git a/tests/.gitignore b/tests/.gitignore > index dc8bb53..0ad36f3 100644 > --- a/tests/.gitignore > +++ b/tests/.gitignore > @@ -46,6 +46,7 @@ gem_exec_blt > gem_exec_faulting_reloc > gem_exec_lut_handle > gem_exec_nop > +gem_exec_nop_concurrent > gem_exec_params > gem_exec_parse > gem_fd_exhaustion > diff --git a/tests/Makefile.sources b/tests/Makefile.sources > index 2e2e088..aece831 100644 > --- a/tests/Makefile.sources > +++ b/tests/Makefile.sources > @@ -27,6 +27,7 @@ TESTS_progs_M = \ > gem_exec_bad_domains \ > gem_exec_faulting_reloc \ > gem_exec_nop \ > + gem_exec_nop_concurrent \ > gem_exec_params \ > gem_exec_parse \ > gem_fenced_exec_thrash \ > diff --git a/tests/gem_exec_nop_concurrent.c b/tests/gem_exec_nop_concurrent.c > new file mode 100644 > index 000..578f651 > --- /dev/null > +++ b/tests/gem_exec_nop_concurrent.c > @@ -0,0 +1,172 @@ > +/* > + * Copyright © 2015 Intel Corporation > + * > + * Permission is hereby granted, free of charge, to any person obtaining a > + * copy of this software and associated documentation files (the "Software"), > + * to deal in the Software without restriction, including without limitation > + * the rights to use, copy, modify, merge, publish, distribute, sublicense, > + * and/or sell copies of the Software, and to permit persons to whom the > + * Software is furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice (including the next > + * paragraph) shall be included in all copies or substantial portions of the > + * Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER > DEALINGS > + * IN THE SOFTWARE. > + * > + * Authors: > + *Derek Morton > + * > + * This test is based on gem_exec_nop but submits nop batch buffers > concurrently > + * from different threads to check for ring hangs and other issues during > + * concurrent submissions. > + * > + */ > + > +#include "igt.h" > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include "drm.h" > + > +#define LOCAL_I915_EXEC_NO_RELOC (1<<11) > +#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) > + > +#define LOCAL_I915_EXEC_VEBOX (4<<0) > + > +IGT_TEST_DESCRIPTION( > +"This Test will submit nop batch buffers concurrently to the same ring " > + "and different rings in an attempt to trigger ring hangs."); > + > +const uint32_t batch[2] = {MI_BATCH_BUFFER_END}; > + > +struct ring > +{ > + unsigned ring_id; > + const char *ring_name; > + bool direction; > +}; > + > +static void loop(int fd, uint32_t handle, int child_nbr, struct ring* ring, > bool up) > +{ > + struct drm_i915_gem_execbuffer2 execbuf; > + struct drm_i915_gem_exec_object2 gem_exec[1]; > + int count; > + int max_count = SLOW_QUICK(15, 4); > + > + gem_require_ring(fd, ring->ring_id); > + > + memset(&gem_exec, 0, sizeof(gem_exec)); > + gem_exec[0].handle = handle; > + > + memset(&execbuf, 0, sizeof(execbuf)); > + execbuf.buffers_ptr = (uintptr_t)gem_exec; > + execbuf.buffer_count = 1; > + execbuf.flags = ring->ring_id; > + execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; > + execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; > + if (drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf)) { > + execbuf.flags = ring->ring_id; > + do_ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); > + } > + gem_sync(fd, handle); > + > + for (count = 0; count <= max_count; count++) { > + const int reps = 7; > + int n, nbr_loops; > + > + if (up) > + nbr_loops = 1 << count; > + else > + nbr_loops = 1 << (max_count - count
Re: [Intel-gfx] [PATCH i-g-t 1/3] Rename gem_concurren_all over gem_concurrent_blit
gem_concurrent_all is misspelled in the subject. On 23 October 2015 at 12:42, David Weinehall wrote: > We'll both rename gem_concurrent_all over gem_concurrent_blit > and change gem_concurrent_blit in this changeset. To make > this easier to follow we first do the the rename. Please add a Signed-off-by line to your patches as intel-gpu-tools requires contributions to follow the developer's certificate of origin (http://developercertificate.org/). > --- > tests/gem_concurrent_blit.c | 1116 > ++- > 1 file changed, 1108 insertions(+), 8 deletions(-) This appears only to be adding gem_concurrent_blit, not renaming gem_concurrent_all. Also, the relevant changes to .gitignore are missing from this patch and the third patch in this series. > > diff --git a/tests/gem_concurrent_blit.c b/tests/gem_concurrent_blit.c > index 513de4a1b719..1d2d787202df 100644 > --- a/tests/gem_concurrent_blit.c > +++ b/tests/gem_concurrent_blit.c > @@ -1,8 +1,1108 @@ > -/* This test is just a duplicate of gem_concurrent_all. */ > -/* However the executeable will be gem_concurrent_blit. */ > -/* The main function examines argv[0] and, in the case */ > -/* of gem_concurent_blit runs only a subset of the */ > -/* available subtests. This avoids the use of */ > -/* non-standard command line parameters which can cause */ > -/* problems for automated testing */ > -#include "gem_concurrent_all.c" > +/* > + * Copyright © 2009,2012,2013 Intel Corporation > + * > + * Permission is hereby granted, free of charge, to any person obtaining a > + * copy of this software and associated documentation files (the "Software"), > + * to deal in the Software without restriction, including without limitation > + * the rights to use, copy, modify, merge, publish, distribute, sublicense, > + * and/or sell copies of the Software, and to permit persons to whom the > + * Software is furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice (including the next > + * paragraph) shall be included in all copies or substantial portions of the > + * Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER > DEALINGS > + * IN THE SOFTWARE. > + * > + * Authors: > + *Eric Anholt > + *Chris Wilson > + *Daniel Vetter > + * > + */ > + > +/** @file gem_concurrent.c > + * > + * This is a test of pread/pwrite/mmap behavior when writing to active > + * buffers. > + * > + * Based on gem_gtt_concurrent_blt. > + */ > + > +#include "igt.h" > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > + > +#include "intel_bufmgr.h" > + > +IGT_TEST_DESCRIPTION("Test of pread/pwrite/mmap behavior when writing to > active" > +" buffers."); > + > +int fd, devid, gen; > +struct intel_batchbuffer *batch; > +int all; > + > +static void > +nop_release_bo(drm_intel_bo *bo) > +{ > + drm_intel_bo_unreference(bo); > +} > + > +static void > +prw_set_bo(drm_intel_bo *bo, uint32_t val, int width, int height) > +{ > + int size = width * height, i; > + uint32_t *tmp; > + > + tmp = malloc(4*size); > + if (tmp) { > + for (i = 0; i < size; i++) > + tmp[i] = val; > + drm_intel_bo_subdata(bo, 0, 4*size, tmp); > + free(tmp); > + } else { > + for (i = 0; i < size; i++) > + drm_intel_bo_subdata(bo, 4*i, 4, &val); > + } > +} > + > +static void > +prw_cmp_bo(drm_intel_bo *bo, uint32_t val, int width, int height, > drm_intel_bo *tmp) > +{ > + int size = width * height, i; > + uint32_t *vaddr; > + > + do_or_die(drm_intel_bo_map(tmp, true)); > + do_or_die(drm_intel_bo_get_subdata(bo, 0, 4*size, tmp->virtual)); > + vaddr = tmp->virtual; > + for (i = 0; i < size; i++) > + igt_assert_eq_u32(vaddr[i], val); > + drm_intel_bo_unmap(tmp); > +} > + > +static drm_intel_bo * > +unmapped_create_bo(drm_intel_bufmgr *bufmgr, int width, int height) > +{ > + drm_intel_bo *bo; > + > + bo = drm_intel_bo_alloc(bufmgr, "bo", 4*width*height, 0); > + igt_assert(bo); > + > + return bo; > +} > + > +static drm_intel_bo * > +snoop_create_bo(drm_intel_bufmgr *bufmgr, int width, int height) > +{ > + drm_intel_bo *bo; > + > + igt_skip_on(gem_has_llc(fd)); > + > + bo = unmapped_create_bo(bufmgr, width, height); > + gem_set_caching(fd, bo
Re: [Intel-gfx] [PATCH i-g-t 2/3] Unify handling of slow/combinatorial tests
On 23 October 2015 at 12:42, David Weinehall wrote: > Some tests should not be run by default, due to their slow, > and sometimes superfluous, nature. > > We still want to be able to run these tests though in some cases. > Until now there's been no unified way of handling this. Remedy > this by introducing the --with-slow-combinatorial option to > igt_core, and use it in gem_concurrent_blit & kms_frontbuffer_tracking. > --- > lib/igt_core.c | 19 ++ > lib/igt_core.h | 1 + > tests/gem_concurrent_blit.c | 40 > tests/kms_frontbuffer_tracking.c | 135 > +++ > 4 files changed, 142 insertions(+), 53 deletions(-) > > diff --git a/lib/igt_core.c b/lib/igt_core.c > index 59127cafe606..ba40ce0e0ead 100644 > --- a/lib/igt_core.c > +++ b/lib/igt_core.c > @@ -216,6 +216,7 @@ const char *igt_interactive_debug; > > /* subtests helpers */ > static bool list_subtests = false; > +static bool with_slow_combinatorial = false; > static char *run_single_subtest = NULL; > static bool run_single_subtest_found = false; > static const char *in_subtest = NULL; > @@ -235,6 +236,7 @@ bool test_child; > > enum { > OPT_LIST_SUBTESTS, > + OPT_WITH_SLOW_COMBINATORIAL, > OPT_RUN_SUBTEST, > OPT_DESCRIPTION, > OPT_DEBUG, > @@ -478,6 +480,7 @@ static void print_usage(const char *help_str, bool > output_on_stderr) > > fprintf(f, "Usage: %s [OPTIONS]\n", command_str); > fprintf(f, " --list-subtests\n" > + " --with-slow-combinatorial\n" >" --run-subtest \n" >" --debug[=log-domain]\n" >" --interactive-debug[=domain]\n" > @@ -510,6 +513,7 @@ static int common_init(int *argc, char **argv, > int c, option_index = 0, i, x; > static struct option long_options[] = { > {"list-subtests", 0, 0, OPT_LIST_SUBTESTS}, > + {"with-slow-combinatorial", 0, 0, > OPT_WITH_SLOW_COMBINATORIAL}, > {"run-subtest", 1, 0, OPT_RUN_SUBTEST}, > {"help-description", 0, 0, OPT_DESCRIPTION}, > {"debug", optional_argument, 0, OPT_DEBUG}, > @@ -617,6 +621,10 @@ static int common_init(int *argc, char **argv, > if (!run_single_subtest) > list_subtests = true; > break; > + case OPT_WITH_SLOW_COMBINATORIAL: > + if (!run_single_subtest) This will cause piglit (and therefore QA) to unconditionally run all tests marked as slow, since it runs subtests individually. > + with_slow_combinatorial = true; > + break; > case OPT_RUN_SUBTEST: > if (!list_subtests) > run_single_subtest = strdup(optarg); > @@ -1629,6 +1637,17 @@ void igt_skip_on_simulation(void) > igt_require(!igt_run_in_simulation()); > } > > +/** > + * igt_slow_combinatorial: > + * > + * This is used to define subtests that should only be listed/run > + * when the "--with-slow-combinatorial" has been specified This isn't quite correct, as the subtests that use igt_slow_combinatorial will still always be listed. > + */ > +void igt_slow_combinatorial(void) > +{ > + igt_skip_on(!with_slow_combinatorial); Although it is convenient to just skip the tests when the --with-slow-combinatorial flag is passed, it may be useful to be able to classify the subtests before they are run, so that they are filtered out from the test list entirely. An approach that can do this might also be used to mark tests as being part of the basic acceptance tests, so that they can be marked as such without relying on the naming convention. > +} > + > /* structured logging */ > > /** > diff --git a/lib/igt_core.h b/lib/igt_core.h > index 5ae09653fd55..6ddf25563275 100644 > --- a/lib/igt_core.h > +++ b/lib/igt_core.h > @@ -680,6 +680,7 @@ bool igt_run_in_simulation(void); > #define SLOW_QUICK(slow,quick) (igt_run_in_simulation() ? (quick) : (slow)) > > void igt_skip_on_simulation(void); > +void igt_slow_combinatorial(void); > > extern const char *igt_interactive_debug; > > diff --git a/tests/gem_concurrent_blit.c b/tests/gem_concurrent_blit.c > index 1d2d787202df..311b6829e984 100644 > --- a/tests/gem_concurrent_blit.c > +++ b/tests/gem_concurrent_blit.c > @@ -931,9 +931,6 @@ run_basic_modes(const struct access_mode *mode, > struct buffers buffers; > > for (h = hangs; h->suffix; h++) { > - if (!all && *h->suffix) > - continue; > - > for (p = all ? pipelines : pskip; p->prefix; p++) { > igt_fixture { > batch = buffers_init(&buffers, mode, fd); > @@ -941,6 +938,8 @@ run_basic_modes(const struct access_mode *mode, > > /* try to overwrite the
Re: [Intel-gfx] [PATCH i-g-t 2/3] Unify handling of slow/combinatorial tests
On 26 October 2015 at 15:28, David Weinehall wrote: > On Fri, Oct 23, 2015 at 03:55:23PM +0100, Thomas Wood wrote: >> On 23 October 2015 at 12:42, David Weinehall >> wrote: >> > Some tests should not be run by default, due to their slow, >> > and sometimes superfluous, nature. >> > >> > We still want to be able to run these tests though in some cases. >> > Until now there's been no unified way of handling this. Remedy >> > this by introducing the --with-slow-combinatorial option to >> > igt_core, and use it in gem_concurrent_blit & kms_frontbuffer_tracking. >> > --- >> > lib/igt_core.c | 19 ++ >> > lib/igt_core.h | 1 + >> > tests/gem_concurrent_blit.c | 40 >> > tests/kms_frontbuffer_tracking.c | 135 >> > +++ >> > 4 files changed, 142 insertions(+), 53 deletions(-) >> > >> > diff --git a/lib/igt_core.c b/lib/igt_core.c >> > index 59127cafe606..ba40ce0e0ead 100644 >> > --- a/lib/igt_core.c >> > +++ b/lib/igt_core.c >> > @@ -216,6 +216,7 @@ const char *igt_interactive_debug; >> > >> > /* subtests helpers */ >> > static bool list_subtests = false; >> > +static bool with_slow_combinatorial = false; >> > static char *run_single_subtest = NULL; >> > static bool run_single_subtest_found = false; >> > static const char *in_subtest = NULL; >> > @@ -235,6 +236,7 @@ bool test_child; >> > >> > enum { >> > OPT_LIST_SUBTESTS, >> > + OPT_WITH_SLOW_COMBINATORIAL, >> > OPT_RUN_SUBTEST, >> > OPT_DESCRIPTION, >> > OPT_DEBUG, >> > @@ -478,6 +480,7 @@ static void print_usage(const char *help_str, bool >> > output_on_stderr) >> > >> > fprintf(f, "Usage: %s [OPTIONS]\n", command_str); >> > fprintf(f, " --list-subtests\n" >> > + " --with-slow-combinatorial\n" >> >" --run-subtest \n" >> >" --debug[=log-domain]\n" >> >" --interactive-debug[=domain]\n" >> > @@ -510,6 +513,7 @@ static int common_init(int *argc, char **argv, >> > int c, option_index = 0, i, x; >> > static struct option long_options[] = { >> > {"list-subtests", 0, 0, OPT_LIST_SUBTESTS}, >> > + {"with-slow-combinatorial", 0, 0, >> > OPT_WITH_SLOW_COMBINATORIAL}, >> > {"run-subtest", 1, 0, OPT_RUN_SUBTEST}, >> > {"help-description", 0, 0, OPT_DESCRIPTION}, >> > {"debug", optional_argument, 0, OPT_DEBUG}, >> > @@ -617,6 +621,10 @@ static int common_init(int *argc, char **argv, >> > if (!run_single_subtest) >> > list_subtests = true; >> > break; >> > + case OPT_WITH_SLOW_COMBINATORIAL: >> > + if (!run_single_subtest) >> >> This will cause piglit (and therefore QA) to unconditionally run all >> tests marked as slow, since it runs subtests individually. > > Why doesn't piglit run the default set of tests instead? What is the default set of tests? Each subtest is executed by piglit using --run-subtest to ensure information can be collected per-subtest (return code, error messages, dmesg logs, timings, etc.). > >> >> > + with_slow_combinatorial = true; >> > + break; >> > case OPT_RUN_SUBTEST: >> > if (!list_subtests) >> > run_single_subtest = strdup(optarg); >> > @@ -1629,6 +1637,17 @@ void igt_skip_on_simulation(void) >> > igt_require(!igt_run_in_simulation()); >> > } >> > >> > +/** >> > + * igt_slow_combinatorial: >> > + * >> > + * This is used to define subtests that should only be listed/run >> > + * when the "--with-slow-combinatorial" has been specified >> >> This isn't quite correct, as the subtests that use >> igt_slow_combinatorial will still always be listed. > > Yeah, I agree that the comment is incorrect; it should say "be run", > or alternatively the code altered to not list them unless "--all" > is passed. > >> >
Re: [Intel-gfx] [PATCH i-g-t 2/3] Unify handling of slow/combinatorial tests
On 28 October 2015 at 11:29, David Weinehall wrote: > Some tests should not be run by default, due to their slow, > and sometimes superfluous, nature. > > We still want to be able to run these tests in some cases. > Until now there's been no unified way of handling this. Remedy > this by introducing the --all option to igt_core, > and use it in gem_concurrent_blit & kms_frontbuffer_tracking. > > Signed-off-by: David Weinehall > --- > lib/igt_core.c | 24 + > lib/igt_core.h | 7 ++ > tests/gem_concurrent_blit.c | 44 - > tests/kms_frontbuffer_tracking.c | 208 > ++- > 4 files changed, 165 insertions(+), 118 deletions(-) > > diff --git a/lib/igt_core.c b/lib/igt_core.c > index 59127cafe606..6575b9d6bf0d 100644 > --- a/lib/igt_core.c > +++ b/lib/igt_core.c > @@ -216,6 +216,7 @@ const char *igt_interactive_debug; > > /* subtests helpers */ > static bool list_subtests = false; > +static bool with_slow_combinatorial = false; > static char *run_single_subtest = NULL; > static bool run_single_subtest_found = false; > static const char *in_subtest = NULL; > @@ -235,6 +236,7 @@ bool test_child; > > enum { > OPT_LIST_SUBTESTS, > + OPT_WITH_SLOW_COMBINATORIAL, > OPT_RUN_SUBTEST, > OPT_DESCRIPTION, > OPT_DEBUG, > @@ -478,6 +480,7 @@ static void print_usage(const char *help_str, bool > output_on_stderr) > > fprintf(f, "Usage: %s [OPTIONS]\n", command_str); > fprintf(f, " --list-subtests\n" > + " --all\n" >" --run-subtest \n" >" --debug[=log-domain]\n" >" --interactive-debug[=domain]\n" > @@ -510,6 +513,7 @@ static int common_init(int *argc, char **argv, > int c, option_index = 0, i, x; > static struct option long_options[] = { > {"list-subtests", 0, 0, OPT_LIST_SUBTESTS}, > + {"all", 0, 0, OPT_WITH_SLOW_COMBINATORIAL}, > {"run-subtest", 1, 0, OPT_RUN_SUBTEST}, > {"help-description", 0, 0, OPT_DESCRIPTION}, > {"debug", optional_argument, 0, OPT_DEBUG}, > @@ -617,6 +621,10 @@ static int common_init(int *argc, char **argv, > if (!run_single_subtest) > list_subtests = true; > break; > + case OPT_WITH_SLOW_COMBINATORIAL: > + if (!run_single_subtest) > + with_slow_combinatorial = true; > + break; > case OPT_RUN_SUBTEST: > if (!list_subtests) > run_single_subtest = strdup(optarg); > @@ -1629,6 +1637,22 @@ void igt_skip_on_simulation(void) > igt_require(!igt_run_in_simulation()); > } > > +/** > + * __igt_slow_combinatorial: If this is intended to be documented and used in tests, then it should be included in the public API (i.e. without the underscore prefix). > + * > + * This is used to skip subtests that should only be included > + * when the "--all" command line option has been specified. This version > + * is intended as a test. > + * > + * @slow_test: true if the subtest is part of the slow/combinatorial set If this is used to test if a slow subtest should be run, shouldn't slow_test always be true? > + * > + * Returns: true if the test should be run, false if the test should be > skipped > + */ > +bool __igt_slow_combinatorial(bool slow_test) > +{ > + return !slow_test || with_slow_combinatorial; > +} > + > /* structured logging */ > > /** > diff --git a/lib/igt_core.h b/lib/igt_core.h > index 5ae09653fd55..7b592278bf6c 100644 > --- a/lib/igt_core.h > +++ b/lib/igt_core.h > @@ -191,6 +191,12 @@ bool __igt_run_subtest(const char *subtest_name); > #define igt_subtest_f(f...) \ > __igt_subtest_f(igt_tokencat(__tmpchar, __LINE__), f) > > +bool __igt_slow_combinatorial(bool slow_test); > + Documentation for igt_subtest_slow_f is needed here. If __slow is false, this macro just defines a normal subtest, which is contradictory to its name. Perhaps igt_subtest_with_flags_f (or similar) would be better and would also allow for future expansion with other categories. > +#define igt_subtest_slow_f(__slow, f...) \ > + if (__igt_slow_combinatorial(__slow)) \ > + __igt_subtest_f(igt_tokencat(__tmpchar, __LINE__), f) > + > const char *igt_subtest_name(void); > bool igt_only_list_subtests(void); > > @@ -669,6 +675,7 @@ void igt_disable_exit_handler(void); > > /* helpers to automatically reduce test runtime in simulation */ > bool igt_run_in_simulation(void); > + > /** > * SLOW_QUICK: > * @slow: value in simulation mode > diff --git a/tests/gem_concurrent_blit.c b/tests/gem_concurrent_blit.c > index 1d2d787202df..fe37cc707583 100644 > --- a/tests/gem_concurrent_blit.c > +++ b/tests/gem_concurrent_blit.c > @@ -55,7 +55,6 @@ IGT_TEST_DESCRIPT
Re: [Intel-gfx] [PATCH] lib/igt_kms: Introduce get_first_connected_output to retrieve a valid output
On 29 October 2015 at 02:09, Vivek Kasireddy wrote: > In some cases, we just need one valid output to perform a test. > This macro can help in these situations by avoiding iterating > over all the outputs. > > Suggested-by: Matt Roper > CC: Tvrtko Ursulin > CC: Matt Roper > Signed-off-by: Vivek Kasireddy > --- > lib/igt_kms.h| 5 + > tests/kms_rotation_crc.c | 5 +++-- > 2 files changed, 8 insertions(+), 2 deletions(-) > > diff --git a/lib/igt_kms.h b/lib/igt_kms.h > index 09c08aa..6847beb 100644 > --- a/lib/igt_kms.h > +++ b/lib/igt_kms.h > @@ -278,6 +278,11 @@ void igt_wait_for_vblank(int drm_fd, enum pipe pipe); > for (int i__ = 0; (plane) = &(display)->pipes[(pipe)].planes[i__], \ > i__ < (display)->pipes[(pipe)].n_planes; i__++) > Please add some API documentation here. > +#define get_first_connected_output(display, output)\ > + for (int i__ = 0; i__ < (display)->n_outputs; i__++) \ > + if ((output = &(display)->outputs[i__]), output->valid) \ > + break > + > /* > * Can be used with igt_output_set_pipe() to mean we don't care about the > pipe > * that should drive this output > diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c > index 31cece2..3f0a3ef 100644 > --- a/tests/kms_rotation_crc.c > +++ b/tests/kms_rotation_crc.c > @@ -272,14 +272,15 @@ static void test_plane_rotation_ytiled_obj(data_t > *data, enum igt_plane plane_ty > int bpp = igt_drm_format_to_bpp(format); > enum igt_commit_style commit = COMMIT_LEGACY; > int fd = data->gfx_fd; > - igt_output_t *output = &display->outputs[0]; > + igt_output_t *output = NULL; > igt_plane_t *plane; > drmModeModeInfo *mode; > unsigned int stride, size, w, h; > uint32_t gem_handle; > int ret; > > - igt_require(output != NULL && output->valid == true); > + get_first_connected_output(display, output); > + igt_require(output != NULL); > > plane = igt_output_get_plane(output, plane_type); > igt_require(igt_plane_supports_rotation(plane)); > -- > 2.4.3 > > ___ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 1/8] kms_force_connector: use comparison macros to make debug output clearer
Signed-off-by: Thomas Wood --- tests/kms_force_connector.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c index 7485ca8..4ba1e0b 100644 --- a/tests/kms_force_connector.c +++ b/tests/kms_force_connector.c @@ -27,8 +27,9 @@ IGT_TEST_DESCRIPTION("Check the debugfs force connector/edid features work" " correctly."); -#define CHECK_MODE(m, h, w, r) igt_assert(m.hdisplay == h && m.vdisplay == w \ - && m.vrefresh == r) +#define CHECK_MODE(m, h, w, r) \ + igt_assert_eq(m.hdisplay, h); igt_assert_eq(m.vdisplay, w); \ + igt_assert_eq(m.vrefresh, r); igt_main { @@ -63,8 +64,8 @@ igt_main /* force the connector on and check the reported values */ kmstest_force_connector(drm_fd, vga_connector, FORCE_CONNECTOR_ON); temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); - igt_assert(temp->connection == DRM_MODE_CONNECTED); - igt_assert(temp->count_modes > 0); + igt_assert_eq(temp->connection, DRM_MODE_CONNECTED); + igt_assert_lt(0, temp->count_modes); drmModeFreeConnector(temp); /* attempt to use the display */ @@ -77,15 +78,15 @@ igt_main kmstest_force_connector(drm_fd, vga_connector, FORCE_CONNECTOR_OFF); temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); - igt_assert(temp->connection == DRM_MODE_DISCONNECTED); - igt_assert(temp->count_modes == 0); + igt_assert_eq(temp->connection, DRM_MODE_DISCONNECTED); + igt_assert_lt(0, temp->count_modes); drmModeFreeConnector(temp); /* check that the previous state is restored */ kmstest_force_connector(drm_fd, vga_connector, FORCE_CONNECTOR_UNSPECIFIED); temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); - igt_assert(temp->connection == vga_connector->connection); + igt_assert_eq(temp->connection, vga_connector->connection); drmModeFreeConnector(temp); } @@ -115,7 +116,7 @@ igt_main temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); /* the connector should now have the same number of modes that * it started with */ - igt_assert(temp->count_modes == start_n_modes); + igt_assert_eq(temp->count_modes, start_n_modes); drmModeFreeConnector(temp); kmstest_force_connector(drm_fd, vga_connector, -- 1.9.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 4/8] tests: remove unnecessary igt_exit calls
Signed-off-by: Thomas Wood --- tests/gem_render_linear_blits.c | 2 -- tests/gem_render_tiled_blits.c | 2 -- tests/kms_3d.c | 2 -- tests/kms_force_connector.c | 2 -- 4 files changed, 8 deletions(-) diff --git a/tests/gem_render_linear_blits.c b/tests/gem_render_linear_blits.c index 8df180a..13f76a5 100644 --- a/tests/gem_render_linear_blits.c +++ b/tests/gem_render_linear_blits.c @@ -210,6 +210,4 @@ igt_main intel_require_memory(count, SIZE, CHECK_RAM | CHECK_SWAP); run_test(fd, count); } - - igt_exit(); } diff --git a/tests/gem_render_tiled_blits.c b/tests/gem_render_tiled_blits.c index 9f6cbd5..fb2f39d 100644 --- a/tests/gem_render_tiled_blits.c +++ b/tests/gem_render_tiled_blits.c @@ -223,6 +223,4 @@ igt_main intel_require_memory(count, SIZE, CHECK_RAM | CHECK_SWAP); run_test(fd, count); } - - igt_exit(); } diff --git a/tests/kms_3d.c b/tests/kms_3d.c index 642a3d6..7484940 100644 --- a/tests/kms_3d.c +++ b/tests/kms_3d.c @@ -115,6 +115,4 @@ igt_simple_main drmModeFreeConnector(connector); free(edid); - - igt_exit(); } diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c index 4ba1e0b..6b0cb34 100644 --- a/tests/kms_force_connector.c +++ b/tests/kms_force_connector.c @@ -126,6 +126,4 @@ igt_main igt_fixture { drmModeFreeConnector(vga_connector); } - - igt_exit(); } -- 1.9.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 8/8] tests/kms_fbc_crc: ensure context is initialized correctly
Initialization was included in commit a976d7e (tests/kms_fbc_crc: refactor context handling code), but won't be executed since it is declared before the first label within a switch statement. kms_fbc_crc.c:178:2: warning: ‘context’ may be used uninitialized in this function [-Wmaybe-uninitialized] rendercopy(batch, context, ^ kms_fbc_crc.c:271:22: note: ‘context’ was declared here drm_intel_context *context = NULL; ^ Cc: Paulo Zanoni Signed-off-by: Thomas Wood --- tests/kms_fbc_crc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/kms_fbc_crc.c b/tests/kms_fbc_crc.c index d580a94..02e95e5 100644 --- a/tests/kms_fbc_crc.c +++ b/tests/kms_fbc_crc.c @@ -255,6 +255,7 @@ static void test_crc(data_t *data, enum test_mode mode) { uint32_t crtc_id = data->output->config.crtc->crtc_id; uint32_t handle = data->fb[0].gem_handle; + drm_intel_context *context = NULL; igt_assert(fbc_enabled(data)); @@ -268,7 +269,6 @@ static void test_crc(data_t *data, enum test_mode mode) } switch (mode) { - drm_intel_context *context = NULL; case TEST_PAGE_FLIP: break; case TEST_MMAP_CPU: -- 1.9.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 2/8] lib: highlight subtest results on terminals
Make subtest results easier to identify by making them bold when the output is a terminal. Signed-off-by: Thomas Wood --- lib/igt_core.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/igt_core.c b/lib/igt_core.c index 59127ca..7123455 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -779,9 +779,12 @@ bool __igt_run_subtest(const char *subtest_name) } if (skip_subtests_henceforth) { - printf("Subtest %s: %s\n", subtest_name, + bool istty = isatty(STDOUT_FILENO); + + printf("%sSubtest %s: %s%s\n", + (istty) ? "\x1b[1m" : "", subtest_name, skip_subtests_henceforth == SKIP ? - "SKIP" : "FAIL"); + "SKIP" : "FAIL", (istty) ? "\x1b[0m" : ""); return false; } @@ -825,12 +828,14 @@ static void exit_subtest(const char *result) { struct timespec now; double elapsed; + bool istty = isatty(STDOUT_FILENO); gettime(&now); elapsed = now.tv_sec - subtest_time.tv_sec; elapsed += (now.tv_nsec - subtest_time.tv_nsec) * 1e-9; - printf("Subtest %s: %s (%.3fs)\n", in_subtest, result, elapsed); + printf("%sSubtest %s: %s (%.3fs)%s\n", (istty) ? "\x1b[1m" : "", + in_subtest, result, elapsed, (istty) ? "\x1b[0m" : ""); fflush(stdout); in_subtest = NULL; -- 1.9.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 3/8] Add missing noreturn attribute to various functions
Signed-off-by: Thomas Wood --- debugger/eudb.c | 2 +- lib/igt_core.c | 2 +- tests/gem_madvise.c | 2 +- tests/pm_rpm.c | 2 +- tests/testdisplay.c | 2 +- tools/intel_display_poller.c | 2 +- tools/intel_gpu_frequency.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/debugger/eudb.c b/debugger/eudb.c index e015e2e..47d5d92 100644 --- a/debugger/eudb.c +++ b/debugger/eudb.c @@ -326,7 +326,7 @@ db_shutdown(int sig) { printf("Shutting down...\n"); } -static void +static void __attribute__((noreturn)) die(int reason) { int i = 0; diff --git a/lib/igt_core.c b/lib/igt_core.c index 7123455..7e99b24 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -1755,7 +1755,7 @@ out: } static const char *timeout_op; -static void igt_alarm_handler(int signal) +static void __attribute__((noreturn)) igt_alarm_handler(int signal) { if (timeout_op) igt_info("Timed out: %s\n", timeout_op); diff --git a/tests/gem_madvise.c b/tests/gem_madvise.c index 093d78a..36408fe 100644 --- a/tests/gem_madvise.c +++ b/tests/gem_madvise.c @@ -49,7 +49,7 @@ IGT_TEST_DESCRIPTION("Checks that the kernel reports EFAULT when trying to use" static jmp_buf jmp; -static void sigtrap(int sig) +static void __attribute__((noreturn)) sigtrap(int sig) { longjmp(jmp, sig); } diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c index d43cc06..c4fb19c 100644 --- a/tests/pm_rpm.c +++ b/tests/pm_rpm.c @@ -1386,7 +1386,7 @@ static void pci_d3_state_subtest(void) igt_assert(!device_in_pci_d3()); } -static void stay_subtest(void) +static void __attribute__((noreturn)) stay_subtest(void) { disable_all_screens_and_wait(&ms_data); diff --git a/tests/testdisplay.c b/tests/testdisplay.c index 4efcb59..28875b2 100644 --- a/tests/testdisplay.c +++ b/tests/testdisplay.c @@ -552,7 +552,7 @@ static void __attribute__((noreturn)) usage(char *name, char opt) #define dump_resource(res) if (res) dump_##res() -static void cleanup_and_exit(int ret) +static void __attribute__((noreturn)) cleanup_and_exit(int ret) { close(drm_fd); exit(ret); diff --git a/tools/intel_display_poller.c b/tools/intel_display_poller.c index 56dcd44..eab17c5 100644 --- a/tools/intel_display_poller.c +++ b/tools/intel_display_poller.c @@ -946,7 +946,7 @@ static const char *test_name(enum test test, int pipe, int bit, bool test_pixel_ } } -static void usage(const char *name) +static void __attribute__((noreturn)) usage(const char *name) { fprintf(stderr, "Usage: %s [options]\n" " -t,--test \n" diff --git a/tools/intel_gpu_frequency.c b/tools/intel_gpu_frequency.c index 5ae47e7..cb758b0 100644 --- a/tools/intel_gpu_frequency.c +++ b/tools/intel_gpu_frequency.c @@ -142,7 +142,7 @@ static int get_frequency(struct freq_info *freq_info) return val; } -static void +static void __attribute__((noreturn)) usage(const char *prog) { printf("%s A program to manipulate Intel GPU frequencies.\n\n", prog); -- 1.9.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 5/8] tests: remove duplicate struct member initializers
Signed-off-by: Thomas Wood --- tests/kms_frontbuffer_tracking.c | 1 - tests/pm_lpsp.c | 1 - 2 files changed, 2 deletions(-) diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c index 15707b9..13b91ad 100644 --- a/tests/kms_frontbuffer_tracking.c +++ b/tests/kms_frontbuffer_tracking.c @@ -305,7 +305,6 @@ drmModeModeInfo std_1024_mode = { .hsync_start = 1048, .hsync_end = 1184, .htotal = 1344, - .vtotal = 806, .hskew = 0, .vdisplay = 768, .vsync_start = 771, diff --git a/tests/pm_lpsp.c b/tests/pm_lpsp.c index 2badb5c..b62876c 100644 --- a/tests/pm_lpsp.c +++ b/tests/pm_lpsp.c @@ -103,7 +103,6 @@ static void edp_subtest(int drm_fd, drmModeResPtr drm_res, .hsync_start = 1048, .hsync_end = 1184, .htotal = 1344, - .vtotal = 806, .hskew = 0, .vdisplay = 768, .vsync_start = 771, -- 1.9.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 7/8] lib: add PIPE_ANY to the pipe enum
This avoids compiler warnings about invalid enum values. Signed-off-by: Thomas Wood --- lib/igt_kms.h | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/igt_kms.h b/lib/igt_kms.h index 09c08aa..965c47c 100644 --- a/lib/igt_kms.h +++ b/lib/igt_kms.h @@ -40,6 +40,7 @@ /* Low-level helpers with kmstest_ prefix */ enum pipe { +PIPE_ANY = -1, PIPE_A = 0, PIPE_B, PIPE_C, @@ -278,12 +279,6 @@ void igt_wait_for_vblank(int drm_fd, enum pipe pipe); for (int i__ = 0; (plane) = &(display)->pipes[(pipe)].planes[i__], \ i__ < (display)->pipes[(pipe)].n_planes; i__++) -/* - * Can be used with igt_output_set_pipe() to mean we don't care about the pipe - * that should drive this output - */ -#define PIPE_ANY (-1) - #define IGT_FIXED(i,f) ((i) << 16 | (f)) void igt_enable_connectors(void); -- 1.9.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 6/8] Fix comparison of unsigned integers
Signed-off-by: Thomas Wood --- benchmarks/gem_exec_reloc.c | 2 -- overlay/gem-interrupts.c| 7 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/benchmarks/gem_exec_reloc.c b/benchmarks/gem_exec_reloc.c index 5be482a..2ef6df5 100644 --- a/benchmarks/gem_exec_reloc.c +++ b/benchmarks/gem_exec_reloc.c @@ -249,8 +249,6 @@ int main(int argc, char **argv) case 'r': num_relocs = atoi(optarg); - if (num_relocs < 0) - num_relocs = 0; break; } } diff --git a/overlay/gem-interrupts.c b/overlay/gem-interrupts.c index 48a36b8..0150a1d 100644 --- a/overlay/gem-interrupts.c +++ b/overlay/gem-interrupts.c @@ -142,9 +142,12 @@ int gem_interrupts_update(struct gem_interrupts *irqs) return irqs->error; if (irqs->fd < 0) { - val = interrupts_read(); - if (val < 0) + long long ret; + ret = interrupts_read(); + if (ret < 0) return irqs->error = ENODEV; + else + val = ret; } else { if (read(irqs->fd, &val, sizeof(val)) < 0) return irqs->error = errno; -- 1.9.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH] igt/kms_rotation_crc: Add a subtest to validate Y-tiled obj + Y fb modifier (v3)
On 27 October 2015 at 10:37, Tvrtko Ursulin wrote: > > On 23/10/15 12:35, Daniel Vetter wrote: >> >> On Fri, Oct 23, 2015 at 09:51:06AM +0100, Tvrtko Ursulin wrote: >>> >>> >>> Hi, >>> >>> On 23/10/15 02:34, Vivek Kasireddy wrote: The main goal of this subtest is to trigger the following warning in the function i915_gem_object_get_fence(): if (WARN_ON(!obj->map_and_fenceable)) To trigger this warning, the subtest first creates a Y-tiled object and an associated framebuffer with the Y-fb modifier. Furthermore, to prevent the map_and_fenceable from being set, we make sure that the object does not have a normal VMA by refraining from rendering to the object and by setting the rotation property upfront before calling commit. v2: Do not call paint_squares and just use one output. v3: Convert an if condition to igt_require and move the plane rotation requirement further up before the fb allocation. Cc: Tvrtko Ursulin Signed-off-by: Vivek Kasireddy --- tests/kms_rotation_crc.c | 68 1 file changed, 68 insertions(+) diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c index cc9847e..b25a949 100644 --- a/tests/kms_rotation_crc.c +++ b/tests/kms_rotation_crc.c @@ -264,6 +264,68 @@ static void test_plane_rotation(data_t *data, enum igt_plane plane_type) igt_require_f(valid_tests, "no valid crtc/connector combinations found\n"); } +static void test_plane_rotation_ytiled_obj(data_t *data, enum igt_plane plane_type) +{ + igt_display_t *display = &data->display; + uint64_t tiling = LOCAL_I915_FORMAT_MOD_Y_TILED; + uint32_t format = DRM_FORMAT_XRGB; + int bpp = igt_drm_format_to_bpp(format); + enum igt_commit_style commit = COMMIT_LEGACY; + int fd = data->gfx_fd; + igt_output_t *output = &display->outputs[0]; + igt_plane_t *plane; + drmModeModeInfo *mode; + unsigned int stride, size, w, h; + uint32_t gem_handle; + int ret; + + igt_require(output != NULL && output->valid == true); + + plane = igt_output_get_plane(output, plane_type); + igt_require(igt_plane_supports_rotation(plane)); + + if (plane_type == IGT_PLANE_PRIMARY || plane_type == IGT_PLANE_CURSOR) { + igt_require(data->display.has_universal_planes); + commit = COMMIT_UNIVERSAL; + } + + mode = igt_output_get_mode(output); + w = mode->hdisplay; + h = mode->vdisplay; + + for (stride = 512; stride < (w * bpp / 8); stride *= 2) + ; + for (size = 1024*1024; size < stride * h; size *= 2) + ; + + gem_handle = gem_create(fd, size); + ret = __gem_set_tiling(fd, gem_handle, I915_TILING_Y, stride); + igt_assert(ret == 0); + + do_or_die(__kms_addfb(fd, gem_handle, w, h, stride, + format, tiling, LOCAL_DRM_MODE_FB_MODIFIERS, + &data->fb.fb_id)); + data->fb.width = w; + data->fb.height = h; + data->fb.gem_handle = gem_handle; + + igt_plane_set_fb(plane, NULL); + igt_display_commit(display); + + igt_plane_set_rotation(plane, data->rotation); + igt_plane_set_fb(plane, &data->fb); + + drmModeObjectSetProperty(fd, plane->drm_plane->plane_id, +DRM_MODE_OBJECT_PLANE, +plane->rotation_property, +plane->rotation); + ret = igt_display_try_commit2(display, commit); + + kmstest_restore_vt_mode(); + igt_remove_fb(fd, &data->fb); + igt_assert(ret == 0); +} + igt_main { data_t data = {}; @@ -345,6 +407,12 @@ igt_main test_plane_rotation(&data, IGT_PLANE_PRIMARY); } + igt_subtest_f("primary-rotation-90-Y-tiled") { + igt_require(gen >= 9); + data.rotation = IGT_ROTATION_90; + test_plane_rotation_ytiled_obj(&data, IGT_PLANE_PRIMARY); + } + igt_fixture { igt_display_fini(&data.display); } >>> >>> Reviewed-by: Tvrtko Ursulin >> >> >> Applied, thanks. > > > Hasn't hit the repo yet. Daniel has now pushed this patch (v3), so the further changes that have been made will need to be split into new patches. > > Regards, > > Tvrtko > > ___ > Intel-gfx mailing list > Intel-
Re: [Intel-gfx] [PATCH i-g-t 1/8] kms_force_connector: use comparison macros to make debug output clearer
On 2 November 2015 at 11:48, Thomas Wood wrote: > Signed-off-by: Thomas Wood > --- > tests/kms_force_connector.c | 17 + > 1 file changed, 9 insertions(+), 8 deletions(-) > > diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c > index 7485ca8..4ba1e0b 100644 > --- a/tests/kms_force_connector.c > +++ b/tests/kms_force_connector.c > @@ -27,8 +27,9 @@ > IGT_TEST_DESCRIPTION("Check the debugfs force connector/edid features work" > " correctly."); > > -#define CHECK_MODE(m, h, w, r) igt_assert(m.hdisplay == h && m.vdisplay == w > \ > - && m.vrefresh == r) > +#define CHECK_MODE(m, h, w, r) \ > + igt_assert_eq(m.hdisplay, h); igt_assert_eq(m.vdisplay, w); \ > + igt_assert_eq(m.vrefresh, r); > > igt_main > { > @@ -63,8 +64,8 @@ igt_main > /* force the connector on and check the reported values */ > kmstest_force_connector(drm_fd, vga_connector, > FORCE_CONNECTOR_ON); > temp = drmModeGetConnector(drm_fd, > vga_connector->connector_id); > - igt_assert(temp->connection == DRM_MODE_CONNECTED); > - igt_assert(temp->count_modes > 0); > + igt_assert_eq(temp->connection, DRM_MODE_CONNECTED); > + igt_assert_lt(0, temp->count_modes); > drmModeFreeConnector(temp); > > /* attempt to use the display */ > @@ -77,15 +78,15 @@ igt_main > kmstest_force_connector(drm_fd, vga_connector, > FORCE_CONNECTOR_OFF); > temp = drmModeGetConnector(drm_fd, > vga_connector->connector_id); > - igt_assert(temp->connection == DRM_MODE_DISCONNECTED); > - igt_assert(temp->count_modes == 0); > + igt_assert_eq(temp->connection, DRM_MODE_DISCONNECTED); > + igt_assert_lt(0, temp->count_modes); This should have been igt_assert_eq. > drmModeFreeConnector(temp); > > /* check that the previous state is restored */ > kmstest_force_connector(drm_fd, vga_connector, > FORCE_CONNECTOR_UNSPECIFIED); > temp = drmModeGetConnector(drm_fd, > vga_connector->connector_id); > - igt_assert(temp->connection == vga_connector->connection); > + igt_assert_eq(temp->connection, vga_connector->connection); > drmModeFreeConnector(temp); > } > > @@ -115,7 +116,7 @@ igt_main > temp = drmModeGetConnector(drm_fd, > vga_connector->connector_id); > /* the connector should now have the same number of modes that > * it started with */ > - igt_assert(temp->count_modes == start_n_modes); > + igt_assert_eq(temp->count_modes, start_n_modes); > drmModeFreeConnector(temp); > > kmstest_force_connector(drm_fd, vga_connector, > -- > 1.9.1 > ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 1/5] tests/kms_force_connector: free the display struct when no longer needed
Signed-off-by: Thomas Wood --- tests/kms_force_connector.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c index 7485ca8..f48b187 100644 --- a/tests/kms_force_connector.c +++ b/tests/kms_force_connector.c @@ -36,7 +36,6 @@ igt_main int drm_fd = 0; drmModeRes *res; drmModeConnector *vga_connector = NULL, *temp; - igt_display_t display; int start_n_modes; igt_fixture { @@ -60,6 +59,8 @@ igt_main } igt_subtest("force-connector-state") { + igt_display_t display; + /* force the connector on and check the reported values */ kmstest_force_connector(drm_fd, vga_connector, FORCE_CONNECTOR_ON); temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); @@ -71,6 +72,7 @@ igt_main kmstest_set_vt_graphics_mode(); igt_display_init(&display, drm_fd); igt_display_commit(&display); + igt_display_fini(&display); /* force the connector off */ -- 1.9.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 3/5] tests/kms_force_connector: skip if the required connector is connected
Signed-off-by: Thomas Wood --- tests/kms_force_connector.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c index f48b187..1e5ec6f 100644 --- a/tests/kms_force_connector.c +++ b/tests/kms_force_connector.c @@ -56,6 +56,7 @@ igt_main } igt_require(vga_connector); + igt_skip_on(vga_connector->connection == DRM_MODE_CONNECTED); } igt_subtest("force-connector-state") { -- 1.9.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 5/5] tests/kms_force_connector: use comparison macros
Use the comparison macros to make debug output clearer. v2: fix incorrect comparison Signed-off-by: Thomas Wood --- tests/kms_force_connector.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c index 2cb149a..f34f21a 100644 --- a/tests/kms_force_connector.c +++ b/tests/kms_force_connector.c @@ -27,8 +27,9 @@ IGT_TEST_DESCRIPTION("Check the debugfs force connector/edid features work" " correctly."); -#define CHECK_MODE(m, h, w, r) igt_assert(m.hdisplay == h && m.vdisplay == w \ - && m.vrefresh == r) +#define CHECK_MODE(m, h, w, r) \ + igt_assert_eq(m.hdisplay, h); igt_assert_eq(m.vdisplay, w); \ + igt_assert_eq(m.vrefresh, r); static void __attribute__((noreturn)) reset_connectors() { @@ -107,8 +108,8 @@ int main(int argc, char **argv) /* force the connector on and check the reported values */ kmstest_force_connector(drm_fd, vga_connector, FORCE_CONNECTOR_ON); temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); - igt_assert(temp->connection == DRM_MODE_CONNECTED); - igt_assert(temp->count_modes > 0); + igt_assert_eq(temp->connection, DRM_MODE_CONNECTED); + igt_assert_lt(0, temp->count_modes); drmModeFreeConnector(temp); /* attempt to use the display */ @@ -122,15 +123,15 @@ int main(int argc, char **argv) kmstest_force_connector(drm_fd, vga_connector, FORCE_CONNECTOR_OFF); temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); - igt_assert(temp->connection == DRM_MODE_DISCONNECTED); - igt_assert(temp->count_modes == 0); + igt_assert_eq(temp->connection, DRM_MODE_DISCONNECTED); + igt_assert_eq(0, temp->count_modes); drmModeFreeConnector(temp); /* check that the previous state is restored */ kmstest_force_connector(drm_fd, vga_connector, FORCE_CONNECTOR_UNSPECIFIED); temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); - igt_assert(temp->connection == vga_connector->connection); + igt_assert_eq(temp->connection, vga_connector->connection); drmModeFreeConnector(temp); } @@ -160,7 +161,7 @@ int main(int argc, char **argv) temp = drmModeGetConnector(drm_fd, vga_connector->connector_id); /* the connector should now have the same number of modes that * it started with */ - igt_assert(temp->count_modes == start_n_modes); + igt_assert_eq(temp->count_modes, start_n_modes); drmModeFreeConnector(temp); kmstest_force_connector(drm_fd, vga_connector, -- 1.9.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 4/5] tests/kms_force_connector: add an option to reset connector force states
Signed-off-by: Thomas Wood --- tests/kms_force_connector.c | 44 +++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c index 1e5ec6f..2cb149a 100644 --- a/tests/kms_force_connector.c +++ b/tests/kms_force_connector.c @@ -30,13 +30,55 @@ IGT_TEST_DESCRIPTION("Check the debugfs force connector/edid features work" #define CHECK_MODE(m, h, w, r) igt_assert(m.hdisplay == h && m.vdisplay == w \ && m.vrefresh == r) -igt_main +static void __attribute__((noreturn)) reset_connectors() +{ + int drm_fd = 0; + drmModeRes *res; + drmModeConnector *connector = NULL; + + drm_fd = drm_open_driver_master(DRIVER_INTEL); + res = drmModeGetResources(drm_fd); + + for (int i = 0; i < res->count_connectors; i++) { + + connector = drmModeGetConnector(drm_fd, res->connectors[i]); + + kmstest_force_connector(drm_fd, connector, + FORCE_CONNECTOR_UNSPECIFIED); + + drmModeFreeConnector(connector); + } + + exit(0); +} + +static int opt_handler(int opt, int opt_index, void *data) +{ + switch (opt) { + case 'r': + reset_connectors(); + break; + } + + return 0; +} + +int main(int argc, char **argv) { /* force the VGA output and test that it worked */ int drm_fd = 0; drmModeRes *res; drmModeConnector *vga_connector = NULL, *temp; int start_n_modes; + struct option long_opts[] = { + {"reset", 0, 0, 'r'}, + {0, 0, 0, 0} + }; + const char *help_str = + " --reset\t\tReset all connector force states.\n"; + + igt_subtest_init_parse_opts(&argc, argv, "", long_opts, help_str, + opt_handler, NULL); igt_fixture { drm_fd = drm_open_driver_master(DRIVER_INTEL); -- 1.9.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 2/5] lib: add documentation for igt_display_init/fini
Signed-off-by: Thomas Wood --- lib/igt_kms.c | 16 1 file changed, 16 insertions(+) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 51d735d..878e1fb 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -962,6 +962,15 @@ static int get_drm_plane_type(int drm_fd, uint32_t plane_id) return DRM_PLANE_TYPE_OVERLAY; } +/** + * igt_display_init: + * @display: a pointer to an #igt_display_t structure + * @drm_fd: a drm file descriptor + * + * Initialize @display and allocate the various resources required. Use + * #igt_display_fini to release the resources when they are no longer required. + * + */ void igt_display_init(igt_display_t *display, int drm_fd) { drmModeRes *resources; @@ -1160,6 +1169,13 @@ static void igt_output_fini(igt_output_t *output) free(output->name); } +/** + * igt_display_fini: + * @display: a pointer to an #igt_display_t structure + * + * Release any resources associated with @display. This does not free @display + * itself. + */ void igt_display_fini(igt_display_t *display) { int i; -- 1.9.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH i-g-t 8/8] tests/kms_fbc_crc: ensure context is initialized correctly
On 4 November 2015 at 19:36, Zanoni, Paulo R wrote: > Em Seg, 2015-11-02 às 11:48 +0000, Thomas Wood escreveu: >> Initialization was included in commit a976d7e (tests/kms_fbc_crc: >> refactor context >> handling code), but won't be executed since it is declared before the >> first >> label within a switch statement. >> >> kms_fbc_crc.c:178:2: warning: ‘context’ may be used uninitialized in >> this function [-Wmaybe-uninitialized] >> rendercopy(batch, context, >> ^ >> kms_fbc_crc.c:271:22: note: ‘context’ was declared here >>drm_intel_context *context = NULL; > > I don't see these warnings here. Which compiler do you use? The warning requires -Wmaybe-uninitialized and an appropriate optimisation level to be enabled. -Wmaybe-uninitialized is currently disabled by the debug cflags in intel-gpu-tools due to previous false positives, but it looks like the situation with regards to this has improved and so it may be time to re-enable it. > > pzanoni@panetone:~/nfs/intel-gpu-tools/tests$ gcc --version > gcc (Debian 5.2.1-22) 5.2.1 20151010 > > The weird part is that it was initialized during the declaration, so > the declaration is valid yet the initialization is not? Anyway, your > change removes the ambiguity of the situation and avoid citations of > the C standard, so: > > Reviewed-by: Paulo Zanoni > >> >> ^ >> Cc: Paulo Zanoni >> Signed-off-by: Thomas Wood >> --- >> tests/kms_fbc_crc.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/tests/kms_fbc_crc.c b/tests/kms_fbc_crc.c >> index d580a94..02e95e5 100644 >> --- a/tests/kms_fbc_crc.c >> +++ b/tests/kms_fbc_crc.c >> @@ -255,6 +255,7 @@ static void test_crc(data_t *data, enum test_mode >> mode) >> { >> uint32_t crtc_id = data->output->config.crtc->crtc_id; >> uint32_t handle = data->fb[0].gem_handle; >> + drm_intel_context *context = NULL; >> >> igt_assert(fbc_enabled(data)); >> >> @@ -268,7 +269,6 @@ static void test_crc(data_t *data, enum test_mode >> mode) >> } >> >> switch (mode) { >> - drm_intel_context *context = NULL; >> case TEST_PAGE_FLIP: >> break; >> case TEST_MMAP_CPU: ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t] lib: add a environment variable to control output
Disable output of terminal control characters and progress meters when IGT_PLAIN_OUTPUT is set in the environment. Cc: Derek Morton Signed-off-by: Thomas Wood --- lib/igt_aux.c | 2 +- lib/igt_core.c | 23 ++- lib/igt_core.h | 2 ++ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/lib/igt_aux.c b/lib/igt_aux.c index f3c76ae..4d08d68 100644 --- a/lib/igt_aux.c +++ b/lib/igt_aux.c @@ -231,7 +231,7 @@ static void igt_interactive_info(const char *format, ...) { va_list args; - if (!isatty(STDERR_FILENO)) + if (!isatty(STDERR_FILENO) || __igt_plain_output) return; if (igt_log_level > IGT_LOG_INFO) diff --git a/lib/igt_core.c b/lib/igt_core.c index 7123455..ea9a68b 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -227,6 +227,8 @@ static enum { CONT = 0, SKIP, FAIL } skip_subtests_henceforth = CONT; +bool __igt_plain_output = false; + /* fork support state */ pid_t *test_children; int num_test_children; @@ -523,11 +525,15 @@ static int common_init(int *argc, char **argv, int extra_opt_count; int all_opt_count; int ret = 0; - char *env = getenv("IGT_LOG_LEVEL"); + const char *env; + + if (!isatty(STDOUT_FILENO) || getenv("IGT_PLAIN_OUTPUT")) + __igt_plain_output = true; - if (isatty(STDOUT_FILENO)) + if (!__igt_plain_output) setlocale(LC_ALL, ""); + env = getenv("IGT_LOG_LEVEL"); if (env) { if (strcmp(env, "debug") == 0) igt_log_level = IGT_LOG_DEBUG; @@ -779,12 +785,10 @@ bool __igt_run_subtest(const char *subtest_name) } if (skip_subtests_henceforth) { - bool istty = isatty(STDOUT_FILENO); - printf("%sSubtest %s: %s%s\n", - (istty) ? "\x1b[1m" : "", subtest_name, + (!__igt_plain_output) ? "\x1b[1m" : "", subtest_name, skip_subtests_henceforth == SKIP ? - "SKIP" : "FAIL", (istty) ? "\x1b[0m" : ""); + "SKIP" : "FAIL", (!__igt_plain_output) ? "\x1b[0m" : ""); return false; } @@ -828,14 +832,15 @@ static void exit_subtest(const char *result) { struct timespec now; double elapsed; - bool istty = isatty(STDOUT_FILENO); gettime(&now); elapsed = now.tv_sec - subtest_time.tv_sec; elapsed += (now.tv_nsec - subtest_time.tv_nsec) * 1e-9; - printf("%sSubtest %s: %s (%.3fs)%s\n", (istty) ? "\x1b[1m" : "", - in_subtest, result, elapsed, (istty) ? "\x1b[0m" : ""); + printf("%sSubtest %s: %s (%.3fs)%s\n", + (!__igt_plain_output) ? "\x1b[1m" : "", + in_subtest, result, elapsed, + (!__igt_plain_output) ? "\x1b[0m" : ""); fflush(stdout); in_subtest = NULL; diff --git a/lib/igt_core.h b/lib/igt_core.h index 5ae0965..a244fc3 100644 --- a/lib/igt_core.h +++ b/lib/igt_core.h @@ -45,6 +45,8 @@ extern const char* __igt_test_description __attribute__((weak)); +extern bool __igt_plain_output; + /** * IGT_TEST_DESCRIPTION: -- 1.9.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH i-g-t] lib: add a environment variable to control output
On 9 November 2015 at 20:58, Chris Wilson wrote: > On Mon, Nov 09, 2015 at 05:17:13PM +0000, Thomas Wood wrote: >> Disable output of terminal control characters and progress meters when >> IGT_PLAIN_OUTPUT is set in the environment. >> >> Cc: Derek Morton >> Signed-off-by: Thomas Wood >> --- >> lib/igt_aux.c | 2 +- >> lib/igt_core.c | 23 ++- >> lib/igt_core.h | 2 ++ >> 3 files changed, 17 insertions(+), 10 deletions(-) >> >> diff --git a/lib/igt_aux.c b/lib/igt_aux.c >> index f3c76ae..4d08d68 100644 >> --- a/lib/igt_aux.c >> +++ b/lib/igt_aux.c >> @@ -231,7 +231,7 @@ static void igt_interactive_info(const char *format, ...) >> { >> va_list args; >> >> - if (!isatty(STDERR_FILENO)) >> + if (!isatty(STDERR_FILENO) || __igt_plain_output) > > Hmm, would it not be a bug if we reach this point and we haven't > initialised __igt_plain_output from common_init()? Yes, except that common_init is called from within the igt_main or _init functions, so calling igt_interactive_info before one of these functions would be incorrect anyway. > -Chris > > -- > Chris Wilson, Intel Open Source Technology Centre > ___ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 1/2] tests/kms_force_connector: clear forced edid in reset
Signed-off-by: Thomas Wood --- tests/kms_force_connector.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c index f34f21a..a79c974 100644 --- a/tests/kms_force_connector.c +++ b/tests/kms_force_connector.c @@ -47,6 +47,8 @@ static void __attribute__((noreturn)) reset_connectors() kmstest_force_connector(drm_fd, connector, FORCE_CONNECTOR_UNSPECIFIED); + kmstest_force_edid(drm_fd, connector, NULL, 0); + drmModeFreeConnector(connector); } @@ -76,7 +78,7 @@ int main(int argc, char **argv) {0, 0, 0, 0} }; const char *help_str = - " --reset\t\tReset all connector force states.\n"; + " --reset\t\tReset all connector force states and edid.\n"; igt_subtest_init_parse_opts(&argc, argv, "", long_opts, help_str, opt_handler, NULL); -- 1.9.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 2/2] tests/kms_force_connector: reset connectors and edid on exit
Signed-off-by: Thomas Wood --- tests/kms_force_connector.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c index a79c974..cf918a7 100644 --- a/tests/kms_force_connector.c +++ b/tests/kms_force_connector.c @@ -31,7 +31,7 @@ IGT_TEST_DESCRIPTION("Check the debugfs force connector/edid features work" igt_assert_eq(m.hdisplay, h); igt_assert_eq(m.vdisplay, w); \ igt_assert_eq(m.vrefresh, r); -static void __attribute__((noreturn)) reset_connectors() +static void reset_connectors() { int drm_fd = 0; drmModeRes *res; @@ -51,8 +51,6 @@ static void __attribute__((noreturn)) reset_connectors() drmModeFreeConnector(connector); } - - exit(0); } static int opt_handler(int opt, int opt_index, void *data) @@ -60,6 +58,7 @@ static int opt_handler(int opt, int opt_index, void *data) switch (opt) { case 'r': reset_connectors(); + exit(0); break; } @@ -172,6 +171,9 @@ int main(int argc, char **argv) igt_fixture { drmModeFreeConnector(vga_connector); + close(drm_fd); + + reset_connectors(); } igt_exit(); -- 1.9.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH] igt/igt_kms: Introduce get_first_connected_output (v2)
On 5 November 2015 at 01:34, Vivek Kasireddy wrote: > In some cases, we just need one valid (connected) output to perform > a test. This macro can help in these situations by not having to > put the test code inside a for loop that iterates over all the outputs. > > v2: Added a brief documentation for this macro. The new macro is no longer being used anywhere. Is there a new patch that uses the macro? Also, if re-sending the patch, please make sure it is tagged correctly as described in: http://lists.freedesktop.org/archives/intel-gfx/2015-November/079712.html This also explains how to manage the version tag in the subject line. > > Suggested-by: Matt Roper > Cc: Thomas Wood > Signed-off-by: Vivek Kasireddy > --- > lib/igt_kms.h | 12 > 1 file changed, 12 insertions(+) > > diff --git a/lib/igt_kms.h b/lib/igt_kms.h > index 09c08aa..91fa206 100644 > --- a/lib/igt_kms.h > +++ b/lib/igt_kms.h > @@ -278,6 +278,18 @@ void igt_wait_for_vblank(int drm_fd, enum pipe pipe); > for (int i__ = 0; (plane) = &(display)->pipes[(pipe)].planes[i__], \ > i__ < (display)->pipes[(pipe)].n_planes; i__++) > > +/** > + * get_first_connected_output: > + * @display: Initialized igt_display_t type object > + * @output: igt_output_t type object > + * > + * Returns: First valid (connected) output. > + */ > +#define get_first_connected_output(display, output)\ > + for (int i__ = 0; i__ < (display)->n_outputs; i__++) \ > + if ((output = &(display)->outputs[i__]), output->valid) \ > + break > + > /* > * Can be used with igt_output_set_pipe() to mean we don't care about the > pipe > * that should drive this output > -- > 2.4.3 > ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH] igt/igt_kms: Introduce get_first_connected_output (v2)
On 14 November 2015 at 03:08, Vivek Kasireddy wrote: > On Fri, 13 Nov 2015 15:59:21 + > Thomas Wood wrote: > >> On 5 November 2015 at 01:34, Vivek Kasireddy >> wrote: >> > In some cases, we just need one valid (connected) output to perform >> > a test. This macro can help in these situations by not having to >> > put the test code inside a for loop that iterates over all the >> > outputs. >> > >> > v2: Added a brief documentation for this macro. >> >> The new macro is no longer being used anywhere. Is there a new patch >> that uses the macro? >> > > Hi Thomas, > I wanted to have this patch merged before I updated the tests to use > the macro. > >> >> Also, if re-sending the patch, please make sure it is tagged correctly >> as described in: >> >> http://lists.freedesktop.org/archives/intel-gfx/2015-November/079712.html >> >> This also explains how to manage the version tag in the subject line. > > Thanks for the link; I wasn't aware of it. Do you want me to resend the > patch in this format? Just resend it with the patches that use the macro so that they can all be reviewed and applied together. > > Thanks and Regards, > Vivek > >> >> >> > >> > Suggested-by: Matt Roper >> > Cc: Thomas Wood >> > Signed-off-by: Vivek Kasireddy >> > --- >> > lib/igt_kms.h | 12 >> > 1 file changed, 12 insertions(+) >> > >> > diff --git a/lib/igt_kms.h b/lib/igt_kms.h >> > index 09c08aa..91fa206 100644 >> > --- a/lib/igt_kms.h >> > +++ b/lib/igt_kms.h >> > @@ -278,6 +278,18 @@ void igt_wait_for_vblank(int drm_fd, enum pipe >> > pipe); for (int i__ = 0; (plane) = >> > &(display)->pipes[(pipe)].planes[i__], \ i__ < >> > (display)->pipes[(pipe)].n_planes; i__++) >> > >> > +/** >> > + * get_first_connected_output: >> > + * @display: Initialized igt_display_t type object >> > + * @output: igt_output_t type object >> > + * >> > + * Returns: First valid (connected) output. >> > + */ >> > +#define get_first_connected_output(display, output)\ >> > + for (int i__ = 0; i__ < (display)->n_outputs; i__++) \ >> > + if ((output = &(display)->outputs[i__]), >> > output->valid) \ >> > + break >> > + >> > /* >> > * Can be used with igt_output_set_pipe() to mean we don't care >> > about the pipe >> > * that should drive this output >> > -- >> > 2.4.3 >> > > ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH i-g-t] Add dmesg capture and dumping to tests and a test for it.
On 16 November 2015 at 13:22, Joonas Lahtinen wrote: > Cc: Thomas Wood > Cc: Chris Wilson > Cc: Damien Lespiau > Signed-off-by: Joonas Lahtinen > --- > lib/igt_core.c | 113 > ++--- > tests/Makefile.sources | 1 + > tests/igt_capture.c| 93 > 3 files changed, 200 insertions(+), 7 deletions(-) > create mode 100644 tests/igt_capture.c > > diff --git a/lib/igt_core.c b/lib/igt_core.c > index 04a0ab2..e73175a 100644 > --- a/lib/igt_core.c > +++ b/lib/igt_core.c > @@ -211,6 +211,8 @@ > * "--help" command line option. > */ > > +#define IGT_KMSG_CAPTURE_DUMP_BUF_SIZE 4096 > + > static unsigned int exit_handler_count; > const char *igt_interactive_debug; > > @@ -247,6 +249,10 @@ enum { > static int igt_exitcode = IGT_EXIT_SUCCESS; > static const char *command_str; > > +static int igt_kmsg_capture_fd; > +static char* igt_kmsg_capture_dump_buf; > +static pthread_mutex_t kmsg_mutex = PTHREAD_MUTEX_INITIALIZER; > + > static char* igt_log_domain_filter; > static struct { > char *entries[256]; > @@ -312,6 +318,71 @@ static void _igt_log_buffer_dump(void) > pthread_mutex_unlock(&log_buffer_mutex); > } > > +static void _igt_kmsg_capture_reset(void) > +{ > + if (igt_kmsg_capture_fd == -1) > + return; > + > + pthread_mutex_lock(&kmsg_mutex); > + > + lseek(igt_kmsg_capture_fd, 0, SEEK_END); > + > + pthread_mutex_unlock(&kmsg_mutex); > +} > + > +static void _igt_kmsg_capture_dump(void) > +{ > + size_t nbytes; > + int nlines; > + char *p; > + char *p0; > + int c; > + > + if (igt_kmsg_capture_fd == -1 || > + igt_kmsg_capture_dump_buf == NULL) > + return; > + > + pthread_mutex_lock(&kmsg_mutex); > + > + > + nlines = 0; > + do { > + errno = 0; > + nbytes = read(igt_kmsg_capture_fd, > + igt_kmsg_capture_dump_buf, > + IGT_KMSG_CAPTURE_DUMP_BUF_SIZE); > + > + if (nbytes == -1) > + continue; > + > + if (!nlines) > + fprintf(stderr, " KMSG \n"); > + > + p = p0 = strchr(igt_kmsg_capture_dump_buf, ';') + 1; > + while (p - p0 < nbytes) { > + if (*p != '\\') { > + fputc(*p++, stderr); > + continue; > + } > + sscanf(p, "\\x%x", &c); > + fputc(c, stderr); > + p += 4; > + } > + //fputs(strchr(igt_kmsg_capture_dump_buf, ';') + 1, stderr); This line can be removed if it is no longer needed. > + nlines++; > + } while(errno == 0); > + > + if (nlines) > + fprintf(stderr, " END \n"); > + else > + fprintf(stderr, "No kmsg.\n"); > + > + if (errno != EAGAIN) > + fprintf(stderr, "Incomplete kmsg.\n"); > + > + pthread_mutex_unlock(&kmsg_mutex); > +} > + > __attribute__((format(printf, 1, 2))) > static void kmsg(const char *format, ...) > #define KERN_EMER "<0>" > @@ -330,11 +401,15 @@ static void kmsg(const char *format, ...) > if (file == NULL) > return; > > + pthread_mutex_lock(&kmsg_mutex); > + > va_start(ap, format); > vfprintf(file, format, ap); > va_end(ap); > > fclose(file); > + > + pthread_mutex_unlock(&kmsg_mutex); > } > > static void gettime(struct timespec *ts) > @@ -527,6 +602,15 @@ static int common_init(int *argc, char **argv, > int ret = 0; > const char *env; > > + igt_kmsg_capture_fd = open("/dev/kmsg", O_RDWR | O_NONBLOCK); > + if (igt_kmsg_capture_fd != -1) { > + igt_kmsg_capture_dump_buf = > + malloc(IGT_KMSG_CAPTURE_DUMP_BUF_SIZE); > + if(igt_kmsg_capture_dump_buf == NULL) > + igt_warn("Unable to allocate memory, " > +"will not dump kmsg.\n"); > + } > + > if (!isatty(STDOUT_FILENO) || getenv("IGT_PLAIN_OUTPUT")) > __igt_plain_output = true; > > @@ -796,6 +880,7 @@ bool
Re: [Intel-gfx] [PATCH i-g-t] Add dmesg capture and dumping to tests and a test for it.
On 18 November 2015 at 15:44, Daniel Vetter wrote: > On Mon, Nov 16, 2015 at 03:22:23PM +0200, Joonas Lahtinen wrote: >> Cc: Thomas Wood >> Cc: Chris Wilson >> Cc: Damien Lespiau >> Signed-off-by: Joonas Lahtinen > > Given that we have all that in piglit already the commit message is a bit > thin on justification. Why do we need this in igt too? How does this > interact with the piglit dmesg capture? There are a few tests that rely on checking dmesg to determine if the test failed (such as gem_hangcheck_forcewake and kms_flip_event_leak). Although not implemented in this patch, it might be useful to use this feature to actually report a failure in those cases. > >> --- >> lib/igt_core.c | 113 >> ++--- >> tests/Makefile.sources | 1 + >> tests/igt_capture.c| 93 >> 3 files changed, 200 insertions(+), 7 deletions(-) >> create mode 100644 tests/igt_capture.c >> >> diff --git a/lib/igt_core.c b/lib/igt_core.c >> index 04a0ab2..e73175a 100644 >> --- a/lib/igt_core.c >> +++ b/lib/igt_core.c >> @@ -211,6 +211,8 @@ >> * "--help" command line option. >> */ >> >> +#define IGT_KMSG_CAPTURE_DUMP_BUF_SIZE 4096 >> + >> static unsigned int exit_handler_count; >> const char *igt_interactive_debug; >> >> @@ -247,6 +249,10 @@ enum { >> static int igt_exitcode = IGT_EXIT_SUCCESS; >> static const char *command_str; >> >> +static int igt_kmsg_capture_fd; >> +static char* igt_kmsg_capture_dump_buf; >> +static pthread_mutex_t kmsg_mutex = PTHREAD_MUTEX_INITIALIZER; >> + >> static char* igt_log_domain_filter; >> static struct { >> char *entries[256]; >> @@ -312,6 +318,71 @@ static void _igt_log_buffer_dump(void) >> pthread_mutex_unlock(&log_buffer_mutex); >> } >> >> +static void _igt_kmsg_capture_reset(void) >> +{ >> + if (igt_kmsg_capture_fd == -1) >> + return; >> + >> + pthread_mutex_lock(&kmsg_mutex); >> + >> + lseek(igt_kmsg_capture_fd, 0, SEEK_END); >> + >> + pthread_mutex_unlock(&kmsg_mutex); >> +} >> + >> +static void _igt_kmsg_capture_dump(void) >> +{ >> + size_t nbytes; >> + int nlines; >> + char *p; >> + char *p0; >> + int c; >> + >> + if (igt_kmsg_capture_fd == -1 || >> + igt_kmsg_capture_dump_buf == NULL) >> + return; >> + >> + pthread_mutex_lock(&kmsg_mutex); >> + >> + >> + nlines = 0; >> + do { >> + errno = 0; >> + nbytes = read(igt_kmsg_capture_fd, >> + igt_kmsg_capture_dump_buf, >> + IGT_KMSG_CAPTURE_DUMP_BUF_SIZE); >> + >> + if (nbytes == -1) >> + continue; >> + >> + if (!nlines) >> + fprintf(stderr, " KMSG \n"); >> + >> + p = p0 = strchr(igt_kmsg_capture_dump_buf, ';') + 1; >> + while (p - p0 < nbytes) { >> + if (*p != '\\') { >> + fputc(*p++, stderr); >> + continue; >> + } >> + sscanf(p, "\\x%x", &c); >> + fputc(c, stderr); >> + p += 4; >> + } >> + //fputs(strchr(igt_kmsg_capture_dump_buf, ';') + 1, stderr); >> + nlines++; >> + } while(errno == 0); >> + >> + if (nlines) >> + fprintf(stderr, " END \n"); >> + else >> + fprintf(stderr, "No kmsg.\n"); >> + >> + if (errno != EAGAIN) >> + fprintf(stderr, "Incomplete kmsg.\n"); >> + >> + pthread_mutex_unlock(&kmsg_mutex); >> +} >> + >> __attribute__((format(printf, 1, 2))) >> static void kmsg(const char *format, ...) >> #define KERN_EMER"<0>" >> @@ -330,11 +401,15 @@ static void kmsg(const char *format, ...) >> if (file == NULL) >> return; >> >> + pthread_mutex_lock(&kmsg_mutex); >> + >> va_start(ap, format); >> vfprintf(file, format, ap); >> va_end(ap); >> >> fclose(file); >> + >&g
[Intel-gfx] [PATCH i-g-t 2/2] lib: set a timeout when reading crc values
Signed-off-by: Thomas Wood --- lib/igt_debugfs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c index 4fd2e5a..0912f5b 100644 --- a/lib/igt_debugfs.c +++ b/lib/igt_debugfs.c @@ -459,7 +459,10 @@ static bool read_one_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out) ssize_t bytes_read; char buf[pipe_crc->buffer_len]; + igt_set_timeout(5); bytes_read = read(pipe_crc->crc_fd, &buf, pipe_crc->line_len); + igt_set_timeout(0); + igt_assert_cmpint(bytes_read, ==, pipe_crc->line_len); buf[bytes_read] = '\0'; -- 1.9.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 1/2] lib: add igt_set_timeout
Add a function to stop and fail a test after the specified number of seconds have elapsed. Signed-off-by: Thomas Wood --- lib/igt_core.c | 44 +--- lib/igt_core.h | 2 ++ 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/lib/igt_core.c b/lib/igt_core.c index 6f137ab..238068c 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -618,9 +618,12 @@ void igt_fail(int exitcode) if (test_child) exit(exitcode); - if (in_subtest) - exit_subtest("FAIL"); - else { + if (in_subtest) { + if (exitcode == 78) + exit_subtest("TIMEOUT"); + else + exit_subtest("FAIL"); + } else { assert(!test_with_subtests || in_fixture); if (in_fixture) { @@ -1201,3 +1204,38 @@ void igt_vlog(enum igt_log_level level, const char *format, va_list args) } else vprintf(format, args); } + +static void igt_alarm_handler(int signal) +{ + /* subsequent tests are skipped */ + skip_subtests_henceforth = SKIP; + + /* exit with status 78 to indicate timeout */ + igt_fail(78); +} + +/** + * igt_set_timeout: + * @seconds: seconds before timeout + * + * Stop the current test and skip any subsequent tests after the specified + * number of seconds have elapsed. The test will exit with "timeout" status + * (78). Any previous timer is cancelled and no timeout is scheduled if @seconds + * is zero. + * + */ +void igt_set_timeout(unsigned int seconds) +{ + struct sigaction sa; + + sa.sa_handler = igt_alarm_handler; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + + if (seconds == 0) + sigaction(SIGALRM, NULL, NULL); + else + sigaction(SIGALRM, &sa, NULL); + + alarm(seconds); +} diff --git a/lib/igt_core.h b/lib/igt_core.h index 7ede0d3..63ed9a5 100644 --- a/lib/igt_core.h +++ b/lib/igt_core.h @@ -465,4 +465,6 @@ extern enum igt_log_level igt_log_level; } while (0) +void igt_set_timeout(unsigned int timeout); + #endif /* IGT_CORE_H */ -- 1.9.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH] drm/sysfs: expose the "force" connector attribute
Signed-off-by: Thomas Wood --- drivers/gpu/drm/drm_sysfs.c | 49 + 1 file changed, 49 insertions(+) diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index c22c309..257816e 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c @@ -338,11 +338,60 @@ static ssize_t select_subconnector_show(struct device *device, drm_get_dvi_i_select_name((int)subconnector)); } +static ssize_t force_show(struct device *device, + struct device_attribute *attr, + char *buf) +{ + struct drm_connector *connector = to_drm_connector(device); + char *status; + + switch (connector->force) { + case DRM_FORCE_ON: + status = "on"; + break; + + case DRM_FORCE_ON_DIGITAL: + status = "digital"; + break; + + case DRM_FORCE_OFF: + status = "off"; + break; + + case DRM_FORCE_UNSPECIFIED: + status = "unspecified"; + break; + + default: + return 0; + } + + return snprintf(buf, PAGE_SIZE, "%s\n", status); +} + +ssize_t force_store(struct device *device, struct device_attribute *attr, + const char *buf, size_t count) +{ + struct drm_connector *connector = to_drm_connector(device); + + if (strcmp(buf, "on") == 0) + connector->force = DRM_FORCE_ON; + else if (strcmp(buf, "digital") == 0) + connector->force = DRM_FORCE_ON_DIGITAL; + else if (strcmp(buf, "off") == 0) + connector->force = DRM_FORCE_OFF; + else if (strcmp(buf, "unspecified") == 0) + connector->force = DRM_FORCE_UNSPECIFIED; + + return count; +} + static struct device_attribute connector_attrs[] = { __ATTR_RO(status), __ATTR_RO(enabled), __ATTR_RO(dpms), __ATTR_RO(modes), + __ATTR_RW(force), }; /* These attributes are for both DVI-I connectors and all types of tv-out. */ -- 1.9.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 0/2] enabling connectors
This series makes use of: http://lists.freedesktop.org/archives/intel-gfx/2014-May/045553.html to allow tests to enable or disable connectors as required. Thomas Wood (2): lib: add functions to change connector states tests: enable the VGA connector in the kms flip and pipe crc tests lib/igt_kms.c | 78 lib/igt_kms.h | 12 +++ tests/Makefile.sources | 1 + tests/kms_flip.c| 7 tests/kms_force_connector.c | 87 + tests/kms_pipe_crc_basic.c | 5 +++ 6 files changed, 190 insertions(+) create mode 100644 tests/kms_force_connector.c -- 1.9.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 2/2] tests: enable the VGA connector in the kms flip and pipe crc tests
Signed-off-by: Thomas Wood --- tests/kms_flip.c | 7 +++ tests/kms_pipe_crc_basic.c | 5 + 2 files changed, 12 insertions(+) diff --git a/tests/kms_flip.c b/tests/kms_flip.c index f2ec9ef..7d6e102 100644 --- a/tests/kms_flip.c +++ b/tests/kms_flip.c @@ -1566,6 +1566,8 @@ int main(int argc, char **argv) igt_fixture { drm_fd = drm_open_any(); + igt_set_vga_connector_state(drm_fd, FORCE_CONNECTOR_ON); + igt_set_vt_graphics_mode(); igt_install_exit_handler(kms_flip_exit_handler); get_timestamp_format(); @@ -1613,6 +1615,11 @@ int main(int argc, char **argv) } igt_stop_signal_helper(); + igt_fixture { + igt_set_vga_connector_state(drm_fd, + FORCE_CONNECTOR_UNSPECIFIED); + } + /* * Let drm_fd leak, since it's needed by the dpms restore * exit_handler and igt_exit() won't return. diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c index 282c7f6..eab3b3d 100644 --- a/tests/kms_pipe_crc_basic.c +++ b/tests/kms_pipe_crc_basic.c @@ -135,6 +135,8 @@ igt_main igt_fixture { data.drm_fd = drm_open_any(); + igt_set_vga_connector_state(data.drm_fd, FORCE_CONNECTOR_ON); + igt_set_vt_graphics_mode(); igt_require_pipe_crc(); @@ -164,5 +166,8 @@ igt_main igt_fixture { igt_display_fini(&data.display); + + igt_set_vga_connector_state(data.drm_fd, + FORCE_CONNECTOR_UNSPECIFIED); } } -- 1.9.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 1/2] lib: add functions to change connector states
Add a function to force a particular state on a connector and a convenience function to find and set the state on the VGA connector. Signed-off-by: Thomas Wood --- lib/igt_kms.c | 78 lib/igt_kms.h | 12 +++ tests/Makefile.sources | 1 + tests/kms_force_connector.c | 87 + 4 files changed, 178 insertions(+) create mode 100644 tests/kms_force_connector.c diff --git a/lib/igt_kms.c b/lib/igt_kms.c index d00250d..90c3e56 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -384,6 +384,61 @@ err1: return -1; } +static int get_card_number(int fd) +{ + struct stat buf; + + /* find the minor number of the device */ + fstat(fd, &buf); + + return minor(buf.st_rdev); +} + +/** + * kmstest_force_connector: + * @fd: drm file descriptor + * @connector: connector + * @state: state to force on @connector + * + * Force the specified state on the specified connector. + */ +void kmstest_force_connector(int drm_fd, drmModeConnector *connector, enum +force_connector state) +{ + char *path; + const char *value; + int sysfs_fd, ret; + + switch (state) { + case FORCE_CONNECTOR_UNSPECIFIED: + value = "unspecified"; + break; + case FORCE_CONNECTOR_ON: + value = "on"; + break; + case FORCE_CONNECTOR_DIGITAL: + value = "digital"; + break; + case FORCE_CONNECTOR_OFF: + value = "off"; + break; + } + + asprintf(&path, "/sys/class/drm/card%d-%s-%d/force", +get_card_number(drm_fd), +kmstest_connector_type_str(connector->connector_type), +connector->connector_type_id); + sysfs_fd = open(path, O_WRONLY | O_TRUNC); + free(path); + + igt_assert(sysfs_fd != -1); + + ret = write(sysfs_fd, value, strlen(value) + 1); + close(sysfs_fd); + + igt_assert(ret != -1); +} + void kmstest_free_connector_config(struct kmstest_connector_config *config) { drmModeFreeCrtc(config->crtc); @@ -1047,3 +1102,26 @@ void igt_wait_for_vblank(int drm_fd, enum pipe pipe) igt_assert(drmWaitVBlank(drm_fd, &wait_vbl) == 0); } + +void igt_set_vga_connector_state(int drm_fd, enum force_connector state) +{ + drmModeRes *res; + drmModeConnector *c; + + res = drmModeGetResources(drm_fd); + + /* find the vga connector */ + for (int i = 0; i < res->count_connectors; i++) { + + c = drmModeGetConnector(drm_fd, res->connectors[i]); + + if (c->connector_type == DRM_MODE_CONNECTOR_VGA) + break; + + drmModeFreeConnector(c); + } + + kmstest_force_connector(drm_fd, c, state); + + drmModeFreeConnector(c); +} diff --git a/lib/igt_kms.h b/lib/igt_kms.h index 8e80d4b..71f6831 100644 --- a/lib/igt_kms.h +++ b/lib/igt_kms.h @@ -75,11 +75,20 @@ struct kmstest_connector_config { int pipe; }; +enum force_connector { + FORCE_CONNECTOR_UNSPECIFIED, + FORCE_CONNECTOR_ON, + FORCE_CONNECTOR_DIGITAL, + FORCE_CONNECTOR_OFF +}; + int kmstest_get_connector_default_mode(int drm_fd, drmModeConnector *connector, drmModeModeInfo *mode); int kmstest_get_connector_config(int drm_fd, uint32_t connector_id, unsigned long crtc_idx_mask, struct kmstest_connector_config *config); +void kmstest_force_connector(int fd, drmModeConnector *connector, +enum force_connector state); void kmstest_free_connector_config(struct kmstest_connector_config *config); void kmstest_dump_mode(drmModeModeInfo *mode); @@ -175,5 +184,8 @@ void igt_wait_for_vblank(int drm_fd, enum pipe pipe); #define IGT_FIXED(i,f) ((i) << 16 | (f)) + +void igt_set_vga_connector_state(int drm_fd, enum force_connector state); + #endif /* __IGT_KMS_H__ */ diff --git a/tests/Makefile.sources b/tests/Makefile.sources index fbf63e9..eff0124 100644 --- a/tests/Makefile.sources +++ b/tests/Makefile.sources @@ -134,6 +134,7 @@ TESTS_progs = \ gen3_render_tiledx_blits \ gen3_render_tiledy_blits \ gen7_forcewake_mt \ + kms_force_connector \ kms_sink_crc_basic \ pm_psr \ pm_rc6_residency \ diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c new file mode 100644 index 000..b2659ae --- /dev/null +++ b/tests/kms_force_connector.c @@ -0,0 +1,87 @@ +/* + * Copyright © 2014 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to
Re: [Intel-gfx] [PATCH] drm/sysfs: expose the "force" connector attribute
On 19 May 2014 15:13, David Herrmann wrote: > Hi > > On Mon, May 19, 2014 at 3:37 PM, Thomas Wood wrote: >> Signed-off-by: Thomas Wood > > The commit-msg lacks any discussion why this change is done. What is > the reason to do that? Isn't the kernel-command-line enough? Why is > this a regular feature instead of a debugfs attribute? It was intended as a debug/testing feature to allow tests in intel-gpu-tools to enable or disable connectors: http://lists.freedesktop.org/archives/intel-gfx/2014-May/045556.html I'll update the commit message for the next version of the patch. > >> --- >> drivers/gpu/drm/drm_sysfs.c | 49 >> + >> 1 file changed, 49 insertions(+) >> >> diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c >> index c22c309..257816e 100644 >> --- a/drivers/gpu/drm/drm_sysfs.c >> +++ b/drivers/gpu/drm/drm_sysfs.c >> @@ -338,11 +338,60 @@ static ssize_t select_subconnector_show(struct device >> *device, >> drm_get_dvi_i_select_name((int)subconnector)); >> } >> >> +static ssize_t force_show(struct device *device, >> + struct device_attribute *attr, >> + char *buf) >> +{ >> + struct drm_connector *connector = to_drm_connector(device); >> + char *status; > > "const char *" or gcc might warn on string assignments. > >> + >> + switch (connector->force) { >> + case DRM_FORCE_ON: >> + status = "on"; >> + break; >> + >> + case DRM_FORCE_ON_DIGITAL: >> + status = "digital"; >> + break; >> + >> + case DRM_FORCE_OFF: >> + status = "off"; >> + break; >> + >> + case DRM_FORCE_UNSPECIFIED: >> + status = "unspecified"; >> + break; >> + >> + default: >> + return 0; >> + } >> + >> + return snprintf(buf, PAGE_SIZE, "%s\n", status); >> +} >> + >> +ssize_t force_store(struct device *device, struct device_attribute *attr, >> + const char *buf, size_t count) >> +{ >> + struct drm_connector *connector = to_drm_connector(device); >> + >> + if (strcmp(buf, "on") == 0) >> + connector->force = DRM_FORCE_ON; >> + else if (strcmp(buf, "digital") == 0) >> + connector->force = DRM_FORCE_ON_DIGITAL; >> + else if (strcmp(buf, "off") == 0) >> + connector->force = DRM_FORCE_OFF; >> + else if (strcmp(buf, "unspecified") == 0) >> + connector->force = DRM_FORCE_UNSPECIFIED; > > else > return -EINVAL; > > > This really looks like a debug-feature to me. If it's a real feature, > we _must_ rescan connectors here, otherwise it seems odd writing "on" > into that file but nothing happens until the next modeset. > > Thanks > David > >> + >> + return count; >> +} >> + >> static struct device_attribute connector_attrs[] = { >> __ATTR_RO(status), >> __ATTR_RO(enabled), >> __ATTR_RO(dpms), >> __ATTR_RO(modes), >> + __ATTR_RW(force), >> }; >> >> /* These attributes are for both DVI-I connectors and all types of tv-out. >> */ >> -- >> 1.9.0 >> >> ___ >> dri-devel mailing list >> dri-de...@lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/dri-devel ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH i-g-t 1/2] lib: add functions to change connector states
On 19 May 2014 15:28, Daniel Vetter wrote: > On Mon, May 19, 2014 at 02:42:07PM +0100, Thomas Wood wrote: >> Add a function to force a particular state on a connector and a >> convenience function to find and set the state on the VGA connector. >> >> Signed-off-by: Thomas Wood >> --- >> lib/igt_kms.c | 78 >> lib/igt_kms.h | 12 +++ >> tests/Makefile.sources | 1 + >> tests/kms_force_connector.c | 87 >> + >> 4 files changed, 178 insertions(+) >> create mode 100644 tests/kms_force_connector.c >> >> diff --git a/lib/igt_kms.c b/lib/igt_kms.c >> index d00250d..90c3e56 100644 >> --- a/lib/igt_kms.c >> +++ b/lib/igt_kms.c >> @@ -384,6 +384,61 @@ err1: >> return -1; >> } >> >> +static int get_card_number(int fd) >> +{ >> + struct stat buf; >> + >> + /* find the minor number of the device */ >> + fstat(fd, &buf); >> + >> + return minor(buf.st_rdev); >> +} >> + >> +/** >> + * kmstest_force_connector: >> + * @fd: drm file descriptor >> + * @connector: connector >> + * @state: state to force on @connector >> + * >> + * Force the specified state on the specified connector. >> + */ >> +void kmstest_force_connector(int drm_fd, drmModeConnector *connector, enum >> + force_connector state) > > Hm, for the interface I've thought more about > kmsttest_force_connector(drm_fd, connector, edid) since most often we > don't just want to force the state, but set a specific EDID (for a > high-res mode or something similar). Many tests don't need a specific mode, so the default ones are fine. Obviously in those cases they may just be able to pass NULL for the edid in the prototype you suggested, but the main thing here is to be able to enable the connector and use it. Another consideration when setting edid would be to prevent arbitrary edid values being set on a connector that actually has a display connected. > >> +{ >> + char *path; >> + const char *value; >> + int sysfs_fd, ret; >> + >> + switch (state) { >> + case FORCE_CONNECTOR_UNSPECIFIED: >> + value = "unspecified"; >> + break; >> + case FORCE_CONNECTOR_ON: >> + value = "on"; >> + break; >> + case FORCE_CONNECTOR_DIGITAL: >> + value = "digital"; >> + break; >> + case FORCE_CONNECTOR_OFF: >> + value = "off"; >> + break; >> + } >> + >> + asprintf(&path, "/sys/class/drm/card%d-%s-%d/force", >> + get_card_number(drm_fd), >> + kmstest_connector_type_str(connector->connector_type), >> + connector->connector_type_id); >> + sysfs_fd = open(path, O_WRONLY | O_TRUNC); >> + free(path); >> + >> + igt_assert(sysfs_fd != -1); >> + >> + ret = write(sysfs_fd, value, strlen(value) + 1); >> + close(sysfs_fd); >> + >> + igt_assert(ret != -1); >> +} > > We need an exit handler to clean up this mess again ;-) > >> + >> void kmstest_free_connector_config(struct kmstest_connector_config *config) >> { >> drmModeFreeCrtc(config->crtc); >> @@ -1047,3 +1102,26 @@ void igt_wait_for_vblank(int drm_fd, enum pipe pipe) >> >> igt_assert(drmWaitVBlank(drm_fd, &wait_vbl) == 0); >> } >> + >> +void igt_set_vga_connector_state(int drm_fd, enum force_connector state) > > Hm, for the higher-level library I've thought we'd just force everything > we reaosonable can, so I'd drop the vga here and also the state. So maybe > just igt_enable_fake_connectors(drm_fd, flags); How would the state be reset? Using an exit handler? > >> +{ >> + drmModeRes *res; >> + drmModeConnector *c; >> + >> + res = drmModeGetResources(drm_fd); >> + >> + /* find the vga connector */ >> + for (int i = 0; i < res->count_connectors; i++) { >> + >> + c = drmModeGetConnector(drm_fd, res->connectors[i]); >> + >> + if (c->connector_type == DRM_MODE_CONNECTOR_VGA) >> + break; >> + >> + drmModeFreeConnector(c); >> + } >> + >> + kmstest_force_connector(drm_fd, c, state); >> + >> + drmModeFreeConnec
Re: [Intel-gfx] [PATCH 1/5] drm/i915: Check for FIFO underuns when disabling reporting on gmch platforms
On 16 May 2014 17:40, wrote: > From: Ville Syrjälä > > FIFO underruns don't generate an interrupt on gmch platforms, so we > should check whether there were any that we failed to notice when > we're disabling FIFO underrun reporting. > > Signed-off-by: Ville Syrjälä Reviewed-by: Thomas Wood > --- > drivers/gpu/drm/i915/i915_irq.c | 18 -- > 1 file changed, 12 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c > index b10fbde..8bb564b 100644 > --- a/drivers/gpu/drm/i915/i915_irq.c > +++ b/drivers/gpu/drm/i915/i915_irq.c > @@ -266,16 +266,22 @@ static bool cpt_can_enable_serr_int(struct drm_device > *dev) > return true; > } > > -static void i9xx_clear_fifo_underrun(struct drm_device *dev, enum pipe pipe) > +static void i9xx_set_fifo_underrun_reporting(struct drm_device *dev, > +enum pipe pipe, bool enable) > { > struct drm_i915_private *dev_priv = dev->dev_private; > u32 reg = PIPESTAT(pipe); > - u32 pipestat = I915_READ(reg) & 0x7fff; > + u32 pipestat = I915_READ(reg) & 0x; > > assert_spin_locked(&dev_priv->irq_lock); > > - I915_WRITE(reg, pipestat | PIPE_FIFO_UNDERRUN_STATUS); > - POSTING_READ(reg); > + if (enable) { > + I915_WRITE(reg, pipestat | PIPE_FIFO_UNDERRUN_STATUS); > + POSTING_READ(reg); > + } else { > + if (pipestat & PIPE_FIFO_UNDERRUN_STATUS) > + DRM_ERROR("pipe %c underrun\n", pipe_name(pipe)); > + } > } > > static void ironlake_set_fifo_underrun_reporting(struct drm_device *dev, > @@ -432,8 +438,8 @@ bool __intel_set_cpu_fifo_underrun_reporting(struct > drm_device *dev, > > intel_crtc->cpu_fifo_underrun_disabled = !enable; > > - if (enable && (INTEL_INFO(dev)->gen < 5 || IS_VALLEYVIEW(dev))) > - i9xx_clear_fifo_underrun(dev, pipe); > + if (INTEL_INFO(dev)->gen < 5 || IS_VALLEYVIEW(dev)) > + i9xx_set_fifo_underrun_reporting(dev, pipe, enable); > else if (IS_GEN5(dev) || IS_GEN6(dev)) > ironlake_set_fifo_underrun_reporting(dev, pipe, enable); > else if (IS_GEN7(dev)) > -- > 1.8.5.5 > ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 4/5] drm/i915: Simplify the uncleared FIFO underrun detection
On 16 May 2014 17:40, wrote: > From: Ville Syrjälä > > Checking whether the error interrupt was enabled or not isn't really > necessary when we check for uncleared FIFO underruns. If it was enabled > we'll race with the interrupt handler a bit, but that seems OK as we > still claim the interrupt. > > Signed-off-by: Ville Syrjälä checkpatch.pl complains that there are lines over 80 characters, but otherwise: Reviewed-by: Thomas Wood > --- > drivers/gpu/drm/i915/i915_irq.c | 13 ++--- > 1 file changed, 2 insertions(+), 11 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c > index 862964f..dd6e359 100644 > --- a/drivers/gpu/drm/i915/i915_irq.c > +++ b/drivers/gpu/drm/i915/i915_irq.c > @@ -337,13 +337,9 @@ static void ivybridge_set_fifo_underrun_reporting(struct > drm_device *dev, > > ironlake_enable_display_irq(dev_priv, DE_ERR_INT_IVB); > } else { > - bool was_enabled = !(I915_READ(DEIMR) & DE_ERR_INT_IVB); > - > - /* Change the state _after_ we've read out the current one. */ > ironlake_disable_display_irq(dev_priv, DE_ERR_INT_IVB); > > - if (!was_enabled && > - (I915_READ(GEN7_ERR_INT) & ERR_INT_FIFO_UNDERRUN(pipe))) { > + if (I915_READ(GEN7_ERR_INT) & ERR_INT_FIFO_UNDERRUN(pipe)) { > DRM_ERROR("uncleared fifo underrun on pipe %c\n", > pipe_name(pipe)); > } > @@ -421,14 +417,9 @@ static void cpt_set_fifo_underrun_reporting(struct > drm_device *dev, > > ibx_enable_display_interrupt(dev_priv, SDE_ERROR_CPT); > } else { > - uint32_t tmp = I915_READ(SERR_INT); > - bool was_enabled = !(I915_READ(SDEIMR) & SDE_ERROR_CPT); > - > - /* Change the state _after_ we've read out the current one. */ > ibx_disable_display_interrupt(dev_priv, SDE_ERROR_CPT); > > - if (!was_enabled && > - (tmp & SERR_INT_TRANS_FIFO_UNDERRUN(pch_transcoder))) { > + if (I915_READ(SERR_INT) & > SERR_INT_TRANS_FIFO_UNDERRUN(pch_transcoder)) { > DRM_ERROR("uncleared pch fifo underrun on pch > transcoder %c\n", > transcoder_name(pch_transcoder)); > } > -- > 1.8.5.5 > ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 2/5] drm/i915: Check for FIFO underruns at the end of modeset on gmch
On 16 May 2014 17:40, wrote: > From: Ville Syrjälä > > FIFO underruns don't generate interrupts on gmch platforms, so > if we want to know whether a modeset triggered FIFO underruns we > need to explicitly check for them. > > As a modeset on one pipe could cause underruns on other pipes, > check for underruns on all pipes. > > Signed-off-by: Ville Syrjälä Reviewed-by: Thomas Wood > --- > drivers/gpu/drm/i915/i915_irq.c | 28 > drivers/gpu/drm/i915/intel_display.c | 6 ++ > drivers/gpu/drm/i915/intel_drv.h | 1 + > 3 files changed, 35 insertions(+) > > diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c > index 8bb564b..fdce260 100644 > --- a/drivers/gpu/drm/i915/i915_irq.c > +++ b/drivers/gpu/drm/i915/i915_irq.c > @@ -266,6 +266,34 @@ static bool cpt_can_enable_serr_int(struct drm_device > *dev) > return true; > } > > +void i9xx_check_fifo_underruns(struct drm_device *dev) > +{ > + struct drm_i915_private *dev_priv = dev->dev_private; > + struct intel_crtc *crtc; > + unsigned long flags; > + > + spin_lock_irqsave(&dev_priv->irq_lock, flags); > + > + for_each_intel_crtc(dev, crtc) { > + u32 reg = PIPESTAT(crtc->pipe); > + u32 pipestat; > + > + if (crtc->cpu_fifo_underrun_disabled) > + continue; > + > + pipestat = I915_READ(reg) & 0x; > + if ((pipestat & PIPE_FIFO_UNDERRUN_STATUS) == 0) > + continue; > + > + I915_WRITE(reg, pipestat | PIPE_FIFO_UNDERRUN_STATUS); > + POSTING_READ(reg); > + > + DRM_ERROR("pipe %c underrun\n", pipe_name(crtc->pipe)); > + } > + > + spin_unlock_irqrestore(&dev_priv->irq_lock, flags); > +} > + > static void i9xx_set_fifo_underrun_reporting(struct drm_device *dev, > enum pipe pipe, bool enable) > { > diff --git a/drivers/gpu/drm/i915/intel_display.c > b/drivers/gpu/drm/i915/intel_display.c > index 0f8f9bc..1b5164c 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -4545,6 +4545,9 @@ static void valleyview_crtc_enable(struct drm_crtc > *crtc) > intel_crtc_enable_planes(crtc); > > drm_vblank_on(dev, pipe); > + > + /* Underruns don't raise interrupts, so check manually. */ > + i9xx_check_fifo_underruns(dev); > } > > static void i9xx_crtc_enable(struct drm_crtc *crtc) > @@ -4581,6 +4584,9 @@ static void i9xx_crtc_enable(struct drm_crtc *crtc) > intel_crtc_enable_planes(crtc); > > drm_vblank_on(dev, pipe); > + > + /* Underruns don't raise interrupts, so check manually. */ > + i9xx_check_fifo_underruns(dev); > } > > static void i9xx_pfit_disable(struct intel_crtc *crtc) > diff --git a/drivers/gpu/drm/i915/intel_drv.h > b/drivers/gpu/drm/i915/intel_drv.h > index 32a74e1..db0a74d 100644 > --- a/drivers/gpu/drm/i915/intel_drv.h > +++ b/drivers/gpu/drm/i915/intel_drv.h > @@ -671,6 +671,7 @@ void snb_disable_pm_irq(struct drm_i915_private > *dev_priv, uint32_t mask); > void intel_runtime_pm_disable_interrupts(struct drm_device *dev); > void intel_runtime_pm_restore_interrupts(struct drm_device *dev); > int intel_get_crtc_scanline(struct intel_crtc *crtc); > +void i9xx_check_fifo_underruns(struct drm_device *dev); > > > /* intel_crt.c */ > -- > 1.8.5.5 > ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 5/5] drm/i915: Shuffle fifo underrun disable/enable points for gmch platforms
On 16 May 2014 17:40, wrote: > From: Ville Syrjälä > > Gen2 reports FIFO underruns whenever no planes are enabled on the pipe. > So in order to avoid false positives we must enable the FIFO underrun > reporting only when at least one plane is enabled on the pipe. For > now just move the underrun reporting enable/disable points to the > other side of the plane enable/disable point. That doesn't cover cases > when we turn off all the planes for the pipe but leave the pipe running > on purpose, but it's better than the current situation. > > On gen4+ we can actually move the underrun reporting enable/disable to > the opposite ends of the crtc enable/disable hooks. I suppose in theory > we could leave the underrun reporting enabled all the time, except on > VLV where PIPESTAT stops working when the display power well is down. > If we ever get around to unifying the PIPESTAT irq handling for all > gmch platforms, we should still follow the VLV route for other platforms. > It would also micro-optimize the irq handler a bit since we could then > skip the PIPESTAT reads for all disabled pipes. > > Gen3 is still a mystery, but for now I'm going to assume it behaves > like gen4+. > > Signed-off-by: Ville Syrjälä This doesn't apply to drm-intel-nightly, but looks fine in principle: Reviewed-by: Thomas Wood > --- > drivers/gpu/drm/i915/intel_display.c | 30 +++--- > 1 file changed, 27 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_display.c > b/drivers/gpu/drm/i915/intel_display.c > index 1b5164c..7f61047 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -4514,6 +4514,8 @@ static void valleyview_crtc_enable(struct drm_crtc > *crtc) > > intel_crtc->active = true; > > + intel_set_cpu_fifo_underrun_reporting(dev, pipe, true); > + > for_each_encoder_on_crtc(dev, crtc, encoder) > if (encoder->pre_pll_enable) > encoder->pre_pll_enable(encoder); > @@ -4537,7 +4539,6 @@ static void valleyview_crtc_enable(struct drm_crtc > *crtc) > > intel_update_watermarks(crtc); > intel_enable_pipe(intel_crtc); > - intel_set_cpu_fifo_underrun_reporting(dev, pipe, true); > > for_each_encoder_on_crtc(dev, crtc, encoder) > encoder->enable(encoder); > @@ -4564,6 +4565,9 @@ static void i9xx_crtc_enable(struct drm_crtc *crtc) > > intel_crtc->active = true; > > + if (!IS_GEN2(dev)) > + intel_set_cpu_fifo_underrun_reporting(dev, pipe, true); > + > for_each_encoder_on_crtc(dev, crtc, encoder) > if (encoder->pre_enable) > encoder->pre_enable(encoder); > @@ -4576,13 +4580,22 @@ static void i9xx_crtc_enable(struct drm_crtc *crtc) > > intel_update_watermarks(crtc); > intel_enable_pipe(intel_crtc); > - intel_set_cpu_fifo_underrun_reporting(dev, pipe, true); > > for_each_encoder_on_crtc(dev, crtc, encoder) > encoder->enable(encoder); > > intel_crtc_enable_planes(crtc); > > + /* > +* Gen2 reports pipe underruns whenever all planes are disabled. > +* So don't enable underrun reporting before at least some planes > +* are enabled. > +* FIXME: Need to fix the logic to work when we turn off all planes > +* but leave the pipe running. > +*/ > + if (IS_GEN2(dev)) > + intel_set_cpu_fifo_underrun_reporting(dev, pipe, true); > + > drm_vblank_on(dev, pipe); > > /* Underruns don't raise interrupts, so check manually. */ > @@ -4615,12 +4628,20 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc) > if (!intel_crtc->active) > return; > > + /* > +* Gen2 reports pipe underruns whenever all planes are disabled. > +* So diasble underrun reporting before all the planes get disabled. > +* FIXME: Need to fix the logic to work when we turn off all planes > +* but leave the pipe running. > +*/ > + if (IS_GEN2(dev)) > + intel_set_cpu_fifo_underrun_reporting(dev, pipe, false); > + > intel_crtc_disable_planes(crtc); > > for_each_encoder_on_crtc(dev, crtc, encoder) > encoder->disable(encoder); > > - intel_set_cpu_fifo_underrun_reporting(dev, pipe, false); > intel_disable_pipe(dev_priv, pipe); > > i9xx_pfit_disable(intel_crtc); > @@ -4638,6 +4659,9 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc) &
[Intel-gfx] [PATCH 3/3] drm/debugfs: add an "edid_override" file per connector
Add a file to debugfs for each connector that allows the edid data to be overridden. Signed-off-by: Thomas Wood --- drivers/gpu/drm/drm_crtc.c | 4 +++ drivers/gpu/drm/drm_debugfs.c | 56 ++ drivers/gpu/drm/drm_probe_helper.c | 9 +- include/drm/drm_crtc.h | 1 + 4 files changed, 69 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 59a2784..8543eac 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -3701,6 +3701,10 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector, struct drm_device *dev = connector->dev; int ret, size; + /* ignore requests to set edid when overridden */ + if (connector->override_edid) + return 0; + if (connector->edid_blob_ptr) drm_property_destroy_blob(dev, connector->edid_blob_ptr); diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c index b57b614..2c666ba 100644 --- a/drivers/gpu/drm/drm_debugfs.c +++ b/drivers/gpu/drm/drm_debugfs.c @@ -35,6 +35,7 @@ #include #include #include +#include #if defined(CONFIG_DEBUG_FS) @@ -295,6 +296,55 @@ static ssize_t connector_write(struct file *file, const char __user *ubuf, return len; } +static int edid_show(struct seq_file *m, void *data) +{ + struct drm_connector *connector = m->private; + struct drm_property_blob *edid = connector->edid_blob_ptr; + + if (connector->override_edid && edid) + seq_write(m, edid->data, edid->length); + + return 0; +} + +static int edid_open(struct inode *inode, struct file *file) +{ + struct drm_connector *dev = inode->i_private; + + return single_open(file, edid_show, dev); +} + +static ssize_t edid_write(struct file *file, const char __user *ubuf, + size_t len, loff_t *offp) +{ + struct seq_file *m = file->private_data; + struct drm_connector *connector = m->private; + + if (len >= EDID_LENGTH) { + drm_mode_connector_update_edid_property(connector, + (struct edid *) ubuf); + connector->override_edid = true; + } else { + if (connector->override_edid) { + connector->override_edid = false; + drm_mode_connector_update_edid_property(connector, + NULL); + } + } + + return len; +} + +static const struct file_operations drm_edid_fops = { + .owner = THIS_MODULE, + .open = edid_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, + .write = edid_write +}; + + static const struct file_operations drm_connector_fops = { .owner = THIS_MODULE, .open = connector_open, @@ -325,6 +375,12 @@ int drm_debugfs_connector_add(struct drm_connector *connector) if (!ent) return -ENOMEM; + /* edid */ + ent = debugfs_create_file("edid_override", S_IRUGO, root, connector, + &drm_edid_fops); + if (!ent) + return -ENOMEM; + return 0; } diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c index 79f07f2..1f0dc77 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c @@ -130,7 +130,14 @@ static int drm_helper_probe_single_connector_modes_merge_bits(struct drm_connect count = drm_load_edid_firmware(connector); if (count == 0) #endif - count = (*connector_funcs->get_modes)(connector); + { + if (connector->override_edid) { + struct edid *edid = (struct edid *) connector->edid_blob_ptr->data; + + count = drm_add_edid_modes(connector, edid); + } else + count = (*connector_funcs->get_modes)(connector); + } if (count == 0 && connector->status == connector_status_connected) count = drm_add_modes_noedid(connector, 1024, 768); diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index f04f4b9..11fce43 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -513,6 +513,7 @@ struct drm_connector { /* forced on connector */ enum drm_connector_force force; + bool override_edid; uint32_t encoder_ids[DRM_CONNECTOR_MAX_ENCODER]; struct drm_encoder *encoder; /* currently active encoder */ -- 1.9.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH 2/3] drm/debugfs: add a "force" file per connector
Add a file to debugfs for each connector to enable modification of the "force" connector attribute. This allows connectors to be enabled or disabled for testing and debugging purposes. Signed-off-by: Thomas Wood --- drivers/gpu/drm/drm_crtc.c| 17 ++- drivers/gpu/drm/drm_debugfs.c | 101 ++ include/drm/drmP.h| 11 + include/drm/drm_crtc.h| 2 + 4 files changed, 130 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 998663c..59a2784 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -841,6 +841,8 @@ int drm_connector_init(struct drm_device *dev, drm_object_attach_property(&connector->base, dev->mode_config.dpms_property, 0); + connector->debugfs_entry = NULL; + out_put: if (ret) drm_mode_object_put(dev, &connector->base); @@ -891,7 +893,19 @@ EXPORT_SYMBOL(drm_connector_cleanup); */ int drm_connector_register(struct drm_connector *connector) { - return drm_sysfs_connector_add(connector); + int ret; + + ret = drm_sysfs_connector_add(connector); + if (ret != 0) + return ret; + + ret = drm_debugfs_connector_add(connector); + if (ret != 0) { + drm_sysfs_connector_remove(connector); + return ret; + } + + return 0; } EXPORT_SYMBOL(drm_connector_register); @@ -904,6 +918,7 @@ EXPORT_SYMBOL(drm_connector_register); void drm_connector_unregister(struct drm_connector *connector) { drm_sysfs_connector_remove(connector); + drm_debugfs_connector_remove(connector); } EXPORT_SYMBOL(drm_connector_unregister); diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c index b4b51d4..b57b614 100644 --- a/drivers/gpu/drm/drm_debugfs.c +++ b/drivers/gpu/drm/drm_debugfs.c @@ -237,5 +237,106 @@ int drm_debugfs_cleanup(struct drm_minor *minor) return 0; } +static int connector_show(struct seq_file *m, void *data) +{ + struct drm_connector *connector = m->private; + const char *status; + + switch (connector->force) { + case DRM_FORCE_ON: + status = "on\n"; + break; + + case DRM_FORCE_ON_DIGITAL: + status = "digital\n"; + break; + + case DRM_FORCE_OFF: + status = "off\n"; + break; + + case DRM_FORCE_UNSPECIFIED: + status = "unspecified\n"; + break; + + default: + return 0; + } + + seq_puts(m, status); + + return 0; +} + +static int connector_open(struct inode *inode, struct file *file) +{ + struct drm_connector *dev = inode->i_private; + + return single_open(file, connector_show, dev); +} + +static ssize_t connector_write(struct file *file, const char __user *ubuf, + size_t len, loff_t *offp) +{ + struct seq_file *m = file->private_data; + struct drm_connector *connector = m->private; + + if (strncmp(ubuf, "on", len) == 0) + connector->force = DRM_FORCE_ON; + else if (strncmp(ubuf, "digital", len) == 0) + connector->force = DRM_FORCE_ON_DIGITAL; + else if (strncmp(ubuf, "off", len) == 0) + connector->force = DRM_FORCE_OFF; + else if (strncmp(ubuf, "unspecified", len) == 0) + connector->force = DRM_FORCE_UNSPECIFIED; + else + return -EINVAL; + + return len; +} + +static const struct file_operations drm_connector_fops = { + .owner = THIS_MODULE, + .open = connector_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, + .write = connector_write +}; + +int drm_debugfs_connector_add(struct drm_connector *connector) +{ + struct drm_minor *minor = connector->dev->primary; + struct dentry *root, *ent; + + if (!minor->debugfs_root) + return -1; + + root = debugfs_create_dir(drm_get_connector_name(connector), + minor->debugfs_root); + if (!root) + return -ENOMEM; + + connector->debugfs_entry = root; + + /* force */ + ent = debugfs_create_file("force", S_IRUGO, root, connector, + &drm_connector_fops); + if (!ent) + return -ENOMEM; + + return 0; +} + +void drm_debugfs_connector_remove(struct drm_connector *connector) +{ + if (!connector->debugfs_entry) + return; + + debugfs_remove_recursive(connector->debugfs_entry); + + connector->debugfs_entry = NULL; +} + #endif /* CONFIG_DEBU
[Intel-gfx] [PATCH 0/3] connector debugfs properties
The following series adds support for exposing various connector features using debugfs. The first patch refactors the sysfs connector add and remove functions into generic functions to register and unregister connectors. The remaining patches add an interface for each connector to debugfs and expose the force connector attribute and allow the edid value to be overridden. Thomas Wood (3): drm: add register and unregister functions for connectors drm/debugfs: add a "force" file per connector drm/debugfs: add an "edid_override" file per connector Documentation/DocBook/drm.tmpl| 6 +- drivers/gpu/drm/armada/armada_output.c| 4 +- drivers/gpu/drm/ast/ast_mode.c| 4 +- drivers/gpu/drm/bridge/ptn3460.c | 2 +- drivers/gpu/drm/drm_crtc.c| 49 +++- drivers/gpu/drm/drm_debugfs.c | 157 ++ drivers/gpu/drm/drm_probe_helper.c| 9 +- drivers/gpu/drm/drm_sysfs.c | 2 - drivers/gpu/drm/exynos/exynos_dp_core.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_connector.c | 6 +- drivers/gpu/drm/exynos/exynos_drm_dpi.c | 4 +- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 2 +- drivers/gpu/drm/exynos/exynos_hdmi.c | 2 +- drivers/gpu/drm/gma500/cdv_intel_crt.c| 4 +- drivers/gpu/drm/gma500/cdv_intel_dp.c | 4 +- drivers/gpu/drm/gma500/cdv_intel_hdmi.c | 4 +- drivers/gpu/drm/gma500/cdv_intel_lvds.c | 4 +- drivers/gpu/drm/gma500/mdfld_dsi_output.c | 4 +- drivers/gpu/drm/gma500/oaktrail_hdmi.c| 2 +- drivers/gpu/drm/gma500/oaktrail_lvds.c| 2 +- drivers/gpu/drm/gma500/psb_intel_lvds.c | 4 +- drivers/gpu/drm/gma500/psb_intel_sdvo.c | 4 +- drivers/gpu/drm/i915/intel_crt.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 2 +- drivers/gpu/drm/i915/intel_dp.c | 4 +- drivers/gpu/drm/i915/intel_dsi.c | 2 +- drivers/gpu/drm/i915/intel_dvo.c | 2 +- drivers/gpu/drm/i915/intel_hdmi.c | 2 +- drivers/gpu/drm/i915/intel_lvds.c | 2 +- drivers/gpu/drm/i915/intel_sdvo.c | 10 +- drivers/gpu/drm/i915/intel_tv.c | 2 +- drivers/gpu/drm/mgag200/mgag200_mode.c| 2 +- drivers/gpu/drm/msm/hdmi/hdmi_connector.c | 4 +- drivers/gpu/drm/nouveau/nouveau_connector.c | 4 +- drivers/gpu/drm/omapdrm/omap_connector.c | 4 +- drivers/gpu/drm/qxl/qxl_display.c | 4 +- drivers/gpu/drm/radeon/radeon_connectors.c| 6 +- drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c | 4 +- drivers/gpu/drm/rcar-du/rcar_du_vgacon.c | 4 +- drivers/gpu/drm/shmobile/shmob_drm_crtc.c | 6 +- drivers/gpu/drm/tegra/output.c| 4 +- drivers/gpu/drm/tilcdc/tilcdc_panel.c | 2 +- drivers/gpu/drm/tilcdc/tilcdc_slave.c | 2 +- drivers/gpu/drm/tilcdc/tilcdc_tfp410.c| 2 +- drivers/gpu/drm/udl/udl_connector.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 2 +- drivers/staging/imx-drm/imx-drm-core.c| 6 +- include/drm/drmP.h| 11 ++ include/drm/drm_crtc.h| 5 + 52 files changed, 308 insertions(+), 83 deletions(-) -- 1.9.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH 1/3] drm: add register and unregister functions for connectors
Introduce generic functions to register and unregister connectors. This provides a common place to add and remove associated user space interfaces. Signed-off-by: Thomas Wood --- Documentation/DocBook/drm.tmpl| 6 +++--- drivers/gpu/drm/armada/armada_output.c| 4 ++-- drivers/gpu/drm/ast/ast_mode.c| 4 ++-- drivers/gpu/drm/bridge/ptn3460.c | 2 +- drivers/gpu/drm/drm_crtc.c| 30 ++- drivers/gpu/drm/drm_sysfs.c | 2 -- drivers/gpu/drm/exynos/exynos_dp_core.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_connector.c | 6 +++--- drivers/gpu/drm/exynos/exynos_drm_dpi.c | 4 ++-- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 2 +- drivers/gpu/drm/exynos/exynos_hdmi.c | 2 +- drivers/gpu/drm/gma500/cdv_intel_crt.c| 4 ++-- drivers/gpu/drm/gma500/cdv_intel_dp.c | 4 ++-- drivers/gpu/drm/gma500/cdv_intel_hdmi.c | 4 ++-- drivers/gpu/drm/gma500/cdv_intel_lvds.c | 4 ++-- drivers/gpu/drm/gma500/mdfld_dsi_output.c | 4 ++-- drivers/gpu/drm/gma500/oaktrail_hdmi.c| 2 +- drivers/gpu/drm/gma500/oaktrail_lvds.c| 2 +- drivers/gpu/drm/gma500/psb_intel_lvds.c | 4 ++-- drivers/gpu/drm/gma500/psb_intel_sdvo.c | 4 ++-- drivers/gpu/drm/i915/intel_crt.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 2 +- drivers/gpu/drm/i915/intel_dp.c | 4 ++-- drivers/gpu/drm/i915/intel_dsi.c | 2 +- drivers/gpu/drm/i915/intel_dvo.c | 2 +- drivers/gpu/drm/i915/intel_hdmi.c | 2 +- drivers/gpu/drm/i915/intel_lvds.c | 2 +- drivers/gpu/drm/i915/intel_sdvo.c | 10 - drivers/gpu/drm/i915/intel_tv.c | 2 +- drivers/gpu/drm/mgag200/mgag200_mode.c| 2 +- drivers/gpu/drm/msm/hdmi/hdmi_connector.c | 4 ++-- drivers/gpu/drm/nouveau/nouveau_connector.c | 4 ++-- drivers/gpu/drm/omapdrm/omap_connector.c | 4 ++-- drivers/gpu/drm/qxl/qxl_display.c | 4 ++-- drivers/gpu/drm/radeon/radeon_connectors.c| 6 +++--- drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c | 4 ++-- drivers/gpu/drm/rcar-du/rcar_du_vgacon.c | 4 ++-- drivers/gpu/drm/shmobile/shmob_drm_crtc.c | 6 +++--- drivers/gpu/drm/tegra/output.c| 4 ++-- drivers/gpu/drm/tilcdc/tilcdc_panel.c | 2 +- drivers/gpu/drm/tilcdc/tilcdc_slave.c | 2 +- drivers/gpu/drm/tilcdc/tilcdc_tfp410.c| 2 +- drivers/gpu/drm/udl/udl_connector.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 2 +- drivers/staging/imx-drm/imx-drm-core.c| 6 +++--- include/drm/drm_crtc.h| 2 ++ 49 files changed, 110 insertions(+), 82 deletions(-) diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl index 00f1c25..0f96b25 100644 --- a/Documentation/DocBook/drm.tmpl +++ b/Documentation/DocBook/drm.tmpl @@ -1574,7 +1574,7 @@ int max_width, max_height; The connector is then registered with a call to drm_connector_init with a pointer to the connector functions and a connector type, and exposed through sysfs with a call to - drm_sysfs_connector_add. + drm_connector_register. Supported connector types are @@ -1732,7 +1732,7 @@ int max_width, max_height; (drm_encoder_cleanup) and connectors (drm_connector_cleanup). Furthermore, connectors that have been added to sysfs must be removed by a call to - drm_sysfs_connector_remove before calling + drm_connector_unregister before calling drm_connector_cleanup. @@ -1777,7 +1777,7 @@ void intel_crt_init(struct drm_device *dev) drm_encoder_helper_add(&intel_output->enc, &intel_crt_helper_funcs); drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs); - drm_sysfs_connector_add(connector); + drm_connector_register(connector); }]]> In the example above (taken from the i915 driver), a CRTC, connector and diff --git a/drivers/gpu/drm/armada/armada_output.c b/drivers/gpu/drm/armada/armada_output.c index d685a54..abbc309 100644 --- a/drivers/gpu/drm/armada/armada_output.c +++ b/drivers/gpu/drm/armada/armada_output.c @@ -48,7 +48,7 @@ static void armada_drm_connector_destroy(struct drm_connector *conn) { struct armada_connector *dconn = drm_to_armada_conn(conn); - drm_sysfs_connector_remove(conn); + drm_connector_unregister(conn); drm_connector_cleanup(conn); kfree(dconn); } @@ -141,7 +141,7 @@ int armada_output_create(struct drm_device *dev, if (ret)
[Intel-gfx] [i-g-t 2/2] quick_dump: read the architecture files for items to add to EXTRA_DIST
Each architecture file contains a list of the text files it requires, so use this to add to the list of files to distribute. Signed-off-by: Thomas Wood --- configure.ac | 6 ++ tools/quick_dump/Makefile.am | 9 + 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index cb130a9..9c52188 100644 --- a/configure.ac +++ b/configure.ac @@ -203,6 +203,12 @@ fi AM_CONDITIONAL(BUILD_TESTS, [test "x$BUILD_TESTS" = xyes]) AC_DEFINE_UNQUOTED(TARGET_CPU_PLATFORM, ["$host_cpu"], [Target platform]) +files="broadwell cherryview haswell ivybridge sandybridge valleyview" +for file in $files; do + QUICK_DUMP_EXTRA_DIST+="$file `tr '\n' ' ' < tools/quick_dump/$file`" +done +AC_SUBST(QUICK_DUMP_EXTRA_DIST) + AC_CONFIG_FILES([ Makefile benchmarks/Makefile diff --git a/tools/quick_dump/Makefile.am b/tools/quick_dump/Makefile.am index a7b2a16..2d1685b 100644 --- a/tools/quick_dump/Makefile.am +++ b/tools/quick_dump/Makefile.am @@ -23,15 +23,8 @@ all-local: I915ChipsetPython.la $(LN_S) -f .libs/I915ChipsetPython.so _chipset.so CLEANFILES = chipset_wrap_python.c chipset.py _chipset.so -EXTRA_DIST = \ +EXTRA_DIST = $(QUICK_DUMP_EXTRA_DIST) \ base_display.txt base_interrupt.txt base_other.txt base_power.txt base_rings.txt \ - gen6_other.txt sandybridge \ - gen7_other.txt ivybridge \ - vlv_pipe_a.txt vlv_pipe_b.txt \ - vlv_display_base.txt vlv_dpio_phy.txt \ - vlv_dsi.txt vlv_flisdsi.txt \ - valleyview \ - gen8_interrupt.txt \ quick_dump.py \ reg_access.py \ chipset.i chipset.py -- 1.9.3 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [i-g-t 1/2] tools: fix distcheck
Fix include paths and references to missing files. Signed-off-by: Thomas Wood --- tools/null_state_gen/Makefile.am | 3 +++ tools/null_state_gen/intel_renderstate_gen6.c | 4 ++-- tools/null_state_gen/intel_renderstate_gen7.c | 4 ++-- tools/null_state_gen/intel_renderstate_gen8.c | 4 ++-- tools/quick_dump/Makefile.am | 5 - 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/tools/null_state_gen/Makefile.am b/tools/null_state_gen/Makefile.am index 62b8ff7..c0103a0 100644 --- a/tools/null_state_gen/Makefile.am +++ b/tools/null_state_gen/Makefile.am @@ -1,7 +1,10 @@ noinst_PROGRAMS = intel_null_state_gen +AM_CFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib + intel_null_state_gen_SOURCES = \ intel_batchbuffer.c \ + intel_batchbuffer.h \ intel_renderstate_gen6.c \ intel_renderstate_gen7.c \ intel_renderstate_gen8.c \ diff --git a/tools/null_state_gen/intel_renderstate_gen6.c b/tools/null_state_gen/intel_renderstate_gen6.c index f169d02..dc255cf 100644 --- a/tools/null_state_gen/intel_renderstate_gen6.c +++ b/tools/null_state_gen/intel_renderstate_gen6.c @@ -1,6 +1,6 @@ #include "intel_batchbuffer.h" -#include -#include +#include "gen6_render.h" +#include "intel_reg.h" #include static const uint32_t ps_kernel_nomask_affine[][4] = { diff --git a/tools/null_state_gen/intel_renderstate_gen7.c b/tools/null_state_gen/intel_renderstate_gen7.c index 8fe8a80..4f955c3 100644 --- a/tools/null_state_gen/intel_renderstate_gen7.c +++ b/tools/null_state_gen/intel_renderstate_gen7.c @@ -23,8 +23,8 @@ #include "intel_batchbuffer.h" -#include -#include +#include "gen7_render.h" +#include "intel_reg.h" #include static const uint32_t ps_kernel[][4] = { diff --git a/tools/null_state_gen/intel_renderstate_gen8.c b/tools/null_state_gen/intel_renderstate_gen8.c index 437454e..b922c73 100644 --- a/tools/null_state_gen/intel_renderstate_gen8.c +++ b/tools/null_state_gen/intel_renderstate_gen8.c @@ -1,6 +1,6 @@ #include "intel_batchbuffer.h" -#include -#include +#include "gen8_render.h" +#include "intel_reg.h" #include struct { diff --git a/tools/quick_dump/Makefile.am b/tools/quick_dump/Makefile.am index 468dd45..a7b2a16 100644 --- a/tools/quick_dump/Makefile.am +++ b/tools/quick_dump/Makefile.am @@ -27,7 +27,10 @@ EXTRA_DIST = \ base_display.txt base_interrupt.txt base_other.txt base_power.txt base_rings.txt \ gen6_other.txt sandybridge \ gen7_other.txt ivybridge \ - vlv_display.txt vlv_dpio.txt valleyview \ + vlv_pipe_a.txt vlv_pipe_b.txt \ + vlv_display_base.txt vlv_dpio_phy.txt \ + vlv_dsi.txt vlv_flisdsi.txt \ + valleyview \ gen8_interrupt.txt \ quick_dump.py \ reg_access.py \ -- 1.9.3 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [i-g-t 2/7] lib: remove /** from comments that are not API documentation
These comments are not gtk-doc comments, so replacing /** with /* prevents any gtk-doc warnings. Signed-off-by: Thomas Wood --- lib/i915_3d.h | 26 ++-- lib/intel_reg.h | 404 +- lib/rendercopy_gen8.c | 6 +- 3 files changed, 218 insertions(+), 218 deletions(-) diff --git a/lib/i915_3d.h b/lib/i915_3d.h index 04531f3..eea379c 100644 --- a/lib/i915_3d.h +++ b/lib/i915_3d.h @@ -324,7 +324,7 @@ enum i915_fs_channel { (z##_CHANNEL_VAL << Z_CHANNEL_SHIFT) | \ (w##_CHANNEL_VAL << W_CHANNEL_SHIFT) -/** +/* * Construct an operand description for using a register with no swizzling */ #define i915_fs_operand_reg(reg) \ @@ -333,17 +333,17 @@ enum i915_fs_channel { #define i915_fs_operand_reg_negate(reg) \ i915_fs_operand(reg, NEG_X, NEG_Y, NEG_Z, NEG_W) -/** +/* * Returns an operand containing (0.0, 0.0, 0.0, 0.0). */ #define i915_fs_operand_zero() i915_fs_operand(FS_R0, ZERO, ZERO, ZERO, ZERO) -/** +/* * Returns an unused operand */ #define i915_fs_operand_none() i915_fs_operand_zero() -/** +/* * Returns an operand containing (1.0, 1.0, 1.0, 1.0). */ #define i915_fs_operand_one() i915_fs_operand(FS_R0, ONE, ONE, ONE, ONE) @@ -351,7 +351,7 @@ enum i915_fs_channel { #define i915_get_hardware_channel_val(val, shift, negate) \ (((val & 0x7) << shift) | ((val & 0x8) ? negate : 0)) -/** +/* * Outputs a fragment shader command to declare a sampler or texture register. */ #define i915_fs_dcl(reg) \ @@ -519,19 +519,19 @@ enum i915_fs_channel { i915_fs_operand_none(), \ i915_fs_operand_none()) -/** Add operand0 and operand1 and put the result in dest_reg */ +/* Add operand0 and operand1 and put the result in dest_reg */ #define i915_fs_add(dest_reg, operand0, operand1) \ i915_fs_arith (ADD, dest_reg, \ operand0, operand1, \ i915_fs_operand_none()) -/** Multiply operand0 and operand1 and put the result in dest_reg */ +/* Multiply operand0 and operand1 and put the result in dest_reg */ #define i915_fs_mul(dest_reg, operand0, operand1) \ i915_fs_arith (MUL, dest_reg, \ operand0, operand1, \ i915_fs_operand_none()) -/** Computes 1/sqrt(operand0.replicate_swizzle) puts the result in dest_reg */ +/* Computes 1/sqrt(operand0.replicate_swizzle) puts the result in dest_reg */ #define i915_fs_rsq(dest_reg, dest_mask, operand0) \ do { \ if (dest_mask) { \ @@ -547,13 +547,13 @@ enum i915_fs_channel { } \ } while (0) -/** Puts the minimum of operand0 and operand1 in dest_reg */ +/* Puts the minimum of operand0 and operand1 in dest_reg */ #define i915_fs_min(dest_reg, operand0, operand1) \ i915_fs_arith (MIN, dest_reg, \ operand0, operand1, \ i915_fs_operand_none()) -/** Puts the maximum of operand0 and operand1 in dest_reg */ +/* Puts the maximum of operand0 and operand1 in dest_reg */ #define i915_fs_max(dest_reg, operand0, operand1) \ i915_fs_arith (MAX, dest_reg, \ operand0, operand1, \ @@ -562,7 +562,7 @@ enum i915_fs_channel { #define i915_fs_cmp(dest_reg, operand0, operand1, operand2)\ i915_fs_arith (CMP, dest_reg, operand0, operand1, operand2) -/** Perform operand0 * operand1 + operand2 and put the result in dest_reg */ +/* Perform operand0 * operand1 + operand2 and put the result in dest_reg */ #define i915_fs_mad(dest_reg, dest_mask, op0, op1, op2)\ do { \ if (dest_mask) { \ @@ -581,7 +581,7 @@ enum i915_fs_channel { } \ } while (0) -/** +/* * Perform a 3-component dot-product of operand0 and operand1 and put the * resulting scalar in the channels of dest_reg specified by the dest_mask. */ @@ -597,7 +597,7 @@ enum i915_fs_channel { } \ } while (0) -/** +/* * Sets up local state for accumulating a fragment shader buffer. * * \param x maximum number of shader commands that may be used between diff --git a/lib/intel_reg.h b/lib/intel_reg.h index 84e05e4..f8ad71f 100644 --- a/lib/intel_reg.h +++ b/lib/intel_reg.h @@ -26,7 +26,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **/ -/** @file +/* @f
[Intel-gfx] [i-g-t 3/7] README: update the section on modifying and rebuilding documentation
Signed-off-by: Thomas Wood --- README | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/README b/README index cfa186d..5e98565 100644 --- a/README +++ b/README @@ -108,16 +108,14 @@ docs/ reference documenation in docs/reference/ You need to have the gtk doc tools installed to generate this API documentation. - Note that the currrent gtk-docs integration sucks a bit wrt regenerating - the html files. You need at least + To regenerate the html files when updating documentation, use: $ make clean -C docs && make -C docs - to regenerate them on any change. If you've added/changed/removed a - symbol or anything else that changes the overall structure or indexes, - you need a full rebuild: - - $ git clean -dfx && ./autogen.sh --enable-gtk-doc && make -C docs + If you've added/changed/removed a symbol or anything else that changes + the overall structure or indexes, this needs to be reflected in + intel-gpu-tools-sections.txt. Entirely new sections will also need to be + added to intel-gpu-tools-docs.xml in the appropriate place. DEPENDENCIES This is a non-exchaustive list of package dependencies required for -- 1.9.3 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [i-g-t 5/7] gitignore: add missing files and keep lists sorted
Signed-off-by: Thomas Wood --- tests/.gitignore| 11 +++ tools/null_state_gen/.gitignore | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 tools/null_state_gen/.gitignore diff --git a/tests/.gitignore b/tests/.gitignore index d7ad054..a61d025 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -1,6 +1,6 @@ # Please keep sorted alphabetically -core_getclient core_get_client_auth +core_getclient core_getstats core_getversion ddi_compute_wrpll @@ -41,8 +41,8 @@ gem_exec_nop gem_exec_params gem_exec_parse gem_fd_exhaustion -gem_fenced_exec_thrash gem_fence_thrash +gem_fenced_exec_thrash gem_flink gem_flink_race gem_gtt_cpu_tlb @@ -77,9 +77,9 @@ gem_render_copy_redux gem_render_linear_blits gem_render_tiled_blits gem_reset_stats -gem_ringfill gem_ring_sync_copy gem_ring_sync_loop +gem_ringfill gem_seqno_wrap gem_set_tiling_vs_blt gem_set_tiling_vs_gtt @@ -118,17 +118,20 @@ igt_simulation kms_addfb kms_cursor_crc kms_fbc_crc +kms_fence_pin_leak kms_flip kms_flip_tiling +kms_mmio_vs_cs_flip kms_pipe_crc_basic kms_plane kms_render kms_setmode +kms_sink_crc_basic multi-tests.txt pm_lpsp -pm_rpm pm_psr pm_rc6_residency +pm_rpm pm_rps prime_nv_api prime_nv_pcopy diff --git a/tools/null_state_gen/.gitignore b/tools/null_state_gen/.gitignore new file mode 100644 index 000..170bcef --- /dev/null +++ b/tools/null_state_gen/.gitignore @@ -0,0 +1 @@ +intel_null_state_gen -- 1.9.3 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [i-g-t 6/7] lib: various documentation fixes
Fix some documentation comments and mark some struct members private. Signed-off-by: Thomas Wood --- lib/igt_aux.c | 5 ++--- lib/igt_core.c | 10 +- lib/igt_kms.h | 2 ++ lib/intel_batchbuffer.h | 5 + 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/lib/igt_aux.c b/lib/igt_aux.c index c0088d5..7b277be 100644 --- a/lib/igt_aux.c +++ b/lib/igt_aux.c @@ -430,10 +430,9 @@ bool igt_setup_runtime_pm(void) } /** - * igt_runtime_pm_status: + * igt_get_runtime_pm_status: * - * Returns: - * The current runtime PM status. + * Returns: The current runtime PM status. */ enum igt_runtime_pm_status igt_get_runtime_pm_status(void) { diff --git a/lib/igt_core.c b/lib/igt_core.c index 56eacf2..7ac7ebe 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -1031,11 +1031,11 @@ static void fatal_sig_handler(int sig) * @fn: exit handler function * * Set a handler that will be called either when the process calls exit() or - * returns from the main function, or one of the signals in 'handled_signals' - * is raised. MAX_EXIT_HANDLERS handlers can be installed, each of which will - * be called only once, even if a subsequent signal is raised. If the exit - * handlers are called due to a signal, the signal will be re-raised with the - * original signal disposition after all handlers returned. + * returns from the main function, or one of the signals in + * 'handled_signals' is raised. MAX_EXIT_HANDLERS handlers can be installed, + * each of which will be called only once, even if a subsequent signal is + * raised. If the exit handlers are called due to a signal, the signal will be + * re-raised with the original signal disposition after all handlers returned. * * The handler will be passed the signal number if called due to a signal, or * 0 otherwise. Exit handlers can also be used from test children spawned with diff --git a/lib/igt_kms.h b/lib/igt_kms.h index 8e80d4b..17bf0a2 100644 --- a/lib/igt_kms.h +++ b/lib/igt_kms.h @@ -99,6 +99,7 @@ typedef struct igt_pipe igt_pipe_t; typedef uint32_t igt_fixed_t; /* 16.16 fixed point */ typedef struct { + /*< private >*/ igt_pipe_t *pipe; int index; unsigned int is_primary : 1; @@ -127,6 +128,7 @@ struct igt_pipe { }; typedef struct { + /*< private >*/ igt_display_t *display; uint32_t id;/* KMS id */ struct kmstest_connector_config config; diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h index 49dbcf0..3715161 100644 --- a/lib/intel_batchbuffer.h +++ b/lib/intel_batchbuffer.h @@ -204,14 +204,10 @@ void intel_copy_bo(struct intel_batchbuffer *batch, * @tiling: tiling mode bits * @data: pointer to the memory mapping of the buffer * @size: size of the buffer object - * @num_tiles: number of tiles of the buffer object * * This is a i-g-t buffer object wrapper structure which augments the baseline * libdrm buffer object with suitable data needed by the render copy and the * media fill functions. - * - * Note that @num_tiles is only used by gem_stress.c internally and can be - * ignored. */ struct igt_buf { drm_intel_bo *bo; @@ -219,6 +215,7 @@ struct igt_buf { uint32_t tiling; uint32_t *data; uint32_t size; +/*< private >*/ unsigned num_tiles; }; -- 1.9.3 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [i-g-t 1/7] README: update piglit instructions
Piglit now has a top level "piglit" command and the location of the tests can now be read from an environment variable. Signed-off-by: Thomas Wood --- README | 27 ++- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/README b/README index 2cfb5c5..cfa186d 100644 --- a/README +++ b/README @@ -34,32 +34,25 @@ tests/ git://anongit.freedesktop.org/piglit - and build it (no need to install anything). Then we need to link up the - i-g-t sources with piglit + There is no need to build and install piglit if it is only going to be + used for running i-g-t tests. + + Set the IGT_TEST_ROOT environment variable to point to the tests + directory or link up the i-g-t sources with piglit using a symlink: piglit-sources $ cd bin piglit-sources/bin $ ln $i-g-t-sources igt -s - To avoid some hassles with piglit's use of Waffle just disable it. Run - - piglit-sources $ cmake -D PIGLIT_USE_WAFFLE=OFF . - - With - - piglit-sources $ ccmake . - - you can check your configuration with a curses interface, too. - - The tests in the i-g-t sources need to have been built already. Then we - can run the testcases with (as usual as root, no other drm clients - running): + In both cases, the tests in the i-g-t sources need to have been built + already. Then we can run the testcases with (as usual as root, no other + drm clients running): - piglit-sources # ./piglit-run.py igt + piglit-sources # ./piglit run igt The testlist is built at runtime, so no need to update anything in piglit when adding new tests. See - piglit-sources $ ./piglit-run.py -h + piglit-sources $ ./piglit run -h for some useful options. -- 1.9.3 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [i-g-t 7/7] docs: add missing sections to intel-gpu-tools-docs.xml
Signed-off-by: Thomas Wood --- docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml | 4 1 file changed, 4 insertions(+) diff --git a/docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml b/docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml index dcfff33..96cf77f 100644 --- a/docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml +++ b/docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml @@ -15,6 +15,7 @@ Intel GPU Tools + @@ -22,9 +23,12 @@ + + + -- 1.9.3 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [i-g-t 4/7] docs: add the sections file
This file can contain custom changes to the control the documentation output and therefore should be included in the repository. Signed-off-by: Thomas Wood --- docs/reference/intel-gpu-tools/.gitignore | 1 - .../intel-gpu-tools/intel-gpu-tools-sections.txt | 378 + 2 files changed, 378 insertions(+), 1 deletion(-) create mode 100644 docs/reference/intel-gpu-tools/intel-gpu-tools-sections.txt diff --git a/docs/reference/intel-gpu-tools/.gitignore b/docs/reference/intel-gpu-tools/.gitignore index 9415974..9fadbfc 100644 --- a/docs/reference/intel-gpu-tools/.gitignore +++ b/docs/reference/intel-gpu-tools/.gitignore @@ -6,7 +6,6 @@ /intel-gpu-tools-decl-list.txt /intel-gpu-tools-decl.txt /intel-gpu-tools-overrides.txt -/intel-gpu-tools-sections.txt /intel-gpu-tools-undeclared.txt /intel-gpu-tools-undocumented.txt /intel-gpu-tools-unused.txt diff --git a/docs/reference/intel-gpu-tools/intel-gpu-tools-sections.txt b/docs/reference/intel-gpu-tools/intel-gpu-tools-sections.txt new file mode 100644 index 000..de6c76c --- /dev/null +++ b/docs/reference/intel-gpu-tools/intel-gpu-tools-sections.txt @@ -0,0 +1,378 @@ + +debug +DEBUG_PROTOCOL_VERSION +COMMUNICATION_OFFSET +COMMUNICATION_QWORD +STATE_EU_MSG +STATE_CPU_ACK +STATE_OFFSET +STATE_QWORD +TX_OFFSET +TX_QWORD +RX_OFFSET +RX_QWORD +grf +mrf +cr +sr +DWORD8 + + + +drmtest +mmap64 +ARRAY_SIZE +ALIGN +drm_get_card +drm_open_any +drm_open_any_render +gem_quiescent_gpu +do_or_die +do_ioctl + + + +igt_aux +igt_fork_signal_helper +igt_stop_signal_helper +igt_exchange_int +igt_permute_array +igt_progress +igt_check_boolean_env_var +igt_aub_dump_enabled +igt_init_aperture_trashers +igt_trash_aperture +igt_cleanup_aperture_trashers +igt_system_suspend_autoresume +igt_drop_root +igt_wait_for_keypress +igt_runtime_pm_status +igt_setup_runtime_pm +igt_get_runtime_pm_status +igt_wait_for_pm_status +intel_purge_vm_caches +intel_get_avail_ram_mb +intel_get_total_ram_mb +intel_get_total_swap_mb +intel_check_memory +CHECK_RAM +CHECK_SWAP + + + +igt_core +IGT_EXIT_TIMEOUT +IGT_EXIT_SKIP +IGT_EXIT_SUCCESS +igt_fixture +igt_subtest_init +igt_opt_handler_t +igt_subtest_init_parse_opts +igt_tokencat +igt_subtest +igt_subtest_f +igt_subtest_name +igt_only_list_subtests +igt_main +igt_simple_init +igt_simple_main +igt_skip +igt_success +igt_fail +igt_exit +igt_assert +igt_assert_f +igt_assert_cmpint +igt_require +igt_skip_on +igt_require_f +igt_skip_on_f +igt_fork +igt_waitchildren +igt_helper_process +igt_fork_helper +igt_wait_helper +igt_stop_helper +igt_exit_handler_t +igt_install_exit_handler +igt_enable_exit_handler +igt_disable_exit_handler +igt_run_in_simulation +SLOW_QUICK +igt_skip_on_simulation +igt_log_level +igt_log +igt_vlog +igt_debug +igt_info +igt_warn +igt_warn_on +igt_warn_on_f +igt_set_timeout + + + +igt_debugfs +igt_debugfs_open +igt_debugfs_fopen +igt_pipe_crc_t +igt_crc_t +intel_pipe_crc_source +igt_crc_is_null +igt_crc_equal +igt_crc_to_string +igt_require_pipe_crc +igt_pipe_crc_new +igt_pipe_crc_free +igt_pipe_crc_start +igt_pipe_crc_stop +igt_pipe_crc_get_crcs +igt_pipe_crc_collect_crc +DROP_UNBOUND +DROP_BOUND +DROP_RETIRE +DROP_ACTIVE +DROP_ALL +igt_drop_caches_set +igt_disable_prefault +igt_enable_prefault +igt_open_forcewake_handle +stop_ring_flags +igt_to_stop_ring_flag +igt_set_stop_rings +igt_get_stop_rings + + + +igt_fb +cairo_surface_t +cairo_t +igt_fb +igt_text_align +igt_create_fb_with_bo_size +igt_create_fb +igt_create_color_fb +igt_remove_fb +igt_get_cairo_ctx +igt_paint_color +igt_paint_color_alpha +igt_paint_color_gradient +igt_paint_test_pattern +igt_paint_image +igt_write_fb_to_png +igt_cairo_printf_line +igt_bpp_depth_to_drm_format +igt_drm_format_to_bpp +igt_format_str +igt_get_all_formats + + + +igt_kms +pipe +pipe_name +igt_plane +plane_name +sprite_name +port +port_name +kmstest_connector_config +kmstest_get_connector_default_mode +kmstest_get_connector_config +kmstest_free_connector_config +kmstest_dump_mode +kmstest_get_pipe_from_crtc_id +kmstest_pipe_str +kmstest_encoder_type_str +kmstest_connector_status_str +kmstest_connector_type_str +kmstest_set_connector_dpms +igt_display_t +igt_pipe_t +igt_fixed_t +igt_plane_t +igt_pipe +igt_output_t +igt_display +igt_set_vt_graphics_mode +igt_display_init +igt_display_fini +igt_display_commit +igt_display_get_n_pipes +igt_output_name +igt_output_get_mode +igt_output_set_pipe +igt_output_get_plane +igt_plane_set_fb +igt_plane_set_position +igt_wait_for_vblank +for_each_connected_output +PIPE_ANY +IGT_FIXED + + + +instdone +MAX_INSTDONE_BITS +instdone_bit +num_instdone_bits +init_instdone_definitions + + + +intel_batchbuffer +BATCH_SZ +BATCH_RESERVED +intel_batchbuffer +intel_batchbuffer_alloc +intel_batchbuffer_free +intel_batchbuffer_flush +intel_batchbuffer_flush_on_ring +intel_batchbuffer_flush_with_context +intel_batchbuffer_reset +intel_batchbuffer_data +intel_batchbuffer_emit_reloc +intel_batchbuffer_space +intel_batchbuffer_emit_dword
Re: [Intel-gfx] [i-g-t 1/7] README: update piglit instructions
On 10 June 2014 15:37, Daniel Vetter wrote: > On Tue, Jun 10, 2014 at 03:30:51PM +0100, Thomas Wood wrote: >> Piglit now has a top level "piglit" command and the location of the >> tests can now be read from an environment variable. >> >> Signed-off-by: Thomas Wood >> --- >> README | 27 ++- >> 1 file changed, 10 insertions(+), 17 deletions(-) >> >> diff --git a/README b/README >> index 2cfb5c5..cfa186d 100644 >> --- a/README >> +++ b/README >> @@ -34,32 +34,25 @@ tests/ >> >> git://anongit.freedesktop.org/piglit >> >> - and build it (no need to install anything). Then we need to link up the >> - i-g-t sources with piglit >> + There is no need to build and install piglit if it is only going to be >> + used for running i-g-t tests. >> + >> + Set the IGT_TEST_ROOT environment variable to point to the tests >> + directory or link up the i-g-t sources with piglit using a symlink: >> >> piglit-sources $ cd bin >> piglit-sources/bin $ ln $i-g-t-sources igt -s >> >> - To avoid some hassles with piglit's use of Waffle just disable it. Run >> - >> - piglit-sources $ cmake -D PIGLIT_USE_WAFFLE=OFF . >> - >> - With >> - >> - piglit-sources $ ccmake . >> - >> - you can check your configuration with a curses interface, too. > > Hm, why did you drop this? I run into "lack of waffle" every time I try to > use piglit ... Otherwise looks good. Since there's no need to actually build the Piglit test cases when running intel-gpu-tools tests, there's no requirement for waffle either. > -Daniel > >> - >> - The tests in the i-g-t sources need to have been built already. Then we >> - can run the testcases with (as usual as root, no other drm clients >> - running): >> + In both cases, the tests in the i-g-t sources need to have been built >> + already. Then we can run the testcases with (as usual as root, no other >> + drm clients running): >> >> - piglit-sources # ./piglit-run.py igt >> + piglit-sources # ./piglit run igt >> >> The testlist is built at runtime, so no need to update anything in >> piglit when adding new tests. See >> >> - piglit-sources $ ./piglit-run.py -h >> + piglit-sources $ ./piglit run -h >> >> for some useful options. >> >> -- >> 1.9.3 >> >> ___ >> Intel-gfx mailing list >> Intel-gfx@lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/intel-gfx > > -- > Daniel Vetter > Software Engineer, Intel Corporation > +41 (0) 79 365 57 48 - http://blog.ffwll.ch ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [i-g-t 3/7] README: update the section on modifying and rebuilding documentation
On 10 June 2014 15:38, Daniel Vetter wrote: > On Tue, Jun 10, 2014 at 03:30:53PM +0100, Thomas Wood wrote: >> Signed-off-by: Thomas Wood >> --- >> README | 12 +--- >> 1 file changed, 5 insertions(+), 7 deletions(-) >> >> diff --git a/README b/README >> index cfa186d..5e98565 100644 >> --- a/README >> +++ b/README >> @@ -108,16 +108,14 @@ docs/ >> reference documenation in docs/reference/ You need to have the gtk doc >> tools installed to generate this API documentation. >> >> - Note that the currrent gtk-docs integration sucks a bit wrt >> regenerating >> - the html files. You need at least >> + To regenerate the html files when updating documentation, use: >> >> $ make clean -C docs && make -C docs >> >> - to regenerate them on any change. If you've added/changed/removed a >> - symbol or anything else that changes the overall structure or indexes, >> - you need a full rebuild: >> - >> - $ git clean -dfx && ./autogen.sh --enable-gtk-doc && make -C docs > > This is still requried afaik when you add new .c/.h files with api docs in > them. > -Daniel Running make clean && make is enough for symbols to be added or removed, even in new source files. The sections file will still need to be updated to reflect the changes (e.g. new sections added when new files are added). > >> + If you've added/changed/removed a symbol or anything else that changes >> + the overall structure or indexes, this needs to be reflected in >> + intel-gpu-tools-sections.txt. Entirely new sections will also need to >> be >> + added to intel-gpu-tools-docs.xml in the appropriate place. >> >> DEPENDENCIES >> This is a non-exchaustive list of package dependencies required for >> -- >> 1.9.3 >> >> ___ >> Intel-gfx mailing list >> Intel-gfx@lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/intel-gfx > > -- > Daniel Vetter > Software Engineer, Intel Corporation > +41 (0) 79 365 57 48 - http://blog.ffwll.ch ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [i-g-t 4/7] docs: add the sections file
On 10 June 2014 15:40, Daniel Vetter wrote: > On Tue, Jun 10, 2014 at 03:30:54PM +0100, Thomas Wood wrote: >> This file can contain custom changes to the control the documentation >> output and therefore should be included in the repository. >> >> Signed-off-by: Thomas Wood > > Doesn't that mean we need to update this when adding new symbols? Imo > forcing autogeneration is better since you can control the order also by > moving functions around in the .h files. Or what exactly is this for? > -Daniel There are further annotations that can be made in this file, which is why gtk-doc does not automatically overwrite it when symbols and sections are added or removed: https://developer.gnome.org/gtk-doc-manual/stable/metafiles_sections.html.en > >> --- >> docs/reference/intel-gpu-tools/.gitignore | 1 - >> .../intel-gpu-tools/intel-gpu-tools-sections.txt | 378 >> + >> 2 files changed, 378 insertions(+), 1 deletion(-) >> create mode 100644 >> docs/reference/intel-gpu-tools/intel-gpu-tools-sections.txt >> >> diff --git a/docs/reference/intel-gpu-tools/.gitignore >> b/docs/reference/intel-gpu-tools/.gitignore >> index 9415974..9fadbfc 100644 >> --- a/docs/reference/intel-gpu-tools/.gitignore >> +++ b/docs/reference/intel-gpu-tools/.gitignore >> @@ -6,7 +6,6 @@ >> /intel-gpu-tools-decl-list.txt >> /intel-gpu-tools-decl.txt >> /intel-gpu-tools-overrides.txt >> -/intel-gpu-tools-sections.txt >> /intel-gpu-tools-undeclared.txt >> /intel-gpu-tools-undocumented.txt >> /intel-gpu-tools-unused.txt >> diff --git a/docs/reference/intel-gpu-tools/intel-gpu-tools-sections.txt >> b/docs/reference/intel-gpu-tools/intel-gpu-tools-sections.txt >> new file mode 100644 >> index 000..de6c76c >> --- /dev/null >> +++ b/docs/reference/intel-gpu-tools/intel-gpu-tools-sections.txt >> @@ -0,0 +1,378 @@ >> + >> +debug >> +DEBUG_PROTOCOL_VERSION >> +COMMUNICATION_OFFSET >> +COMMUNICATION_QWORD >> +STATE_EU_MSG >> +STATE_CPU_ACK >> +STATE_OFFSET >> +STATE_QWORD >> +TX_OFFSET >> +TX_QWORD >> +RX_OFFSET >> +RX_QWORD >> +grf >> +mrf >> +cr >> +sr >> +DWORD8 >> + >> + >> + >> +drmtest >> +mmap64 >> +ARRAY_SIZE >> +ALIGN >> +drm_get_card >> +drm_open_any >> +drm_open_any_render >> +gem_quiescent_gpu >> +do_or_die >> +do_ioctl >> + >> + >> + >> +igt_aux >> +igt_fork_signal_helper >> +igt_stop_signal_helper >> +igt_exchange_int >> +igt_permute_array >> +igt_progress >> +igt_check_boolean_env_var >> +igt_aub_dump_enabled >> +igt_init_aperture_trashers >> +igt_trash_aperture >> +igt_cleanup_aperture_trashers >> +igt_system_suspend_autoresume >> +igt_drop_root >> +igt_wait_for_keypress >> +igt_runtime_pm_status >> +igt_setup_runtime_pm >> +igt_get_runtime_pm_status >> +igt_wait_for_pm_status >> +intel_purge_vm_caches >> +intel_get_avail_ram_mb >> +intel_get_total_ram_mb >> +intel_get_total_swap_mb >> +intel_check_memory >> +CHECK_RAM >> +CHECK_SWAP >> + >> + >> + >> +igt_core >> +IGT_EXIT_TIMEOUT >> +IGT_EXIT_SKIP >> +IGT_EXIT_SUCCESS >> +igt_fixture >> +igt_subtest_init >> +igt_opt_handler_t >> +igt_subtest_init_parse_opts >> +igt_tokencat >> +igt_subtest >> +igt_subtest_f >> +igt_subtest_name >> +igt_only_list_subtests >> +igt_main >> +igt_simple_init >> +igt_simple_main >> +igt_skip >> +igt_success >> +igt_fail >> +igt_exit >> +igt_assert >> +igt_assert_f >> +igt_assert_cmpint >> +igt_require >> +igt_skip_on >> +igt_require_f >> +igt_skip_on_f >> +igt_fork >> +igt_waitchildren >> +igt_helper_process >> +igt_fork_helper >> +igt_wait_helper >> +igt_stop_helper >> +igt_exit_handler_t >> +igt_install_exit_handler >> +igt_enable_exit_handler >> +igt_disable_exit_handler >> +igt_run_in_simulation >> +SLOW_QUICK >> +igt_skip_on_simulation >> +igt_log_level >> +igt_log >> +igt_vlog >> +igt_debug >> +igt_info >> +igt_warn >> +igt_warn_on >> +igt_warn_on_f >> +igt_set_timeout >> + >> + >> + >> +igt_debugfs >> +igt_debugfs_open >> +igt_debugfs_fopen >> +igt_pipe_crc_t >> +igt_crc_t >> +intel_pipe_crc_source >> +igt_crc_is_null >> +igt_crc_equal >> +igt_crc_to_
Re: [Intel-gfx] [i-g-t 7/7] docs: add missing sections to intel-gpu-tools-docs.xml
On 10 June 2014 15:47, Daniel Vetter wrote: > On Tue, Jun 10, 2014 at 03:30:57PM +0100, Thomas Wood wrote: >> Signed-off-by: Thomas Wood > > I've intentionally left these out since they're not really part of the > core test library ... E.g. all public rendercopy functions are documented > as part of the "intel batchbuffer" library. > -Daniel These functions currently appear in the API index and therefore produce warnings that there is no link for them. If they are private then they can be left out of the documentation altogether and their headers added to the IGNORE_HEADERS directive instead. > >> --- >> docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml | 4 >> 1 file changed, 4 insertions(+) >> >> diff --git a/docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml >> b/docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml >> index dcfff33..96cf77f 100644 >> --- a/docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml >> +++ b/docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml >> @@ -15,6 +15,7 @@ >> >> >> Intel GPU Tools >> + >> >> >> >> @@ -22,9 +23,12 @@ >> >> >> >> + >> >> >> >> + >> + >> >> >> >> -- >> 1.9.3 >> >> ___ >> Intel-gfx mailing list >> Intel-gfx@lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/intel-gfx > > -- > Daniel Vetter > Software Engineer, Intel Corporation > +41 (0) 79 365 57 48 - http://blog.ffwll.ch > ___ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t] docs: add private headers to IGNORE_HFILES
Signed-off-by: Thomas Wood --- docs/reference/intel-gpu-tools/Makefile.am | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/reference/intel-gpu-tools/Makefile.am b/docs/reference/intel-gpu-tools/Makefile.am index daaa3f4..549f34b 100644 --- a/docs/reference/intel-gpu-tools/Makefile.am +++ b/docs/reference/intel-gpu-tools/Makefile.am @@ -58,7 +58,9 @@ EXTRA_HFILES= # Header files or dirs to ignore when scanning. Use base file/dir names # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h private_code -IGNORE_HFILES=gen6_render.h gen7_media.h gen7_render.h gen8_media.h gen8_render.h i830_reg.h i915_3d.h i915_pciids.h i915_reg.h intel_reg.h +IGNORE_HFILES=gen6_render.h gen7_media.h gen7_render.h gen8_media.h \ + gen8_render.h i830_reg.h i915_3d.h i915_pciids.h i915_reg.h \ + intel_reg.h debug.h instdone.h media_fill.h rendercopy.h # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png -- 1.9.3 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t] docs: always rebuild the sections file
Always rebuild the sections file since it currently doesn't contain any custom modifications. Signed-off-by: Thomas Wood --- docs/reference/intel-gpu-tools/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference/intel-gpu-tools/Makefile.am b/docs/reference/intel-gpu-tools/Makefile.am index 549f34b..3368e3e 100644 --- a/docs/reference/intel-gpu-tools/Makefile.am +++ b/docs/reference/intel-gpu-tools/Makefile.am @@ -29,7 +29,7 @@ SCANGOBJ_OPTIONS= # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" -SCAN_OPTIONS= +SCAN_OPTIONS=--rebuild-sections # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--xml-mode --output-format=xml @@ -93,7 +93,7 @@ EXTRA_DIST += # Files not to distribute # for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types # for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt -#DISTCLEANFILES += +DISTCLEANFILES = $(DOC_MODULE)-sections.txt # Comment this out if you want 'make check' to test you doc status # and run some sanity checks -- 1.9.3 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t] docs: remove unused annotation glossary include
API annotations are not used anywhere in the documentation, so the annotation glossary is not built. Signed-off-by: Thomas Wood --- docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml b/docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml index dcfff33..68ca8d4 100644 --- a/docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml +++ b/docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml @@ -35,6 +35,4 @@ Index of deprecated API - - -- 1.9.3 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t] tests: fix sub-test enumeration
Ensure sub-tests can be listed correctly by doing any test setup within an igt_fixture block. Signed-off-by: Thomas Wood --- tests/gem_evict_alignment.c | 7 --- tests/gem_pwrite_pread.c| 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/gem_evict_alignment.c b/tests/gem_evict_alignment.c index 15c4707..c478f18 100644 --- a/tests/gem_evict_alignment.c +++ b/tests/gem_evict_alignment.c @@ -189,11 +189,12 @@ igt_main igt_skip_on_simulation(); - igt_fixture + igt_fixture { fd = drm_open_any(); - igt_skip_on_f(intel_gen(intel_get_drm_devid(fd)) > 7, - "BLIT commands not yet updated\n"); + igt_skip_on_f(intel_gen(intel_get_drm_devid(fd)) > 7, + "BLIT commands not yet updated\n"); + } igt_subtest("minor-normal") { size = 1024 * 1024; diff --git a/tests/gem_pwrite_pread.c b/tests/gem_pwrite_pread.c index 1ae0820..8f768b3 100644 --- a/tests/gem_pwrite_pread.c +++ b/tests/gem_pwrite_pread.c @@ -380,9 +380,9 @@ int main(int argc, char **argv) gem_set_caching(fd, src, 0); gem_set_caching(fd, dst, 0); - } - devid = intel_get_drm_devid(fd); + devid = intel_get_drm_devid(fd); + } igt_subtest("uncached-copy-correctness") test_copy(fd, src, dst, tmp, object_size); -- 1.8.5.3 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 1/2] Add API documentation support
Add optional support for building API documentation using gtk-doc. Signed-off-by: Thomas Wood --- .gitignore | 3 + Makefile.am| 2 +- NEWS | 2 + autogen.sh | 7 ++ configure.ac | 12 +++ docs/Makefile.am | 1 + docs/reference/Makefile.am | 1 + docs/reference/intel-gpu-tools/.gitignore | 26 + docs/reference/intel-gpu-tools/Makefile.am | 105 + .../intel-gpu-tools/intel-gpu-tools-docs.xml | 40 docs/reference/intel-gpu-tools/version.xml.in | 1 + 11 files changed, 199 insertions(+), 1 deletion(-) create mode 100644 docs/Makefile.am create mode 100644 docs/reference/Makefile.am create mode 100644 docs/reference/intel-gpu-tools/.gitignore create mode 100644 docs/reference/intel-gpu-tools/Makefile.am create mode 100644 docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml create mode 100644 docs/reference/intel-gpu-tools/version.xml.in diff --git a/.gitignore b/.gitignore index 28ef75b..c622b7c 100644 --- a/.gitignore +++ b/.gitignore @@ -83,3 +83,6 @@ TAGS build-aux/ __pycache__ version.h + +gtk-doc.make +gtk-doc.m4 diff --git a/Makefile.am b/Makefile.am index 431e7b4..9949679 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,7 +21,7 @@ ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4 -SUBDIRS = lib man tools scripts benchmarks demos overlay +SUBDIRS = docs lib man tools scripts benchmarks demos overlay if BUILD_ASSEMBLER SUBDIRS += assembler diff --git a/NEWS b/NEWS index 75352ae..22bb014 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,8 @@ Release 1.6 (2014-XX-YY) - Broadwell support for intel_audio_dump (Mengdong Lin). +- API documentation support (Thomas) + Release 1.5 (2013-11-06) diff --git a/autogen.sh b/autogen.sh index 354f254..629a257 100755 --- a/autogen.sh +++ b/autogen.sh @@ -6,6 +6,13 @@ test -z "$srcdir" && srcdir=. ORIGDIR=`pwd` cd $srcdir +if ! type gtkdocize > /dev/null 2>&1; then +echo "EXTRA_DIST =" > gtk-doc.make +echo "CLEANFILES =" >> gtk-doc.make +else +gtkdocize || exit $? +fi + autoreconf -v --install || exit 1 cd $ORIGDIR || exit $? diff --git a/configure.ac b/configure.ac index 4aee793..2c991a8 100644 --- a/configure.ac +++ b/configure.ac @@ -42,6 +42,14 @@ AC_PROG_CC AM_PROG_LEX AC_PROG_YACC +# check for gtk-doc +m4_ifdef([GTK_DOC_CHECK], [ +GTK_DOC_CHECK([1.14],[--flavour no-tmpl]) +],[ +AM_CONDITIONAL([ENABLE_GTK_DOC], false) +]) + + # Checks for functions, headers, structures, etc. AC_HEADER_STDC AC_CHECK_HEADERS([termios.h]) @@ -192,6 +200,10 @@ AC_CONFIG_FILES([ Makefile benchmarks/Makefile demos/Makefile +docs/Makefile +docs/reference/Makefile +docs/reference/intel-gpu-tools/Makefile +docs/reference/intel-gpu-tools/version.xml lib/Makefile man/Makefile scripts/Makefile diff --git a/docs/Makefile.am b/docs/Makefile.am new file mode 100644 index 000..b68c774 --- /dev/null +++ b/docs/Makefile.am @@ -0,0 +1 @@ +SUBDIRS=reference diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am new file mode 100644 index 000..4f579b5 --- /dev/null +++ b/docs/reference/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = intel-gpu-tools diff --git a/docs/reference/intel-gpu-tools/.gitignore b/docs/reference/intel-gpu-tools/.gitignore new file mode 100644 index 000..9415974 --- /dev/null +++ b/docs/reference/intel-gpu-tools/.gitignore @@ -0,0 +1,26 @@ +/gtkdoc-check.log +/gtkdoc-check.trs +/html-build.stamp +/html.stamp +/html/ +/intel-gpu-tools-decl-list.txt +/intel-gpu-tools-decl.txt +/intel-gpu-tools-overrides.txt +/intel-gpu-tools-sections.txt +/intel-gpu-tools-undeclared.txt +/intel-gpu-tools-undocumented.txt +/intel-gpu-tools-unused.txt +/intel-gpu-tools.args +/intel-gpu-tools.hierarchy +/intel-gpu-tools.interfaces +/intel-gpu-tools.prerequisites +/intel-gpu-tools.signals +/intel-gpu-tools.types +/scan-build.stamp +/setup-build.stamp +/sgml-build.stamp +/sgml.stamp +/test-suite.log +/version.xml +/xml/ + diff --git a/docs/reference/intel-gpu-tools/Makefile.am b/docs/reference/intel-gpu-tools/Makefile.am new file mode 100644 index 000..daaa3f4 --- /dev/null +++ b/docs/reference/intel-gpu-tools/Makefile.am @@ -0,0 +1,105 @@ +## Process this file with automake to produce Makefile.in + +# We require automake 1.6 at least. +AUTOMAKE_OPTIONS = 1.6 + +# This is a blank Makefile.am for using gtk-doc. +# Copy this to your project's API docs directory and modify the variables to +# suit your project. See the GTK+ Makefiles in gtk+/docs/re
[Intel-gfx] [PATCH i-g-t 2/2] drmtest: reformat the API documentation
Make the existing documentation compatible with gtk-doc. Signed-off-by: Thomas Wood --- lib/drmtest.c | 19 - lib/drmtest.h | 65 +-- 2 files changed, 60 insertions(+), 24 deletions(-) diff --git a/lib/drmtest.c b/lib/drmtest.c index 9f6e701..20918b7 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -176,9 +176,11 @@ void gem_quiescent_gpu(int fd) } /** - * drm_get_card() - get an intel card number for use in /dev or /sys + * drm_get_card: * - * returns -1 on error + * Get an intel card number for use in /dev or /sys + * + * Returns: -1 on error */ int drm_get_card(void) { @@ -1241,11 +1243,6 @@ bool __igt_fork_helper(struct igt_helper_process *proc) } -/** - * igt_waitchildren - wait for all children forked with igt_fork - * - * The magic here is that exit codes from children will be correctly propagated - */ void igt_stop_helper(struct igt_helper_process *proc) { int status, ret; @@ -1338,7 +1335,9 @@ bool __igt_fork(void) } /** - * igt_waitchildren - wait for all children forked with igt_fork + * igt_waitchildren: + * + * Wait for all children forked with igt_fork * * The magic here is that exit codes from children will be correctly propagated */ @@ -1394,7 +1393,9 @@ bool igt_run_in_simulation(void) } /** - * igt_skip_on_simulation - skip tests when INTEL_SIMULATION env war is set + * igt_skip_on_simulation: + * + * Skip tests when INTEL_SIMULATION env war is set * * Skip the test when running on simulation (and that's relevant only when * we're not in the mode where we list the subtests). diff --git a/lib/drmtest.h b/lib/drmtest.h index b64529b..40510dc 100644 --- a/lib/drmtest.h +++ b/lib/drmtest.h @@ -110,7 +110,11 @@ void igt_permute_array(void *array, unsigned size, unsigned j)); void igt_progress(const char *header, uint64_t i, uint64_t total); -/* init for simple tests without subtests */ +/** + * igt_simple_init: + * + * Init for simple tests without subtests + */ void igt_simple_init(void); #define igt_simple_main \ static void igt_tokencat(__real_main, __LINE__)(void); \ @@ -133,7 +137,9 @@ int igt_subtest_init_parse_opts(int argc, char **argv, igt_opt_handler_t opt_handler); bool __igt_run_subtest(const char *subtest_name); /** - * igt_subtest/_f - Denote a subtest code block + * igt_subtest: + * + * Denote a subtest code block * * Magic control flow which denotes a subtest code block. Within that codeblock * igt_skip|success will only bail out of the subtest. The _f variant accepts a @@ -148,6 +154,15 @@ bool __igt_run_subtest(const char *subtest_name); __igt_run_subtest( tmp ) && \ (setjmp(igt_subtest_jmpbuf) == 0); \ igt_success()) + +/** + * igt_subtest_f: + * @...: format string + * + * Denote a subtest code block + * + * Like #igt_subtest, but also accepts a printf format string + */ #define igt_subtest_f(f...) \ __igt_subtest_f(igt_tokencat(__tmpchar, __LINE__), f) #define igt_subtest(name) for (; __igt_run_subtest((name)) && \ @@ -165,27 +180,35 @@ const char *igt_subtest_name(void); /** - * igt_skip - subtest aware test skipping + * igt_skip: + * + * Subtest aware test skipping * * For tests with subtests this will either bail out of the current subtest or * mark all subsequent subtests as SKIP (in case some global setup code failed). * * For normal tests without subtest it will directly exit. */ -__attribute__((format(printf, 1, 2))) void igt_skip(const char *f, ...) __attribute__((noreturn)); +__attribute__((format(printf, 1, 2))) +void igt_skip(const char *f, ...) __attribute__((noreturn)); __attribute__((format(printf, 5, 6))) void __igt_skip_check(const char *file, const int line, const char *func, const char *check, const char *format, ...) __attribute__((noreturn)); /** - * igt_success - complete a (subtest) as successfull + * igt_success: + * + * Complete a (subtest) as successfull * * This bails out of a subtests and marks it as successful. For global tests it * it won't bail out of anything. */ void igt_success(void); + /** - * igt_fail - fail a testcase + * igt_fail: + * + * Fail a testcase * * For subtest it just bails out of the subtest, when run in global context it * will exit. Note that it won't attempt to keep on running further tests, @@ -198,7 +221,9 @@ void __igt_fail_assert(int exitcode, const char *file, const char *format, ...) __attribute__((noreturn)); /** - * igt_exit - exit() for igts + * igt_exit: + * + * exit() for igts * * This will exit the test with the right exit code when subtests have been * skipped. For normal tests it exits with a successful exit code, presuming @@ -207,7 +232,9 @@ void __igt_fail_assert(int exitcode, const
[Intel-gfx] [PATCH i-g-t 0/3] Various small changes
The following patches contain two small fixes and one enhancement for intel-gpu-tools. Thomas Wood (3): tests: add missing assertion lib: print the name of the currently running subtest lib: Add i915_pciids.h to Makefile.sources lib/Makefile.sources | 1 + lib/drmtest.c| 5 - tests/pm_psr.c | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) -- 1.8.5.3 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 3/3] lib: Add missing header to Makefile.sources
i915_pciids.h was missing from Makefile.sources, which caused distcheck to fail. Signed-off-by: Thomas Wood --- lib/Makefile.sources | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Makefile.sources b/lib/Makefile.sources index 5072057..cac9d12 100644 --- a/lib/Makefile.sources +++ b/lib/Makefile.sources @@ -5,6 +5,7 @@ libintel_tools_la_SOURCES = \ i830_reg.h \ i915_3d.h \ i915_reg.h \ + i915_pciids.h \ igt_debugfs.c \ igt_debugfs.h \ igt_display.c \ -- 1.8.5.3 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 1/3] tests: add missing assertion
Signed-off-by: Thomas Wood --- tests/pm_psr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/pm_psr.c b/tests/pm_psr.c index def8e12..5d28c7a 100644 --- a/tests/pm_psr.c +++ b/tests/pm_psr.c @@ -57,6 +57,7 @@ static int get_perf(const char *path) igt_assert(ret != 0); enabled = strcmp(str, "yes") == 0; ret = fscanf(file, "Performance_Counter: %i", &perf); + igt_assert(ret != 0); if (!sink) igt_skip("This panel does not support PSR.\n"); -- 1.8.5.3 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t 2/3] lib: print the name of the currently running subtest
Signed-off-by: Thomas Wood --- lib/drmtest.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/drmtest.c b/lib/drmtest.c index 9f6e701..b8d3542 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -1007,6 +1007,9 @@ bool __igt_run_subtest(const char *subtest_name) return false; } + printf("Subtest %s: ", subtest_name); + fflush(stdout); + return (in_subtest = subtest_name); } @@ -1028,7 +1031,7 @@ static int igt_exitcode; static void exit_subtest(const char *) __attribute__((noreturn)); static void exit_subtest(const char *result) { - printf("Subtest %s: %s\n", in_subtest, result); + printf("%s\n", result); in_subtest = NULL; longjmp(igt_subtest_jmpbuf, 1); } -- 1.8.5.3 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t] tests: create files that list the available tests
Add Makefile targets to create two text files containing the list of available single and multi-test programs. This enables the tests to be enumerated without requiring the build system. Signed-off-by: Thomas Wood --- tests/.gitignore | 2 ++ tests/Makefile.am | 14 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/.gitignore b/tests/.gitignore index 8b94613..146bab0 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -117,6 +117,7 @@ kms_pipe_crc_basic kms_plane kms_render kms_setmode +multi-tests.txt pm_lpsp pm_pc8 pm_psr @@ -127,5 +128,6 @@ prime_nv_pcopy prime_nv_test prime_self_import prime_udl +single-tests.txt template testdisplay diff --git a/tests/Makefile.am b/tests/Makefile.am index ba05eac..c26a3d0 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -5,6 +5,8 @@ if HAVE_NOUVEAU endif if BUILD_TESTS +all-local: single-tests.txt multi-tests.txt + list-single-tests: @echo TESTLIST @echo ${single_kernel_tests} @@ -15,10 +17,20 @@ list-multi-tests: @echo ${multi_kernel_tests} @echo END TESTLIST +single-tests.txt: + @echo TESTLIST > $@ + @echo ${single_kernel_tests} >> $@ + @echo END TESTLIST >> $@ + +multi-tests.txt: + @echo TESTLIST > $@ + @echo ${multi_kernel_tests} >> $@ + @echo END TESTLIST >> $@ + EXTRA_PROGRAMS = $(TESTS_progs) $(TESTS_progs_M) $(HANG) $(TESTS_testsuite) EXTRA_DIST = $(TESTS_scripts) $(TESTS_scripts_M) $(scripts) $(IMAGES) $(common_files) -CLEANFILES = $(EXTRA_PROGRAMS) +CLEANFILES = $(EXTRA_PROGRAMS) single-tests.txt multi-tests.txt AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) \ -I$(srcdir)/.. \ -- 1.9.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH] drm: fix the addition of the side-by-side (half) flag for extra 3D modes
Ensure the side-by-side (half) flag is added to any existing flags when adding modes from 3D_Structure_ALL. Signed-off-by: Thomas Wood --- drivers/gpu/drm/drm_edid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index fb7cf0e..52e060e 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -2701,7 +2701,7 @@ static int add_3d_struct_modes(struct drm_connector *connector, u16 structure, if (structure & (1 << 8)) { newmode = drm_mode_duplicate(dev, &edid_cea_modes[cea_mode]); if (newmode) { - newmode->flags = DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF; + newmode->flags |= DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF; drm_mode_probed_add(connector, newmode); modes++; } -- 1.8.4.2 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH 1/2] drm/edid: split VIC display mode lookup into a separate function
Signed-off-by: Thomas Wood --- drivers/gpu/drm/drm_edid.c | 67 +++--- 1 file changed, 39 insertions(+), 28 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 52e060e..1dd82cd 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -2557,25 +2557,40 @@ add_alternate_cea_modes(struct drm_connector *connector, struct edid *edid) return modes; } -static int -do_cea_modes(struct drm_connector *connector, const u8 *db, u8 len) +static struct drm_display_mode * +drm_display_mode_from_vic_index(struct drm_connector *connector, + const u8 *video_db, u8 video_len, + u8 video_index) { struct drm_device *dev = connector->dev; - const u8 *mode; + struct drm_display_mode *newmode; u8 cea_mode; - int modes = 0; - for (mode = db; mode < db + len; mode++) { - cea_mode = (*mode & 127) - 1; /* CEA modes are numbered 1..127 */ - if (cea_mode < ARRAY_SIZE(edid_cea_modes)) { - struct drm_display_mode *newmode; - newmode = drm_mode_duplicate(dev, -&edid_cea_modes[cea_mode]); - if (newmode) { - newmode->vrefresh = 0; - drm_mode_probed_add(connector, newmode); - modes++; - } + if (video_db == NULL || video_index > video_len) + return NULL; + + /* CEA modes are numbered 1..127 */ + cea_mode = (video_db[video_index] & 127) - 1; + if (cea_mode >= ARRAY_SIZE(edid_cea_modes)) + return NULL; + + newmode = drm_mode_duplicate(dev, &edid_cea_modes[cea_mode]); + newmode->vrefresh = 0; + + return newmode; +} + +static int +do_cea_modes(struct drm_connector *connector, const u8 *db, u8 len) +{ + int i, modes = 0; + + for (i = 0; i < len; i++) { + struct drm_display_mode *mode; + mode = drm_display_mode_from_vic_index(connector, db, len, i); + if (mode) { + drm_mode_probed_add(connector, mode); + modes++; } } @@ -2669,21 +2684,13 @@ static int add_hdmi_mode(struct drm_connector *connector, u8 vic) static int add_3d_struct_modes(struct drm_connector *connector, u16 structure, const u8 *video_db, u8 video_len, u8 video_index) { - struct drm_device *dev = connector->dev; struct drm_display_mode *newmode; int modes = 0; - u8 cea_mode; - - if (video_db == NULL || video_index > video_len) - return 0; - - /* CEA modes are numbered 1..127 */ - cea_mode = (video_db[video_index] & 127) - 1; - if (cea_mode >= ARRAY_SIZE(edid_cea_modes)) - return 0; if (structure & (1 << 0)) { - newmode = drm_mode_duplicate(dev, &edid_cea_modes[cea_mode]); + newmode = drm_display_mode_from_vic_index(connector, video_db, + video_len, + video_index); if (newmode) { newmode->flags |= DRM_MODE_FLAG_3D_FRAME_PACKING; drm_mode_probed_add(connector, newmode); @@ -2691,7 +2698,9 @@ static int add_3d_struct_modes(struct drm_connector *connector, u16 structure, } } if (structure & (1 << 6)) { - newmode = drm_mode_duplicate(dev, &edid_cea_modes[cea_mode]); + newmode = drm_display_mode_from_vic_index(connector, video_db, + video_len, + video_index); if (newmode) { newmode->flags |= DRM_MODE_FLAG_3D_TOP_AND_BOTTOM; drm_mode_probed_add(connector, newmode); @@ -2699,7 +2708,9 @@ static int add_3d_struct_modes(struct drm_connector *connector, u16 structure, } } if (structure & (1 << 8)) { - newmode = drm_mode_duplicate(dev, &edid_cea_modes[cea_mode]); + newmode = drm_display_mode_from_vic_index(connector, video_db, + video_len, + video_index); if (newmode) { newmode->flags |= DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF; drm_mode_probed_add(connector, newmode); -- 1.8.4.2 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] Parse the list of additional 3D modes
Hi, The following two patches add support for parsing the list of additional 3D modes at the end of the vendor specific data block. The first splits the VIC display mode lookup into a separate function so that it can be reused. The second patch parses the list, adding any support modes to the connector. Regards, Thomas ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH 2/2] drm/edid: parse the list of additional 3D modes
Parse 2D_VIC_order_X and 3D_Structure_X from the list at the end of the HDMI Vendor Specific Data Block. Signed-off-by: Thomas Wood --- drivers/gpu/drm/drm_edid.c | 50 ++ 1 file changed, 50 insertions(+) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 1dd82cd..eb6b363 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -2808,6 +2808,56 @@ do_hdmi_vsdb_modes(struct drm_connector *connector, const u8 *db, u8 len, video_len, i); } + if (hdmi_3d_len <= 4) + goto out; + + offset += 4; + + for (i = 0; i < (hdmi_3d_len - 4); i++) { + int vic_index; + struct drm_display_mode *newmode = NULL; + unsigned int newflag = 0; + + if (((db[8 + offset + i] & 0x0f) > 7) + && (i + 1 == hdmi_3d_len - 4)) + break; + + /* 2D_VIC_order_X */ + vic_index = db[8 + offset + i] >> 4; + + /* 3D_Structure_X */ + switch (db[8 + offset + i] & 0x0f) { + case 0: + newflag = DRM_MODE_FLAG_3D_FRAME_PACKING; + break; + case 6: + newflag = DRM_MODE_FLAG_3D_TOP_AND_BOTTOM; + break; + case 8: + if ((db[9 + offset + i] >> 4) == 1) + newflag = DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF; + break; + } + + if (newflag != 0) { + newmode = drm_display_mode_from_vic_index(connector, + video_db, + video_len, + vic_index); + + if (newmode) { + newmode->flags |= newflag; + drm_mode_probed_add(connector, newmode); + modes++; + } + } + + if ((db[8 + offset + i] & 0x0f) > 7) { + /* Optional 3D_Detail_X and reserved */ + i++; + } + } + out: return modes; } -- 1.8.4.2 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] Parse the list of additional 3D modes (v2)
Here's an updated series of patches taking into account Ville's review. Regards, Thomas ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx