summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2019-01-21lib/drmtest: Don't read from NULL in set_forced_driverPetri Latvala
The only caller so far never passes NULL so no effects today. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
2019-01-21lib/igt_core: Initialize fds in igt_system_quietPetri Latvala
This avoids calling close() with uninitialized ints if some dup() calls succeed and others don't. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com> Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2019-01-21lib/igt_core: Handle all failures to read .igtrcPetri Latvala
Parse error is not the only way to fail loading the file. A common other error is the file not existing. Handle all failures to read .igtrc by releasing the key store immediately. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
2019-01-21lib/igt_core: Assert that optarg is presentPetri Latvala
If getopt_long is told an argument is required, it will give it. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2019-01-21lib/igt_audio: Initialize freq in audio_signal_detect()Petri Latvala
It's not clear to the static analyzer that freq is assigned when handling the previous frame and then used in the next. In fact, it wasn't clear to me either before staring at the code for some minutes. Initializing it to something makes both of us happier. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
2019-01-21lib/igt_alsa: Remove dead assignmentPetri Latvala
The execution can only reach the end (goto complete) or the new unconditional assignment a few lines below before the value is read again. Either it's really a dead assignment, or there's a bug with the execution flow. Leaning on the former. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
2019-01-21lib/igt_kms: Assert that active crtcs have at least one planePetri Latvala
Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Mika Kahola <mika.kahola@intel.com> Cc: Robert Foss <robert.foss@collabora.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2019-01-21lib/igt_kms: Make igt_display_init require at least one planePetri Latvala
Not only will the following calloc call end up allocating 0 bytes (undefined behaviour), but last_plane becomes (uint8_t)-1. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Robert Foss <robert.foss@collabora.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Robert Foss <robert.foss@collabora.com>
2019-01-21lib: Avoid memcpying 0 bytes from NULLPetri Latvala
The behaviour of memcpying 0 bytes from NULL is semantically sound, but still undefined behaviour. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2019-01-21lib/igt_kms: Use correct type for callocPetri Latvala
The type mismatch was char vs. unsigned char, both being size 1 so this didn't cause any actual issues other than noise in static analysis that doesn't believe 1 is equal to another type of 1. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com> Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2019-01-21lib/ioctl_wrappers: Help static analysis with execution flowPetri Latvala
If an ioctl fails, errno is set to non-zero, and static analysis doesn't quite get it. Add igt_assume()s where applicable. v2: Braces on both branches of an if (Chris) Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-01-21lib/i915/gem_context: Help static analysis with execution flowPetri Latvala
If an igt_ioctl fails, errno is set to non-zero, and static analysis doesn't quite get it. Add an igt_assume() to help. v2: Braces on both branches of an if (Chris) Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-01-21lib: Introduce BUILD_BUG_ON_INVALID and igt_assume()Petri Latvala
BUILD_BUG_ON_INVALID() is a macro that, like the kernel counterpart, expands to an expression that generates no code. Useful for making sure an expression is valid code while producing no side effects. igt_assume() is an assert-like macro that is used to give hints to static analysis of code. If static analysis is not used (as detected by STATIC_ANALYSIS_BUILD), igt_assume() expands to a BUILD_BUG_ON_INVALID, otherwise expands to an assert(). v2: Make sure the expression in igt_assume is still parsed without static analysis. (Chris) v3: Also introduce BUILD_BUG_ON_INVALID as standalone Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-01-18lib/igt_debugfs: Unify crc collectionMika Kahola
For one shot crc collection, let's use the same helper function as we use for continuous crc collection. With this patch, we first drain the pipe from queued crc values and read the fresh crc. v2: We don't need to drain the pipe right after we start collecting crc's (Dhinakaran) Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: Mika Kahola <mika.kahola@intel.com>
2019-01-16igt/drv_missed_irq: Skip if the kernel reports no rings available to testChris Wilson
Some setups (e.g. guc and gen10+) can not disable the MI_USER_INTERRUPT generation and so can not simulate missed interrupts. These tests would fail, so skip when the kernel reports no tests available. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2019-01-16lib/ioctl_wrapper: Implement __gem_mmapLukasz Kalamarz
Previous implementation of __gem_mmap__cpu and __gem_mmap_wc only differ with setting proper flag for caching. This patch implement __gem_mmap, which merge those two functions into one v2: Reordered and splited this patch into two separete patches v3: Dropped unnecessary check v4: Remerge patches again and fixed __gem_mmap description Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Michal Winiarski <michal.winiarski@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-01-16lib/igt_dummyload: use gem_mmap__cpu and gem_mmap__wc when applicableLukasz Kalamarz
We had some duplicates in code that are using direct call to __gem_mmap__cpu or __gem_mmap__wc and then assert it result, which is what gem_mmap__cpu and gem_mmap__wc is taking care for us. v2: Rebased and reordered this patch in series v4: Rebase Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Michal Winiarski <michal.winiarski@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
2019-01-16lib/ioctl_wrapper: use defines for get_param instead of param numberLukasz Kalamarz
In lib code there were few functions using param number instead of defines. We would like to use defines, since they are providing more information to user comparing to param number. v2: Rebased patch v4: Fixed commit message Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Michal Winiarski <michal.winiarski@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
2019-01-14tests/psr: Share the code check if sink supports PSRJosé Roberto de Souza
The same code checking if sink supports PSR was spread into 3 tests, better move it to lib and reuse. v2: splitted previous patch into this one and the next one(Dhinakaran) Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2019-01-14lib/psr: Add a macro with the maximum lenght of i915_edp_psr_status and use itJosé Roberto de Souza
So every function reading i915_edp_psr_status can allocate a buffer long enough. Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2019-01-14lib/igt_edid_template: Fix parenthesis for vertical pulse codingPaul Kocialkowski
Add missing parenthesis in the macro coding the vertical pulse high bits. Without them, the shift takes precedence over the logical and operation, which is not how these bits should be coded according to the spec. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-01-14Make force work with multiple drivers availableRodrigo Siqueira
The force option allows users to specify which driver they want that IGT uses. Nonetheless, if the user has two or more loaded drivers in his system, the force option will not work as expected because IGT will take the first driver found at /dev/dri. This problem can be reproduced in a QEMU VM that using Bochs and VKMS. This patch handles this scenario by ensuring that IGT uses the forced module specified via IGT_FORCE_DRIVER. Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2019-01-14igt/sysfs: drop support for passing -1 fd for IntelJani Nikula
The rabbit hole goes deep in this case, but I couldn't find any place where we'd still rely on -1 for Intel. Drop the remaining support to prevent anyone adding new code using this. Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2019-01-10lib/sysfs: Repair override of params with -1Chris Wilson
Commit e27626898b87 ("igt: Check the physical swizzle status") stopped trying to chase the parameters from the device sysfs, entirely by accident. Make it a tiny bit more robust by forgiving the sysfs device not being present and jumping to the /sys/module + driver name param lookup fallback. Reported-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
2019-01-10lib/fb: Fix rgb24 to nv12 conversionPetri Latvala
A typo fix in 1x2 pixel block conversion code, revealed by GCC 9 Fixes: 1c7ef3890045 ("lib: Use igt_matrix for ycbcr<->rgb conversion") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109257 Reported-by: Martin Liska <mliska@suse.cz> Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2018-12-31lib/igt_fb: Add a check on stride alignment for pixman conversionPaul Kocialkowski
Pixman requires buffer strides the be aligned to 32-bit words in order to create internal representations of buffers. If this condition is not met, it will fail and IGT will not be able to report the error cause, making it hard to debug the issue. Add an explicit check in our code prior to calling pixman when converting buffer so that the error can be understood if it occurs. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
2018-12-31chamelium: Debug-print CRCs when comparing them and dumping framesPaul Kocialkowski
Add debug prints for the reference and captured CRCs when comparing them and dumping them, which can be useful to get an idea of what is going on (e.g. specific noise on display cables often only changes one of the values that compose the CRC). It's also useful to associate a test debug output with the dumped pictures (that have the CRC in their name). Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
2018-12-27lib/kms: Fix documentation for for_each_pipe_staticPetri Latvala
The documentation block was copypasted from for_each_pipe without changing the name. A drive-by typo fix to for_each_pipe's docs is included. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-12-21lib/fb: Remove unused variablesPetri Latvala
../lib/igt_fb.c: In function ‘convert_rgb24_to_yuv444’: ../lib/igt_fb.c:1720:16: warning: unused variable ‘v’ [-Wunused-variable] float y, u, v; ^ ../lib/igt_fb.c:1720:13: warning: unused variable ‘u’ [-Wunused-variable] float y, u, v; ^ ../lib/igt_fb.c:1720:10: warning: unused variable ‘y’ [-Wunused-variable] float y, u, v; ^ Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
2018-12-20Add support for forcing a specific driverPetri Latvala
This commit adds a new option for forcing the use of a specific driver indicated via an environment variable. v2 (Petri): - Use an environment variable instead of command line - Refactor the loop in __open_device - Don't try to load kernel modules v3 (Petri): - Rebase and adjust to the driver loading changes Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: gustavo@padovan.org Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
2018-12-18lib/igt_fb: Added XYUV8888 format support for testingStanislav Lisovskiy
XYUV8888 format support has been added to DRM, modified IGT to reflect those changes. v2: Fixed merge conflict, started to use new yuv<=>rgb conversion functions. v3: Fixed kms_available_modes_crc test to support new XYUV format. Fixed a problem, where test complains that two outputs might use same pipe at the same time. v4: Fixed convertion procedure in igt_fb to support XYUV properly. v5: Fixed a coding typo. v6: Set depth equal to -1 for XYUV format in order to prevent it to be used by igt_bpp_depth_to_drm_format, as we do not want YUV formats to be used in that case. v7: Fix "black" color initialization for create_bo_for_fb with proper value. Changed naming "planar_stride" to "xyuv_stride". v8: Change naming from DRM_FORMAT_XYUV to DRM_FORMAT_XYUV8888 v9: Fixed compilation errors by rebasing to recent master. v10: Adding reference to correspondent kernel commit with the new format in include/drm-uapi v11: Removed unnecessary sizeof's in rgb <=> yuv444 convert functions. v12: Rebased against master branch, fixed rebase conflict caused by new fb_convert functions. Removed drm kernel commit reference as it is still not merged, so doesn't make sense to use it. v13: Resolved one more rebase conflict. Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2018-12-10lib/kms: Enable outputs by default in igt_require_displayDaniel Vetter
More testing, automatically when using the high-level kms helpers! Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2018-11-27lib/igt_kms: Fill the plane format/mod information for pre-blobifier driversVille Syrjälä
For drivers that don't support the IN_FORMATS blob we should just consult the format list returned by getplane. Since we can't know which modifiers are supported we'll assume linear-only. Obviously that may not work for every driver out there, but not much more we can do unless we start to actually probing with addfb. Cc: Ulrich Hecht <ulrich.hecht+renesas@gmail.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
2018-11-27v3d_*: Add new tests for the V3D UABI.Eric Anholt
These are basic non-rendering tests of the UABI. Signed-off-by: Eric Anholt <eric@anholt.net> Acked-by: Petri Latvala <petri.latvala@intel.com>
2018-11-27lib: Show stacktrace when terminated by runnerChris Wilson
The igt_runner sends a SIGTERM to ask the test to cleanly exit upon an external timeout. It is useful to know what the code was doing when the timeout occurred, just in case it was unexpectedly stuck. However, since we use SIGTERM internally to marshal helper processes, we want to keep SIGTERM quiet, and so opt to use SIGQUIT for the timeout request instead. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2018-11-27lib/kms: warn if we commit without outputsDaniel Vetter
With the high-level helpers requiring outputs there's not point in silently ignoring issues anymore. Complain about that if it ever happens. This reverts commit 212b71372bfbb73663d872df31118d6b396ada4f Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Fri Sep 14 21:03:38 2018 +0100 lib/kms: Skip no-op display updates which created an in my opinion serious API issue by silently dropping possible errors on the floor. Instead of silently second guess what the test might have wanted to do in the absence of display outputs it's much better to be explicit, and enforce that. v2: Improve commit message. v3: Switch to an assert and update comments, to make it clear this is igt_display api abuse (Arek). Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> (v2) Acked-By: Antonio Argenziano <antonio.argenziano@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2018-11-27lib/kms: Drop igt_display_initDaniel Vetter
If you need the high-level functions, then you probably need a full display. Unexport the non-requiring version, and adjust the documentation. This also gives us proper docs for the recently added igt_display_require. Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Acked-By: Antonio Argenziano <antonio.argenziano@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2018-11-27tests: Use igt_display_requireDaniel Vetter
Remaining tests that have been overlooked and don't need any invasive changes to limit the skipping to only the relevant parts. v2: [A rebase gone wrong] v3: Move the misplaced hunk to the right patch (Antonio). v4: Rebase, kms_content_protection is new. v5: Rebase - need to adjust kms_lease.c too. Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> (v3) Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Acked-By: Antonio Argenziano <antonio.argenziano@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-11-26v3d: Add a helper libraryEric Anholt
Just a few little ioctl wrappers that v3d tests will use. v2: Move the struct above the prototypes. Signed-off-by: Eric Anholt <eric@anholt.net> Acked-by: Petri Latvala <petri.latvala@intel.com> (v1)
2018-11-23igt/gem_exec_capture: Capture many, many objectsChris Wilson
Exercise O(N^2) behaviour in reading the error state, and push it to the extreme. Reported-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-11-20lib/igt_draw: Pass bpp along to rendercopy.Maarten Lankhorst
Now that rendercopy can perform copies for 8 bpp and 16 bpp, there's no reason we have to skip on odd x/w any more for 16 bpp. Pass the correct bpp to rendercopy, and prevent tests from skipping. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> [mlankhorst: set src_buf.bpp to tmp.bpp (Ville)] Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-11-20lib/rendercopy: Implement support for 8/16 bppMaarten Lankhorst
To handle drawing 16 bpp formats correctly with odd x/w, we need to use the correct bpp to rendercopy. Now that everything sets bpp in igt_buf, fix the rendercopy support to use it and set the correct format. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> [mlankhorst: Add assert(src->bpp == dst->bpp)]
2018-11-20lib/batchbuffer: Set bpp in igt_buf.Maarten Lankhorst
We want to allow bpp = 8 or 16, so make sure we set the bpp in igt_buf. This way we can extend rendercopy to support other values for bpp. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> [mlankhorst: Fix double ;; (Ville] Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-11-19lib/igt_fb: Fix -Werror=missing-braces compilation on clang.Maarten Lankhorst
Clang fails to compile with: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces] Make the initializer empty to fix this issue. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com> #irc
2018-11-16lib/igt_draw: Only skip when width/x is not a multiple of 2.Maarten Lankhorst
Y and height have no such restrictions, since pixel size has no relation to height. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-11-05lib/igt_fb: Generalize the slow read from gtt mmap handlingVille Syrjälä
Make the handling of slow gtt mmap reads generic, and extend it to the pixman converter. Makes the pixman path a bit faster. With testing just XRGB8888 and XBGR8888 on KBL: $ time kms_plane --r pixel-format-pipe-A-planes - real 0m18,757s + real 0m2,635s v2: Use the original src buffer if the malloc fails (Chris) Drop the duplicated comment about things being slow Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Maxime Ripard <maxime.ripard@bootlin.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2018-11-05lib/igt_fb: Use linear.fb in the converterVille Syrjälä
The converter operates between the linear and shadow fbs. When using the blitter path there is no particular reason to assume that the linear fb and actual fb have the same strides for instance. Thus consulting the actual fb for metadata is not really correct. We can also simplify the mmap() path by copying all the original fb metadata into linear.fb as there we map the original fb directly. We just have to keep clearing linear.fb.gem_handle so that the dtor knows which kind of beast it's got. Cc: Maxime Ripard <maxime.ripard@bootlin.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
2018-11-05lib/igt_fb: Assert converted formats harderVille Syrjälä
Add more asserts to make sure the converted formats are correct. Cc: Maxime Ripard <maxime.ripard@bootlin.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
2018-11-05lib/igt_fb: Fix the pixman converterVille Syrjälä
Cairo doesn't do RGB888. The shadow buffer must be in XRGB888 (which is what our YUV converters also assume). We did calculate the shadow stride/size with four bytes per pixel, but we just put the wrong format in the fb metadata. Cc: Maxime Ripard <maxime.ripard@bootlin.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
2018-11-05docs: Remove incorrect reference to i915Petri Latvala
While true that subtest listing doesn't require the i915 driver, same applies to any driver or platform. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>