summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2018-10-31lib: Make libunwind optional againDaniel Vetter
Apparently it's really not great to require it for a bunch of platforms. Requested by Sean and Eric. v2: Use combo option (Petri). v3: Fix the right option (Petri) v4: try a bit harder ... v5: Even more simplification (Dylan) Cc: Dylan Baker <dylan@pnwbakers.com> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net> (v1) Reviewed-by: Petri Latvala <petri.latvala@intel.com> Cc: Sean Paul <sean@poorly.run> Cc: Eric Anholt <eric@anholt.net> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2018-10-26lib/kmod: Unload snd_hdmi_lpe_audioVille Syrjälä
Unload the snd_hdmi_lpe_audio module. Otherwise i915 can't be unloaded. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-10-25kms_content_protection: Add Content Protection testRamalingam C
Pretty simple test: - picks the hdcp capable output with suitable pipe and apply modeset. - checks the connected sink's hdcp capability through debugfs - apply a FB and wait for the flip completion. - clears the content protection property - verifies that it clears - sets the content protection property to desired - verifies that it transitions to enabled - incase of timeout three reattempts are implemented - clear the content protection property and modeset on the crtc Above steps are repeated on all HDCP capable connectors for both legacy and atomic subtests. v2: dynamic subtests are dropped [Daniel] v3: debugfs is used to detect the sink's hdcp capability [Daniel] data structure is made as global variable. v4: debugfs file from connector's debugfs dir is used [Daniel] v5: i915_debugfs_connector_dir() usage is modified [Chris] Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-10-25lib/debugfs: function to open connector debugfs dirRamalingam C
Function to open a debugfs directory of a connector associated to a device. v2: instead of string manipulation openat used [Chris] Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-10-17lib: Don't call igt_require_fb_modifiers() when no modifierDeepak Rawat
vmwgfx and amdgpu doesn't support fb modifiers, yet kms_addfb() requires modifier support. Since many tests don't need this to run, the requirement can be made less broad. Therefore, tighten the requirement to cases where modifiers are actually needed. v2: * In create_fb() calls to kms_addfb(), remove the modifier flag iff the driver doesn't support modifiers and the modifer is 0 * Don't modify the flag in kms_addfb(). Signed-off-by: Deepak Rawat <drawat@vmware.com> Signed-off-by: Leo Li <sunpeng.li@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-10-17lib/igt_fb: Check for cairo surface successDeepak Rawat
For vmwgfx cairo surface creation fails due to stride mismatch, add a igt_require_f() for surface. v2: Check for surface creation failure. Signed-off-by: Deepak Rawat <drawat@vmware.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-10-17lib/igt_fb: Call dumb_destroy ioctl in case of dumb buffersDeepak Rawat
vmwgfx does not support GEM interface so calling gem_close on vmwgfx results in error. v2: Use drmIoctl with error when ioctl() failed. v3: Seperate ioctl wrapper. Signed-off-by: Deepak Rawat <drawat@vmware.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-10-16lib/chamelium: Check drmModeGetResources()Chris Wilson
If KMS is not available, drmModeGetResoures() reports NULL and so we cannot use this device to find the chamelium connector. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
2018-10-16lib: Skip tests that require fb modifiers when KMS is disabledJosé Roberto de Souza
When KMS is disabled, drmGetCap() for DRM_CAP_ADDFB2_MODIFIERS() will return -1 and set errno as EOPNOTSUPP, the current assert was only checking for a sucess result or invalid argument causing prime_vgem@basic-fence-flip test to fail when KMS is disabled. Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: José Roberto de Souza <jose.souza@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2018-10-15lib: sync i915_pciids.h with kernelRodrigo Vivi
One more AML ID added and WHL IDs reorganized. Align with commit c0c46ca461f1 ("drm/i915/aml: Add new Amber Lake PCI ID"), including commit c1c8f6fa731b ("drm/i915: Redefine some Whiskey Lake SKUs") v2: Also sync intel_device_info.c (CI and Jose) Cc: José Roberto de Souza <jose.souza@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
2018-10-15libs: Add rendercopy support for GEN11Kalamarz, Lukasz
This patch introduces a render copy shader for GEN11. The plumbing is same as with GEN9, so we can reuse it, extracting the common parts, and wrapping it in GEN-specific helpers. v2: Added gen11 shader source path next to its binary form Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Michał Winiarski <michal.winiarski@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Lucas De Marchi <lucas.demarchi@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-10-08fb: Add more formatsMaxime Ripard
We're going to need some DRM formats, and we're going to need the igt_fb code to handle them. Since it relies on the format_desc structure to map the DRM fourcc to the pixman and cairo formats, we need to add these new formats to that structure. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-10-08fb: Add support for conversions through pixmanMaxime Ripard
Pixman allows for much more conversions than cairo, and we don't want to open code conversions routine for the common formats. Let's plug pixman in our conversion function so that we can benefit from it when possible. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
2018-10-08igt: Make pixman mandatoryMaxime Ripard
So far, pixman was used exclusively when the Chamelium support was enabled. However, since we're going to use it as one of the backend to do the igt_fb conversions between formats, we'll need it all the time. Make that explicit. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-10-08fb: Add format conversion routineMaxime Ripard
The chamelium format subtests will need to convert the reference pattern to the format to be tested on the DRM device. However, Cairo is very limited when it comes to format, and while pixman has much more support for formats, it's still falling short compared to what DRM exposes, especially on the YUV side. Plus, since we want to run CRC checks on the frame, we can't afford having conversions back and forth between RGB24, as the current API is doing. In order to abstract this away, let's create a function that will convert a igt_fb structure to another DRM format and return the converted igt_fb. For now, we will use only cairo to do the conversion, but we will use other libraries or roll our own routines to convert to more exotic formats and abstract it away from the users. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
2018-10-08fb: Create common function to convert frame formatsMaxime Ripard
The current code to convert between two buffer formats is quite tied to the cairo surface infrastructure. Since we'll want to reuse it, make that function more generic by introducing a common structure that passes all the arguments and a common function that will call the right functions we needed. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
2018-10-08fb: convert: Remove swizzle from the argumentsMaxime Ripard
Since it can be inferred from the framebuffer that is already given as an argument, it is redundant and can be removed. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
2018-10-08fb: Use an igt_fb for the cairo shadow bufferMaxime Ripard
In the case where an igt_fb user wants to get a cairo surface out of that framebuffer, if the format of that framebuffer cannot be imported as-is in Cairo, the current code will do an anonymous mapping to create a shadow buffer where an RGB24 copy of that buffer will be created. However, making that shadow buffer into an igt_fb itself will help us do further improvements on the conversion code. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-10-08fb: Add RGB888 formatMaxime Ripard
The RGB888 format is the one used as the shadow buffer used when a cairo surface is requested for a format that Cairo cannot handle. Since we're going to move that buffer representation to a struct igt_fb, let's add the RGB888 format to the list of formats that igt_fb knows about. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-10-08fb: Only set the GEM domain on intel platformsMaxime Ripard
The gem_set_domain call uses an i915 specific ioctl that will fail on anything else. Let's move that call under a check for whether or not we're running on an intel platform. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-10-08fb: Add buffer map/unmap functionsMaxime Ripard
The current code to manipulate the buffer has the assumption that we can create an underlying cairo instance. However, when it comes to supporting various formats, cairo is very limited so we would need to decouple the buffer access from cairo surfaces. Let's create a function that allows to map the underlying GEM buffer from an igt_fb structure, which will then allow use to manipulate as we wish. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
2018-10-04lib/i915: Move shaders directoryKatarzyna Dec
In shaders/ directory we got Intel specific information. As igt is a project for more vendors, let's move this directory to lib/i915. v2: Changed shaders directory path in library files comments. Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Kalamarz Lukasz <lukasz.kalamarz@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-10-03lib/kms: Handle no connectors for igt_enable_connectors()Chris Wilson
Take the device fd from the caller as to which card we should try and enable connectors for (or else we may not enable the right connectors for the test!) and fail gracefully if there is no kms support on the device. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2018-10-02tests: Add kms plane alpha blending test, v2.Maarten Lankhorst
Add a few tests to test various blending modes. Some of the tests will skip if pixel mode alpha cannot be enabled with plane alpha at the same time. This is for mali-dp. I didn't test on that platform, but tested with the same check on i915. The tests won't pass i915 on pre-gen11 hw. i915 has small rounding errors with 0xff and 0x00 alpha, which gives CRC mismatches. Changes since v1: - Send the correct version, with the skips for mali-dp in place. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-10-01lib/kms: Skip no-op display updatesChris Wilson
If the display is disabled (e.g. the driver has disabled the KMS interface) there is nothing to do so avoid failing. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>
2018-10-01lib: Report if kms is enabled on the displayChris Wilson
Some drivers may have disabled KMS or there may simply nothing attached to the device. In either case KMS is unusable and we may prefer to skip. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>
2018-09-28tests/psr: Check for PSR entry less frequentlyDhinakaran Pandiyan
We currently read debugfs every 1 ms, given that it takes about 140 ms for PSR entry on the CI machines and entry can occur at frame time intervals, bump the debugfs read interval to 20 ms. Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
2018-09-28tests/psr: Wait for PSR exitDhinakaran Pandiyan
PSR appears to not exit immediately after the test commits a page flip, give some leeway for PSR to idle. Let's set the timeout at 40 ms with a 5 ms interval between each status read. Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
2018-09-27lib/igt_fb: Refactor blitter usageVille Syrjälä
Deduplicate the blitter code. Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2018-09-27lib/igt_fb: Pass around igt_fb internallyVille Syrjälä
Instead of passing around a boatload of integers everywhere let's just pass around the igt_fb struct. That obviously means we have to populate it first sufficiently, to which end we'll add a small helper. Later on the stride/size calculations will consult the already pre-populated igt_fb and fill in the rest as needed. This makes the whole thing a lot less error prone as it's impossible to accidentally pass the arguments in the wrong order when there's just the one of them, and it's a pointer. v2: Rebase due to uint64_t size Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2018-09-27lib/igt_fb: Constify format_desc_structVille Syrjälä
We don't want anyone to modify the format description structures. Make them const. Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2018-09-27lib/igt_fb: Consolidate fb size calculation to one functionVille Syrjälä
Eliminate the planar vs. packed size calculation differences and just use one function for the entire thing. v2: Rebase due to uint64_t size Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2018-09-27lib/igt_fb: Extract calc_plane_stride()Ville Syrjälä
Extract the stride calculation from calc_fb_size_packed() to its own thing so that we can use it to calculate just the stride. v2: Rebase due to overflow fixes and roundup_power_of_two() Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2018-09-27lib/debugfs: Use a blocking read in igt_pipe_crc_get_single()Ville Syrjälä
All users of igt_pipe_crc_get_single() want a blocking read even if the fd was opened in nonblocking mode. Make it so. v2: Fix the docs for igt_pipe_crc_get_single() 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: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2018-09-26lib/gpgpu_fill: Implement gpgpu_fillfunc for Gen11Katarzyna Dec
Added gen11_gpgpu_fillfunc to have gpgpu_fill passing on Gen11. Gpgpu shader was generated using IGA (Intel Graphics Assembler) based on binary found in lib/gpgpu_fill.c to match the changes in Gen11 HW: Changed 'mul' instruction to 'shl' (since Gen11 'mul' does not support integer values for both src and dest). Changed SEND message descriptor (it should have length 2 not 3). Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Tested-by: José Roberto de Souza <jose.souza@intel.com> Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Acked-by: Katarzyna Dec <katarzyna.dec@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2018-09-26lib: Reuse Gen9 mediafill on Gen11Daniele Ceraolo Spurio
We can reuse gen9 mediafill function, because no changes are required to support Gen11. Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Lucas De Marchi <lucas.demarchi@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Tested-by: José Roberto de Souza <jose.souza@intel.com> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Acked-by: Katarzyna Dec <katarzyna.dec@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2018-09-26lib: Unexport gem_gtt_type()Chris Wilson
Nobody uses the function directly, instead using the various helpers to determine if ppgtt is present. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2018-09-25lib/igt_fb: Remove the hand rolled addfb2Ville Syrjälä
Just use __kms_addfb() always instead of hand rolling another drmModeAddFB2() usage. __kms_addfb() demands support for modifiers but we've had that for a long time now so it's not a problem. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2018-09-25lib/kms: Pass the number of planes explicitly to __kms_addfb()Ville Syrjälä
Currently __kms_addfb() assumes that only the first plane can be at offset 0. I don't particularly like such assumptions so let's just pass in the number of planes explicitly. We'll also require offsets[] to be passed in always. Nothing really to gain by making it optional. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2018-09-25lib/kms: Pass strides[] to __kms_addfbVille Syrjälä
Make __kms_addfb() usable with planar formats by passing in the stride for each plane. v2: Handle strides[1] for planar formats in kms_available_modes_crc Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2018-09-25lib/igt_fb: Add fb_num_planes()Ville Syrjälä
Add a helper to return the number of color planes. We'll need this for ccs support later. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2018-09-25lib/igt_fb: Add fb_plane_bpp()Ville Syrjälä
Add another helper to get the bpp for a specific color plane. We'll need this for ccs support later. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2018-09-25lib/igt_fb: s/planar_foo/fb_plane_foo/Ville Syrjälä
Rename the planar_foo() functions to fb_plane_foo(). Makes it clear they're perfectly usable with non-planar formats too. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2018-09-25lib/igt_fb: Pass fb_blit_upload to free_linear_mapping()Ville Syrjälä
With fb_blit_upload now being the base class of fb_convert_blit_upload we can pass the entire structure down to free_linear_mapping(). Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2018-09-25lib/igt_fb: Use fb_blit_upload as the base class for fb_convert_blit_uploadVille Syrjälä
fb_blit_upload already has everything we need, so let's use it as the base class for fb_convert_blit_upload. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2018-09-25lib: Add DIV_ROUND_UP()Ville Syrjälä
Add DIV_ROUND_UP() and replace some hand rolled versions with it. v2: Drop the duplicate from gem_render_copy() (Paulo) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2018-09-25lib/igt_fb: Respect the users choice of strideVille Syrjälä
We prented to allow the caller to specify the stride explicitly for the fb. But we don't actually use that user specified stride when we calculate the require bo size. Fix that oversight. v2: Rebased due to uint64_t size Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2018-09-20lib/igt_psr: Give a explicit parameter name to functions that expect debugfs fdJosé Roberto de Souza
Let's rename to debugfs_fd all the parameters of the functions that expect debugfs fd to avoid call one those functions with the wrong file descriptor. Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2018-09-14intel: Be consistent with test results on simulationTvrtko Ursulin
Tests which call intel_require_memory currently always skip on simulation, unless they fail first due insufficient memory. This can create different outcomes depending on the simulation environment so move the simulation skip to the start of the function for 100% consistency in results. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-09-14igt_sysfs: Avoid double closing the fd in igt_sysfs_scanfTvrtko Ursulin
fdopen takes ownership of the fd so only one flavour of closing it is needed. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>