summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2019-04-04lib/igt_kms: Clear pipe color management properties on reset.Maarten Lankhorst
Just like we try to sanitize all properties in igt_plane_reset, we should do the same for pipe properties. Loading a wrong lut could affect passing and failing tests, so we need to be careful and set sane defaults for everything. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2019-04-01tests/plane_lowres: Test each plane individuallyJosé Roberto de Souza
ICL has some many planes per pipe that it is causing this test to skip due bandwidth limitation when combined with 4K displays. The objective of this test is test the visibility of the planes when switching between high and low resolution, more information in the patch that added this test 12e34d8c909a ("tests/kms_plane_lowres: Plane visibility after atomic modesets"). So it was setting all the planes the tested pipe in the bottom left of the display using the height of high resolution, checking the visibility and then switching to the low resolution mode and checking again the visibility and now it is expected that all planes would be invisible. So to overcome ICL bandwidth issues, here it is testing each plane individually. Reviewed-by: Mika Kahola <mika.kahola@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Mika Kahola <mika.kahola@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2019-04-01lib: Share the 1024x768 mode among testsJosé Roberto de Souza
Three test were duplicating this 1024x768 mode so lets move it to lib and share it. Reviewed-by: Mika Kahola <mika.kahola@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2019-03-29Revert "lib/igt_device: Move intel_get_pci_device under igt_device"Ville Syrjälä
One significant usecase for intel_reg/etc. is to be able to examine the hardware state *before* loading the driver. If the tool forces the driver to load we've totally lost that capability. This reverts commit 8ae86621d6fff60b6e20c6b0f9b336785c935b0f. Cc: Michał Winiarski <michal.winiarski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Michał Winiarski <michal.winiarski@intel.com>
2019-03-29lib/igt_fb: Add support for Y410/Y416 formats, v5.Maarten Lankhorst
Y410 is packed with compressed a channel and only 32 bpp, like 10 bits RGB formats. Y416 is a packed 16 bits per component format. Changes since v1: - Rebase on top of upstream YUV changes. Changes since v2: - Discard alpha channel, not used upstream. Changes since v3: - Handle the XVYU formats and Y41x formats correctly. Changes since v4: - Fix YUV conversion routines. (Ville) - Use memset64 to clear initial fb. (Ville) Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> [mlankhorst: Add missing ULL (Ville) Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-03-29lib/igt_fb: Add support for Y21x formats as well, v3.Maarten Lankhorst
Those formats are packed like YUYV, but only 16 bits per component. Changes since v1: - Rebase on top of upstream YUV changes. Changes since v2: - Use drm_fourcc.h from upstream. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-03-27lib/igt_fb: Align min_stride to 256 bytes for YUV buffers on amdgpuNicholas Kazlauskas
The chroma address needs to be 256 byte aligned on amdgpu and the easiest way to do so is to align the minimum stride for the luma. v2: added this patch Cc: Leo Li <sunpeng.li@amd.com> Cc: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
2019-03-27lib/debugfs: Don't do CRC sanity checks on amdgpuNicholas Kazlauskas
A black FB on amdgpu returns a CRC of (0, 0, 0), which IGT considers suspicious. All our CRC values are also 16-bit so a value of 0xffffffff can't be obtained. Drop the suspicious CRC checks on amdgpu by checking the device in crc_sanity_checks. We need the drm_fd for this so pass in pipe_crc to the function to get it. It makes more sense to me to do it this way than to duplicate code and the explanation on both calls to crc_sanity_checks. v2: rebase Cc: Leo Li <sunpeng.li@amd.com> Cc: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
2019-03-27lib/drmtest: Add helpers to check and require amdgpuNicholas Kazlauskas
These helpers will be used to address amdgpu specific quirks and features. They're implemented like the i915 and VC4 helpers. In order for the string comparison to pick up "amdgpu" the buffer size had to be expanded for __is_device. I've gone ahead and made it 12 bytes to cover everything that's there right now. v2: rebase Cc: Leo Li <sunpeng.li@amd.com> Cc: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
2019-03-26lib/i915: Improve gem_context error messagesChris Wilson
Avoid embedding the DRM_IOCTL() macro into the error message as it is unreadable, and instead always wrap the ioctl with a self-descriptive helper. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2019-03-26lib: Add GPU power measurementChris Wilson
Read the RAPL power metrics courtesy of perf. Or your local HW equivalent? v2: uselocale() v3: Use gpu_power_s(), gpu_power_J(), gpu_power_W() to try and make the scale factors self-consistent. v4: Use igt_sysfs v5: s/tN/sampleN/ 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>
2019-03-26lib/intel_batchbuffer: Media VME kernel is valid only for Gen11Tvrtko Ursulin
Do not use it on older gens. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109612 Cc: Tony Ye <tony.ye@intel.com> Reviewed-by: Tony Ye <tony.ye@intel.com>
2019-03-25lib: sync with the newer i915_pciids.h from the KernelAnusha Srivatsa
Add CML IDS, an additional ICL ID and EHL. Align with kernel commits: a7b4deeb02b9 ("drm/i915/cml: Add CML PCI IDS") 9a751b999d17 ("drm/i915: Add new ICL PCI ID") 29f3863d33d1 ("drm/i915/ehl: Add EHL platform info and PCI IDs") This is in sync with kernel header as of b024ab9b2d3a ("drm/i915/bios: iterate over child devices to initialize ddi_port_info") v2: Copy header from kernel (Jose) - Change commit message (Lucas) v3: Add corresponding kernel commit ids (Antonio) v4: Add EHL (Lucas) Cc: Antonio Argenziano <antonio.argenziano@intel.com> Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
2019-03-20lib/igt_fb: Switch to using is_ccs_modifier() wrapperDhinakaran Pandiyan
A linear mapping setup for Y, Yf tiled and CCS modifiers. Instead of checking against each CCS modifier, let's make use of this wrapper. Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-03-20lib/igt_device: Move intel_get_pci_device under igt_deviceMichał Winiarski
It allows us to make things a little bit more generic. Also, we now require fd rather than doing guesswork when it comes to pci address. v2: Use readlinkat rather than string concat, move stuff around, provide a version that does not assert. (Chris) v3: Print addr on failure, avoid assignment in conditionals. (Chris) Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-03-20lib/igt_sysfs: Simplify obtaining sysfs pathMichał Winiarski
Now that we've extracted card index, we no longer have the need to iterate over device nodes. v2: Drop ret. Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-03-20lib/igt_sysfs: Remove idx from sysfs_openMichał Winiarski
Similar to sysfs_path - more explicit more better. Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-03-20lib: Kill drm_get_card()Michał Winiarski
It's not operating on FD, and we've provided a nice reimplementation that does. Let's use it instead. Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-03-20lib/igt_device: Introduce igt_device_get_card_indexMichał Winiarski
And use it! But let's start small. Rather than going with "and by the way, here's the card index" from igt_sysfs_path, we're making things more explicit. v2: Drop idx comment. (Chris) Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-03-20lib/igt_kms: reset plane alpha and blend in igt_plane_reset()Juha-Pekka Heikkila
plane alpha and blend would affect other tests if left in unexpected states v2 (ville syrjälä): use "Pre-multiplied" as default for IGT_PLANE_PIXEL_BLEND_MODE. Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-03-16lib/i915: Pretty print HW semaphoresChris Wilson
Include whether the scheduler is using HW semaphore assistance in our pretty debug strings, and make the caps known for requires. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2019-03-13lib/igt_fb: better format printingDaniel Vetter
Steal if from kms_plane.c and put it into igt_fb.h Also tiny bikeshed to remove the space, so it fits more tidily into the usual name1=value1, name2=value2 style printing. v2: Rebase v3: It better compile :-/ Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (v1) Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-03-13lib/igt_kms: Add zpos plane property.Marius Vlad
Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
2019-03-11lib/igt_fb: Function to create a bo for passed in igt_fbDhinakaran Pandiyan
In order to execute negative tests that validate fb creation, tests need to be able to call the addfb ioctl themselves so that the arguments can be manipulated. Add a library function to provide an initialized fb without registering the fb with the kernel. Cc: Clinton Taylor <clinton.a.taylor@intel.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-03-11lib/igt_fb: s/tiling/modifier/ where appropriateVille Syrjälä
Rename the igt_fb.tiling to igt_fb.modifier to better reflect what information it carries. Now it's clear whether we're talking about a modifier or a i915 tiling thing. Cc: Clinton Taylor <clinton.a.taylor@intel.com> >From DK: Rebased on vc4 changes Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
2019-03-11lib/igt_fb: Use rendercopy for rendering into compressed buffersVille Syrjälä
Plug in rendercopy to the cairo surface stuff so that we can generate compressed buffers with cairo. v2: s/modifier_has_ccs/is_ccs_modifier/ v3: From DK Set buf.bpp when initializing and rebase. v4: From DK Fix Yf-tiled BGR formats Cc: Clinton Taylor <clinton.a.taylor@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Clint Taylor <Clinton.A.Taylor@intel.com>
2019-03-11lib/rendercopy: Add support for Yf/Ys tiling to gen9 rendercopyVille Syrjälä
Set up the surface state accordingly to support Yf/Ys tiling. >From DK: Rebase. Move support to gen-9 surface state Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2019-03-11lib/rendercopy: Copy gen8 surface state definition to gen-9 headerDhinakaran Pandiyan
Create a gen9 specific struct so that the gen-9+ Yf/Ys tiling bits can be added there. Suggested-by: Katarzyna Dec <katarzyna.dec@intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2019-03-11lib/debugfs: Nuke enum intel_pipe_crc_sourceVille Syrjälä
No one is using anything but the "auto" crc source, so the enum listing other options is quite pointless. Let's switch to just using the string instead of the enum. That way any hypothetical test that wants to use a more specific crc source can just pass in the proper string. v2: Assert the string isn't NULL (Chris) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-03-11lib/igt_matrix: Fix up some docsVille Syrjälä
Add some missing documentation. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-03-11lib/igt_kms: Fix docs for igt_enable_connectors()Ville Syrjälä
Add the missing docs for the 'drm_fd' parameter. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-03-11lib/debugfs: Fix wraparound handling for crc frame counter checkVille Syrjälä
Deal with frame counter wraparound correcrtly. v2: Make the comparison functions available for everyone (Chris) Add some docs (gtk-doc seems obtuse so not 100% warning free) Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> #v1 Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-03-08lib/igt_pm: Avoid out-of-bounds reads and writesPetri Latvala
Read sizeof - 1 to buffers so null-termination stays in bounds. v2: Also clear the buffers before reusing (Chris). Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-03-08lib/fb: Add missing break in get_yuv_parametersPetri Latvala
YVU420 and YVU422 will otherwise use offsets for P010 and pals. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> #irc
2019-03-08lib/debugfs: Ensure null-termination in igt_hpd_storm_detectedPetri Latvala
Read sizeof - 1 to buf so it stays null-terminated. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-03-08lib/aux: Plug memory leak in get_suspend_testPetri Latvala
Free test_line in all paths out of the function. v2: Avoid freeing too soon (Chris) Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-03-08lib/aux: Plug memory leak in __igt_lsof_fdsPetri Latvala
Add a missing closedir call. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-03-04lib/igt_kms: Fix commits for planes with multiple possible CRTCsNicholas Kazlauskas
An igt_plane_t is defined per igt_pipe_t. It is treated as its own independent resource but DRM planes can be exposed to being used on a number of possible CRTCs - making it a shared resource. In IGT planes with multiple possible CRTCs are added to the plane list for each pipe that the plane supports. The internal state remains independent in IGT so when the same plane is modified for multiple pipes in a single commit the last pipe to modify it is the one whose state gets fully applied. This situation happens fairly often in practice - resetting the display at the start of the test before a commit will reset the CRTC ID and FB ID for each plane. For an example, consider the igt@kms_plane_alpha_blend@pipe-a-constant-alpha-max test. This test will fail for any overlay plane exposed for multiple CRTCs. The test tries to set a framebuffer for pipe A but has all the other pipes reset the plane state in the same commit. If there are multiple pipes on the hardware then the last pipe will be the one to set all the plane properties. The driver will receive a commit with no overlay plane enabled since the last pipe set CRTC ID and FB ID to 0, disabling the plane. The reference CRC capture will be incorrect since not all the planes have been enabled and the subsequent CRC captures will not match, failing the test. The simplest (but hacky) fix to this problem is to only set the properties for the plane for the pipe that last had it bound. This patch introduces a global plane list on igt_display_t that keeps track of the pipe that pipe that last called igt_plane_set_fb. The properties for the plane will only be applied from that single pipe when commiting the state to DRM. No behavioral changes should be introduced by this patch for hardware whose planes are only ever exposed one CRTC. It would likely be best to eventually modify the igt_pipe_t plane list to be a list of pointers to planes instead (igt_plane_t**) instead of being the actual plane objects, but that can come later. Many areas of the code like to make use of the backpointer to the pipe on the plane which makes refactoring the code in that manner a little trickier. v2: Add igt_plane_set_fb, use igt_plane_t for global plane list (Daniel) v3: Leave TODO for filling in all state/props on global planes Cc: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
2019-02-28lib: Incrementally mlock()Chris Wilson
As we already have the previous portion of the mmap mlocked, we only need to mlock() the fresh portion for testing available memory. v2: Fixup the uint64_t pointer arithmetric and only use a single mmap to avoid subsequent mlock fail (for reasons unknown, but bet on mm/). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Caz Yokoyama <Caz.Yokoyama@intel.com> Reviewed-by: Caz Yokoyama <Caz.Yokoyama@intel.com>
2019-02-26lib/i915: Move mmap IOCTLs wrappers into separate fileAntonio Argenziano
Move all mmap flavours and support function to separate file in i915 folder. This helps with moving i915 specific functions away from common libraries. v2: - Autotools still exists. (Petri) - Include gem_mman.h directly. (Chris) v3: - Keep includes explicit. (Chris) Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-02-26autotools: Always build VC4 helpers with the libraryPaul Kocialkowski
With recent changes to the igt_fb code, VC4 support is now integrated in common helpers. As a result, VC4 helpers have to be built as part of the library. This is already the case with meson, but VC4 support was removed from autotools. Bring it back unconditionally to match meson behaviour. This fixes a build error with autotools. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
2019-02-26lib/igt_chamelium: Hook-in checkerboard comparison method in helpersPaul Kocialkowski
This introduces the checkerboard chamelium checking type and hooks the call to the associated igt_frame matching helper in the frame match chamelium helper. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-26lib/igt_frame: Add a checkerboard frame comparison methodPaul Kocialkowski
This introduces a new frame comparison method that was designed for patterns that follow a checkerboard style. These patterns are made of consecutive rectangular shapes with alternating solid colors. They are currently used for some Chamelium-based tests. The method is particularly adapted for cases where the edges of the shapes might be blurred (e.g. due to scaling), which makes it impossible to use pixel-perfect or CRC-based comparisons to decide whether the captured frame matches the reference. Overall, this test will first detect the edges of the pattern and later exclude them from comparison. Colors are compared between the reference and capture with a low threshold for error. A percentage of the faulty pixels is calculated and the captured frame is considered invalid if more than one percent of the pixels are erroneous. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-26lib/igt_chamelium: Generalize the frame match helper with check typePaul Kocialkowski
In prevision of adding support for another type of frame matching, rename chamelium_assert_analog_frame_match_or_dump to drop the analog part and feed it the check type. This way, the bulk of the helper can apply to other frame matching types. This requires moving the chamelium_check enum from the test to the common chamelium header. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-26lib/igt_chamelium: Split frames dump logic and rework surroundingsPaul Kocialkowski
The frame dump logic is the same for all comparison helpers, so split it to a dedicated function and adapt helpers using it to avoid duplicating operations. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-26lib/igt_chamelium: Fixup resources liberation in comparison helpersPaul Kocialkowski
This fixes a bunch of occurrences of memory not being properly liberated after its use in helpers revolving around frame/CRC comparison. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-26lib/igt_kms: Add helpers to count and iterate planes from outputPaul Kocialkowski
With helpers to count and iterate among planes of a given type from the pipe in place, we can use them with the current pipe for the output to make it possible for tests to use them (the pipe struct is not currently easily exposed to tests and exposing it adds unnecessary complexity). Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-26lib/igt_kms: Add helpers to count and iterate planes from pipePaul Kocialkowski
This introduces helpers that allow counting how many planes of a given type are present from a pipe and getting the n-th plane of a given type. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-26lib/igt_fb: Support converting to VC4 modifiers in igt_fb_convertPaul Kocialkowski
This pipes-in support for the VC4 modifiers that we have conversion helpers for. A new temporary linear framebuffer is introduced, that is either freed later or copied to the destination framebuffer pointer. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
2019-02-26lib/igt_fb: Pass the modifier to igt_fb_convert helpersPaul Kocialkowski
The modifier is part of how a frame is represented, so add it as an extra argument so that it can be specified when converting framebuffers. For now, only a linear modifier is supported. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com>