summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2018-08-09uwildmat: Case-insensitive test selectionPetri Latvala
Since we only use plain ascii in subtest names, using non-locale-aware tolower() to compare case-insensitively works. Doing this within uwildmat instead of tolowering the subtest name and then calling uwildmat() is required, because of selection strings like: foo,bar,!Foo The above line will select subtest Bar, and not select Foo. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-08-09lib: Export igt_gettime and igt_time_elapsedPetri Latvala
Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-08-09lib: Print subtest starting/ending line to stderr tooPetri Latvala
when instructed via the environment. This is needed for the new test runner to properly assign stderr output to the correct subtest. v2: Print the subtest result from skip_subtests_henceforth handling also to stderr. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-08-02lib/igt_pm: Export function to restore runtime PM statusTvrtko Ursulin
In cases when runtime PM is enabled only from individual subtests and not whole tests it is usable to be able to restore the old runtime PM config and so avoid running subsequent subtests in an unexpected environment. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-08-02lib/igt_pm: Find HDA device when attempting to enable runtime PMTvrtko Ursulin
HDA audio device can be present at various PCI paths on different systems which the existing code did not account for. Furthermore the failure to enable runtime PM was silent leaving callers in the dark. Improve it by auto-locating the PCI path and logging a warning when something is not as expected. v2: * If there is no audio hw/driver there is no failure. v3: * Comment. * Skip non-symlinks. * Free path on failure and restore. * Simplify with asprintf. (Chris Wilson) v4: * Find snd_hda_intel instance tied with an Intel device. v5: * Fix memory leak and silence Valgrind warning. v6: * Fix error out logic. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-08-02lib/igt_pm: Make exit handlers signal safeTvrtko Ursulin
IGT logging helpers are not signal safe so avoid calling them from exit handlers. At the same time refactor the code a bit to enable following patches. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-07-27lib/igt_core: Fix typoGwan-gyeong Mun
"overridden" was misspelled as "overriden". Fix it. Signed-off-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2018-07-25build: provide stub implementation for memfd_createLucas De Marchi
When libc misses memfd_create(), provide a stub implementation to go through the syscall() route. Syscall numbers are provided for platforms currently supported by i-g-t only. v2: add support to autotools Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Acked-by: Antonio Argenziano <antonio.argenziano@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2018-07-25build: provide include for missing syscallsLucas De Marchi
Add directory with README file to allow missing syscalls to be defined. The syscalls themselves will be provided in follow up patches. v2: add support to autotools Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Acked-by: Antonio Argenziano <antonio.argenziano@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2018-07-24lib: Don't assert all KMS drivers support edid_overrideChris Wilson
edid_override is a i915.ko debugfs feature; just skip any kms test that depends on being able to override the edid. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107337 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-07-20lib/rendercopy: Fix lack of const throughout gen4 rendercopyChris Wilson
The gen4 code was pushed without being fixed up for the constification of igt_render_copyfunc_t ../lib/intel_batchbuffer.c: In function ‘igt_get_render_copyfunc’: ../lib/intel_batchbuffer.c:837:8: warning: assignment to ‘igt_render_copyfunc_t’ {aka ‘void (*)(struct intel_batchbuffer *, struct _drm_intel_context *, const struct igt_buf *, unsigned int, unsigned int, unsigned int, unsigned int, const struct igt_buf *, unsigned int, unsigned int)’} from incompatible pointer type ‘void (*)(struct intel_batchbuffer *, drm_intel_context *, struct igt_buf *, unsigned int, unsigned int, unsigned int, unsigned int, struct igt_buf *, unsigned int, unsigned int)’ {aka ‘void (*)(struct intel_batchbuffer *, struct _drm_intel_context *, struct igt_buf *, unsigned int, unsigned int, unsigned int, unsigned int, struct igt_buf *, unsigned int, unsigned int)’} [-Wincompatible-pointer-types] copy = gen4_render_copyfunc; Fixes: 61370b2d43db ("lib/rendercopy: Add gen4/5 rendercopy") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-07-19lib: Move trash_bos to their only userChris Wilson
Only pm_rpm still uses the igt_trash_aperture() and so we can remove it from the lib and in the process convert it over from the legacy libdrm_intel. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2018-07-18lib/gen6_render: Drop duplicated definitionsLukasz Kalamarz
Dropping duplicated definitions of registers,fields and shiftsm, which were implemented in gen4 and does not changed in gen6. v3: Rebase Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-07-18lib/rendercopy: Use gen4 definitions if applicableLukasz Kalamarz
Instead of using definitions duplicated in gen7_render header, we should use the oldest definition that is working with chosen gen. This patch reuse gen6 definitons if registers/fields/shifts that were introduced in other genX_render headers. v3: Rebase and checkpatch Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-07-18lib/rendercopy: Add gen4/5 rendercopyLukasz Kalamarz
Add rendercopy implementation for gen4/5. Basic structure copied from the gen6 implementation, and the gen4/5 specific bits were mostly lifted from sna. v2: Renamed registers definitions, which are GEN4 specific to include that prefix (Lukasz) v3: Rebase and checkpatch Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-07-17tests/psr: Move PSR state test functions to libDhinakaran Pandiyan
kms_frontbuffer_tracking and kms_psr test PSR in different ways, let' fix that by creating common library functions. v2: Include the new file in meson.build v3: Leave --no-psr intact (Rodrigo) Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2018-07-13lib/gt: Make use of dummyload library to create recursive batchAntonio Argenziano
An hanging batch is nothing more than a spinning batch that never gets stopped, so re-use the routines implemented in dummyload.c. v2: Let caller decide spin loop size v3: Only use loose loops for hangs (Chris) v4: No requires v5: Free the spinner v6: Chamelium exists. Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> #v3 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2018-07-13igt/gem_userptr: Check read-only mappingsChris Wilson
Setup a userptr object that only has a read-only mapping back to a file store (memfd). Then attempt to write into that mapping using the GPU and assert that those writes do not land (while also writing via a writable userptr mapping into the same memfd to verify that the GPU is working!) v2: Pull the random batch construction into a routine to avoid duplication. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2018-07-12igt/pm_rpm: Pass NULL to require no extra module optionsChris Wilson
We use options!=NULL to determine if we should require the module to be reloaded and fail if we find it already loaded. In pm_rpm, we are only ensuring the MSR module is loaded, and only want default options. Fixes: 4dc2ce0e ("lib/kmod: Fail if the module is already loaded") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2018-07-12lib/igt_kms: simplify pipe <-> name conversionLucas De Marchi
Now that we can use _Static_assert() due to C11, make it future proof so we remember to update this if IGT_MAX_PIPES changes. Also reduce verbosity a little bit by calculating indexes instead of if/else chain. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-07-12lib/igt_core: fix check for running under gdbLucas De Marchi
Properly check for errors and rename the function since we are checking if we are running under gdb, not making it run under gdb. Previously we were passing uninitialized data to basename() due to not properly adding the nul termination. ==22293== Conditional jump or move depends on uninitialised value(s) ==22293== at 0x4C306D0: rindex (vg_replace_strmem.c:199) ==22293== by 0x4EC55DD: basename (in /usr/lib64/libc-2.27.so) ==22293== by 0x400744: running_under_gdb (in /tmp/a) There's another problem with this function that it doesn't detect when we are running gdb from a toolchain using a toolchain triplet, but that's left for another patch. v2: remove the fix for repeating the argument on readlink() since that landed in another patch Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-07-11Avoid truncate string in __igt_lsof_fdsRodrigo Siqueira
Note that 'proc_path' parameter in __igt_lsof_fds receives a string which was initialized with the size of PATH_MAX and the local variable 'path' has the same size, but it also have to append: '/', '\0', and the directory name. This situation caused the warning described below. warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Wformat-truncation=] snprintf(path, sizeof(path), "%s/%s", proc_path, d->d_name); note: ‘snprintf’ output between 2 and 4352 bytes into a destination of size 4096 [..] This commit fixes this problem by changing the string size passed by __igt_lsoft to __igt_lsof_fds. The max size for the string is strlen("/proc/%d/cwd")+1 where "%d" can be estimated with CEILING(LOG_10(INT_MAX)), in this sense, it is safe to define a path size of 30 characters. Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-07-11Remove parameter aliases with another argumentRodrigo Siqueira
This commit fixes the following GCC warning: warning: passing argument 2 to restrict-qualified parameter aliases with argument 1 [-Wrestrict] return (readlink (buf, buf, sizeof (buf)) != -1 && This commit fixes the GCC warning by creating a second buffer only to keep the path. v2: make pathname smaller (A. Hiler) Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-07-11lib/dummyload: Control whether or not the batch is preemptibleChris Wilson
Sometimes, we do not want to allow control to escape from the spinner, e.g. for when we want to hang the GPU inside the batch. (Split out from the preempt-timeout test case.) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2018-07-11lib/kmod: Fail if the module is already loadedChris Wilson
If we want to set new module options, we must load the module or die trying. We may want to always fail if the module if already loaded, but for now, take the small incremental step and insist that the options are set if requested. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-07-10lib: Require working GEM (!wedged) to allow hang injectionChris Wilson
As we ordinarily use a spinning batch to trigger a hang, we cannot do so without execbuf. On the other hand, if we do a manual reset of the wedged driver, we expect it to remain wedged and for the reset to fail; failing the test. Even if we remove the igt_assert(!wedged), the test is suspect as we don't know if the reset took place and so do not know if the conditions the test is trying to setup apply. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2018-07-09lib/igt_draw: Zero initalize the igt_bufsVille Syrjälä
I missed these when sprinkling the memsets. Using stack garbage as the aux surface state isn't a good idea. Causes kms_front_buffer_tracking to fail on skl+. Fixes: a4393c3951ec ("lib: Add aux surface state to igt_buf") Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2018-07-06lib: Spin fast, retire earlyChris Wilson
When using the pollable spinner, we often want to use it as a means of ensuring the task is running on the GPU before switching to something else. In which case we don't want to add extra delay inside the spinner, but the current 1000 NOPs add on order of 5us, which is often larger than the target latency. v2: Don't change perf_pmu as that is sensitive to the extra CPU latency from a tight GPU spinner. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com> #v1 Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> #v1 Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2018-07-06lib: Convert spin batch constructor to a factoryChris Wilson
In order to make adding more options easier, expose the full set of options to the caller. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2018-07-06lib/rendercopy: Add enough surface state for AUX_CCS_EVille Syrjälä
Populate the gen8+ SURFACE_STATE aux bits correctly. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-07-06lib: Add aux surface state to igt_bufVille Syrjälä
Store a bit of aux surface state in igt_buf. This will be needed for rendercopy AUX_CCS_E color compression. We also have to sprinkle memset()s and whatnot all over to make sure the current igt_buf users don't leave the aux stuff full of stack garbage. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-07-06lib/rendercopy: Set the upper 32bits of surface base address on gen8+Ville Syrjälä
gen8 introduces 48 bit virtual addresses. Set both dwords correctly as otherwise the presumed_offset will not match what we actually have stored in the surface state if the buffer is located somewhere above 4GiB. I guess we're not currently using 48bit addresses with rendercopy? Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-07-05lib: Constify igt_bufVille Syrjälä
No one generally needs to modify the igt_bufs we pass around, so make them const. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-07-03lib/rendercopy: Simplify reloc offsetsVille Syrjälä
Remove the hardcoded dword offsets for the relocs and instead rely fully on intel_batchbuffer_subdata_offset(). Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-07-03lib/rendercopy: Use gen8_wm_kernel__affineChris Wilson
The shaders/blit.g7a has weird artefacts (random pixel kill) when drawing to an odd destination coordinate. Rather than debug the issue with the asm/assembler, replace the kernel with the one used by SNA for simple copies. Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Tested-by: Ville Syrjälä <ville.syrjala@linux.intel.com> #chv, skl Acked-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-07-03lib: Report file cache as available system memoryChris Wilson
sysinfo() doesn't include all reclaimable memory. In particular it excludes the majority of global_node_page_state(NR_FILE_PAGES), reclaimable pages that are a copy of on-disk files It seems the only way to obtain this counter is by parsing /proc/meminfo. For comparison, check vm_enough_memory() which includes NR_FILE_PAGES as available (sadly there's no way to call vm_enough_memory() directly either!) v2: Pay attention to what one writes. v3: Trim off redundant space, and warn if the requested tags do not match the layout of /proc/meminfo. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2018-06-25Make GLib mandatoryPetri Latvala
GLib was originally made optional for Android builds, and Android support was dropped a while ago due to lack of use and maintenance. Building without GLib was broken without bug reports anyway. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-06-21Account for NULL character when using strncpyRodrigo Siqueira
This patch fix the following gcc warning: warning: ‘strncpy’ specified bound 32 equals destination size [-Wstringop-truncation] strncpy(data->name, name, PARAM_NAME_MAX_SZ); This error happens due to the '\0' character appended by strncpy. Notice that reduces by one in the total of bytes to be copied, in this case, is harmless because the strings received in the parameter already have '\0'. Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-06-19lib: sync with the newer i915_pciids.h from the Kernel (WHL + AML)José Roberto de Souza
I just copied the Kernel file into the IGT repository and updated lib/intel_device_info.c. Changes: - b9be78531d27 - drm/i915/whl: Introducing Whiskey Lake platform - e364672477a1 - drm/i915/aml: Introducing Amber Lake platform v2: Ops, I forgot to add lib/intel_device_info.c changes. Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2018-06-19lib: Conservatively include residual buffers in the available ram estimateChris Wilson
Add any buffers reported by sysinfo to the estimate of available memory. We do ask the kernel to purge it's caches before reporting sysinfo, but a few remain that may be forced out by our test usage, so include them. However, be conservative and only allow them to be swapped out. References: https://bugs.freedesktop.org/show_bug.cgi?id=105967 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2018-06-18lib: Purge os caches twice for good luckChris Wilson
If at first we don't succeed, try, try again. References: https://bugs.freedesktop.org/show_bug.cgi?id=105967 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2018-06-15lib: Bump debug information for lack-of-memory to warnChris Wilson
At present, we never see the debug output of intel_require_memory() as the debug log is not automaticaly dumped on requirement fail (only on error). Promote the igt_debug showing the meminfo/slabinfo to igt_warn so that they are visible on stderr without any trickery or --debug. References: e5829165c2ef ("lib: Dump meminfo and slabinfo if we complain about insufficient memory") References: https://bugs.freedesktop.org/show_bug.cgi?id=105967 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2018-06-14lib/gen9_render: Header cleanupLukasz Kalamarz
This patch cleans gen9 header from a duplicate definition and it dependency. Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Ewelina Musial <ewelina.musial@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-06-14lib/gen8_render: Cleanup of libsLukasz Kalamarz
This patch implements some changes in gen8_render header and all files that include it. Renamed all definition that were introduced in that file with prefix GEN8_* instead of previous GEN's one if they were not implemented there, otherwise dropped duplicates. Modified include to use gen7_render header instead of gen6. v2: Fixed commit message v3: fixed typo in commit msg Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Ewelina Musial <ewelina.musial@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-06-14lib/gen7_render: Drop duplicated definitionsLukasz Kalamarz
Dropping duplicated definitions of registers,fields and shiftsm, which were implemented in gen6 and does not changed in gen7. Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Ewelina Musial <ewelina.musial@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-06-14lib/rendercopy: Use gen6 definitions if applicableLukasz Kalamarz
Instead of using definitions duplicated in gen7_render header, we should use the oldest definition that is working with chosen gen. This patch reuses gen6 definitons if registers/fields/shifts that were reintroduced in other genX_render headers. v2: Fixed commit message v3: fixed typos in commit msg Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Ewelina Musial <ewelina.musial@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-06-14lib/gen7_render: include gen6_render headerLukasz Kalamarz
We would like to modify genX_header in the similar manner as we have in genX_media headers. This patch adds gen6 header to gen7 includes and also removes redefinition of two enums. v2: fixed commit message v3: fixed typos in commit msg Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Ewelina Musial <ewelina.musial@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-06-13lib: Extract mlock probingMichał Winiarski
We already have the routine we need in drv_suspend. Let's move it to lib and use it in the mlocking tests. We can also make it a bit faster if we tweak the initial step and initial amount. (I think it's safe to assume that we should be able to lock 3/4 of RAM, this cuts the probe time on my 32G SKL - from ~530s to ~180s) v2: Use available mem, amend step, also lock outside of fork, early exit if the assumption is wrong (Chris) Update the function name in doc (Ewelina) v3: Total for pin, available for initial lock (Chris) Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Ewelina Musial <ewelina.musial@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ewelina Musial <ewelina.musial@intel.com>
2018-06-08igt/drv_suspend: Suspend under memory pressureChris Wilson
Recently we discovered that we have a race between swapping and suspend in our resume path (we might be trying to page in an object after disabling the block devices). Let's try to exercise that by exhausting all of system memory before suspend. v2: Explicitly share the large memory area on forking to avoid running out of memory inside the suspend helpers (for they fork!) References: https://bugs.freedesktop.org/show_bug.cgi?id=106640 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tomi Sarvela <tomi.p.sarvela@intel.com> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2018-06-08lib/kms: Respect fb color_encoding/color_rangeVille Syrjälä
Configure the plane color_encoding/color_range based on what the fb contents are. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>