summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
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>
2018-06-08lib/fb: Add color_encoding/color_range to igt_fbVille Syrjälä
Make igt_fb be aware of the color encoding/range. For now we still hardcore everything to BT.709 limited range though. v2: Default to BT.709 Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2018-06-08lib: Add support for rendering into packed YCbCr framebuffersVille Syrjälä
Reuse the __convert() cairo stuff to support packed YCbCr framebuffers. v2: Allow odd fb width since some tests want it v3: Use igt_memcpy_from_wc() v4: Rebase due to color_encoding/range enums v5: Follow the fixed nv12 code v6: Use igt_format_is_yuv() Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2018-06-08lib: Use igt_matrix for ycbcr<->rgb conversionVille Syrjälä
Probably horribly inefficient (not that the original code tried to be particularly efficient), but at least this is now pretty generic so it'll be super easy to add other color encodings and whatnot. v2: Rebase v3: Deal with the new color_encoding/range enums v4: Fix the code to actually work, and do things in 2x2 blocks Keep the chroma siting comment and pimp it up a bit Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2018-06-08lib: Clean up format_descVille Syrjälä
Always populate the plane_bpp[] stuff, and use named initializers so that we can actually see what's being set to what. v2: Fix depth for xrgb8888 Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2018-06-08lib: Don't use dumb buffers for YCbCrVille Syrjälä
We don't do the "black != zero" clearing for dumb buffers, so let's not use them for YCbCr framebuffers. v2: Use igt_format_is_yuv() Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2018-06-08lib: Clear packed YUV formats to blackVille Syrjälä
As we do for NV12, let's also clear packed YUV formats to black instead of zero. Avoids unexpected green screens. v2: Nuke the debug messages v3: Use wmemset(Maarten) Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-06-07lib/igt_fb: Round to nearest when clamping rgbVille Syrjälä
I think round to nearest is maybe more correct here. Also do the clamp with integers as it actually makes the resulting code measurably faster. Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2018-06-07lib/igt_color_encoding: Appease c90Ville Syrjälä
Apparently we stil build in c90 mode or something with autotools. It doesn't like mixed code and declarations. v2: Do it the sane way (Chris) Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-06-07lib/igt_color_encoding: Use the m(row,col) macro to address the matrix cellsVille Syrjälä
Sinec the m(row,col) macro is now in igt_matrix.h let's use it when constructing the ycbcr<->rgb matrices. Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-06-06lib/igt_matrix: Unroll and inline igt_matrix_transform()Ville Syrjälä
Using the current igt_matrix for NV12 conversion ends up being about 4x as slow as the current non-igt_matrix based code. Unrolling and inlining igt_matrix_transform() improves that factor to ~1.5x. Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-06-05libs: Removal of duplicated SURFACEFORMAT definitionsLukasz Kalamarz
Patch is removing all duplicated definitions of SURFACEFORMAT from few lib headers Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
2018-06-05lib: Rename all surfaceformat calls in libsLukasz Kalamarz
This patch is renaming all surfaceformat registers to use names introduced in surfaceformat.h instead of using per gen definitions v2: Drop GEN_ from register names. Applied that to other libs. Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
2018-06-05lib/surfacestate: Creating surfaceformat headerLukasz Kalamarz
In several header files surface formats definitions were duplicated. To decrease amount of duplicated code in igt new lib was created. v2: Drop GEN_ from registers definition Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-05-31lib: Double check ring measurementChris Wilson
Check twice for the signal interrupting the execbuf, because the real world is messy. References: https://bugs.freedesktop.org/show_bug.cgi?id=106695 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2018-05-31lib: Align ring measurement to timerChris Wilson
After hitting the SIGINT from execbuf, wait until the next timer signal before trying again. This aligns the start of the ioctl to the timer, hopefully maximising the amount of time we have for processing before the next signal -- trying to prevent the case where we are scheduled out in the middle of processing and so hit the timer signal too early. References: https://bugs.freedesktop.org/show_bug.cgi?id=106695 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>
2018-05-31lib: Assert that we do manage to submit at least one batch when measuringChris Wilson
As we measure the ring size, we never expect to find we can not submit no batches at all. Assert against the unexpected. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2018-05-31intel-gpu-top: Rewrite the tool to be safe to useTvrtko Ursulin
intel-gpu-top is a dangerous tool which can hang machines due unsafe mmio register access. This patch rewrites it to use only PMU. Only overall command streamer busyness and GPU global data such as power and frequencies are included in this new version. For access to more GPU functional unit level data, an OA metric based tool like gpu-top should be used instead. v2: * Sort engines by class and instance. * Do not wait for one sampling period to display something on screen. * Move code out of the asserts. (Rinat Ibragimov) * Continuously adapt to terminal size. (Rinat Ibragimov) v3: * Change layout and precision of some field. (Chris Wilson) Eero Tamminen: * Use more user friendly engine names. * Don't error out if a counter is missing. * Add IMC read/write bandwidth. * Report minimum required kernel version. v4: * Really support 4.16 by skipping of missing engines. * Simpler and less hacky float printing. * Preserve copyright header. (Antonio Argenziano) * Simplify engines_ptr macro. (Rinat Ibragimov) v5: * Get RAPL unit from sysfs. * Consolidate sysfs paths with a macro. * Tidy error handling by carrying over and reporting errno. * Check against console height on all prints. * More readable minimum kernel version message. (Eero Tamminen) * Column banner for per engine stats. (Eero Tamminen) v6: * Man page update. (Eero Tamminen) Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Eero Tamminen <eero.t.tamminen@intel.com> Cc: Rinat Ibragimov <ibragimovrinat@mail.ru> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> # v1 Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> # v0.5 Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2018-05-24tests: Move wait_for_pageflip as library functionMika Kahola
Two tests uses the very same wait_for_pageflip() routine. These tests are 'kms_rotation_crc' and 'kms_flip_tiling'. In order to decrease code repetition, let's move this function as part of kms function collection in igt_kms. No functional changes. Signed-off-by: Mika Kahola <mika.kahola@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-05-23lib: Add igt_color_encodingVille Syrjälä
Add some helpers for generating rgb<->ycbcr conversion matrices. v2: Add enums for color_encoding/color_range Fix full range handling (lacked +-0.5<->+-1.0 scaling) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-05-23lib: Add igt_matrixVille Syrjälä
Add a helper library for basic matrix math. v2: Make the identity matrix static const (Chris) Add the m(row,col) macro (Chris) Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-05-23lib: Add clamp() to igt_aux and use it for ycbcr<->rgb conversionVille Syrjälä
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-05-23tests/kms_plane_scaling: Allow clip test to fail with YUVVille Syrjälä
YUV formats require the clipped src coordinates to be suitably aligned. We'd need to very carefully compute the unclipped dst coordinates to guarantee that. That's too much hassle so let's just accept failure in case YUV formats are used. v2: Actually remove the original igt_display_commit2() (Maarten) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> #irc
2018-05-21lib/gpgpu_fill: Create generic __gen9_gpgpu_fillfuncKatarzyna Dec
Starting from gen9 main gpgpu_fillfunc differs only with kernel parameter. Let's prepare generic __gen9 function to avoid duplicating all _fillfunc for future gens. v2: fixed indentations v3: Made __gen9_gpgpu_fillfunc static v4: rebase Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Ewelina Musial <ewelina.musial@intel.com> Reviewed-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
2018-05-21lib/media_fill: Create common media_fill library for all gensKatarzyna Dec
Let's create common media_fill library, similarly as for gpgpu_fill. This will allow to make code easier to read and maintain. Moreover we can create generic __gen9_media_fillfunc for future gens. >From gen9 media fillfunctions differ only with kernel parameter. v2: fixed indentations in files v3: Added missing copyright headers. Made __gen9_media_fillfunc static. Removed gen9 kernel (the same as for gen8). v4: rebase Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Lukasz Kalamarz <lukasz.kalamarz@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: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
2018-05-16igt: Drop Intel from the name in docs and pathsArkadiusz Hiler
This is just a simple change to reflect the actual state. No rewording yet, just a simple substitution in most visible places - docs, README and paths. There are probably some leftovers here and there, but we can let them be for now, this is already well overdue. v2: fixed couple of obvious leftovers pointed out by Petri Cc: Petri Latvala <petri.latvala@intel.com> Cc: Daniel Vetter <daniel.vetter@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Harry Wentland <harry.wentland@amd.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2018-05-15lib/igt_device: Add information why cannot drop drm masterKatarzyna Dec
Let's add additional information to igt_device_drop_master in case we try to run tests with e.g. x11 enabled. v2: Changed comment and added listing clients. v3: Changed igt_require to igt_assert. v4: Added checking if we are master already. References: https://bugs.freedesktop.org/show_bug.cgi?id=105990 Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-05-15lib: Rename library from gpu_fill to gpu_cmdsKatarzyna Dec
After refactoring media_spin library - gpu_fill contains helper functions for render copy, *_fill functions and media_spin. Let's rename this library to gpu_cmds. This name will be more general. v2: changed name from gpu_helpers to gpu_cmds Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
2018-05-15lib/gpu_fill: Further code unification in gpu_fillKatarzyna Dec
We can unify gen7_emit_vfe_state and gen8_emit_vfe_state functions for gpgpu/media_fill and media_spin by adding parameters. gen8_emit_media_object was renamed to gen_* and extended with additional offset parameters - we can have one gen7_emit_media_objects for all tests. I have renamed gen8_emit_media_object to gen_emit_*, because function belongs to all gens and it would be odd to have all named genX_* and only one without this prefix. v2: Use #defines instead of variables as emit_vfe_state parameters. Fixed gen7_emit_media_objects. Unified vfe state parameters in media_spin library for gen8 and gen9 (gen9 had different values by mistake). v3: Fixed bug in emit_vfe_state for gen8 and gen9 in gpgpu_fill. Moved #defines for emit_vfe_state to particular libraries. v4: Fixed indentations in media_spin v5: Few more style changes. Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Ewelina Musial <ewelina.musial@intel.com> Reviewed-By: Ewelina Musial <ewelina.musial@intel.com>
2018-05-15lib: Adjust media_spin and gpu_fill to our code styleKatarzyna Dec
Let's adjust code to our coding style during refactoring media_spin code. Few more changes in gpgpu_fill lib was made as well: intend align and /s/unsigned/unsigned int. v2: fixed minor typos v3: few more style changes v4: few indentation changes Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Ewelina Musial <ewelina.musial@intel.com> Reviewed-by: Ewelina Musial <ewelina.musial@intel.com>
2018-05-15lib/media_spin: Remove gen8lp_media_spin functionKatarzyna Dec
Gen8lp function are duplicates of Gen8 with difference in emit_media_objects - we cannot perform media_state_flush on CHT. Similar changes were done previously for gpgpu_fill and media_fill. v2: replaced IS_BRW and IS_CHT with IS_GEN8 v3: removed remaining 8lp spin function Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
2018-05-15lib/media_spin: Move helper functions to gpu_fill libraryKatarzyna Dec
Let's remove duplications introduced by moving media_spin helper functions to gpu_fill. These were mainly the same functions as for Gen8 media/gpgpu fill. gen8_render_flush from media_spin was replaced by gen7_render_flush. The only functions that were left intact are gen8_spin_curbe_buffer_data, gen8_emit_vfe_state_spin, gen8_emit_media_objects_spin and gen8lp_emit_media_objects_spin. v2: squashed patches 1 and 2 from v1 v3: updated commit msg Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
2018-05-14lib/audio: Replace sqrt(a*a + b*b) with hypot(a, b)Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2018-05-09lib/igt_dummyload: Fix possible NULL pointer dereferenceAntonio Argenziano
Make sure that at least one of the 'mmap' functions returns a valid pointer to avoid dereferencing a NULL pointer later on. (Issue found via coverity) v2: - Use the version of the mapping function that will assert on fail (Chris). Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk>
2018-05-08lib/intel_batchbuffer: Minor cosmetic change in copyright headerAntonio Argenziano
Removed some trailing white spaces. Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-05-07lib: create new dependency for aubdumpLionel Landwerlin
While trying to capture an aubdump on a libva demo, I run into a crash in intel_batchbuffer.c. Turn out every driver has it's own intel_batchbuffer.c with similar symbols and because aubdump pulls in libigt, things go wrong. One could argue that there is something wrong with intel-vaapi-driver's build but I also think aubdump should embed as little as possible. This change creates a very small library that embeds just the needed bits of igt for aubdump. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-05-07lib: drop drmtest dependency on intel_batchbufferLionel Landwerlin
It doesn't look like there should be a dependency there. v2: s/intel_batchbuffer/intel_reg/ v3: One more s/intel_batchbuffer/intel_reg/ in benchmarks Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>