summaryrefslogtreecommitdiff
path: root/lib/i915/gem_mman.h
AgeCommit message (Collapse)Author
2021-08-06lib/i915/gem_mman: add helper query for has_device_coherentMatthew Auld
Might be useful in some tests, where we are not explicitly testing WC maps, but rather just require something that is "device coherent", which should also play nice on discrete platforms. Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Ramalingam C <ramalingam.c@intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2021-08-06lib/i915/gem_mman: add FIXED mmap modeMatthew Auld
We need this for discrete. v2(Ashutosh): - use the new i915_drm_local.h infrastructure, and drop the LOCAL prefix Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Ramalingam C <ramalingam.c@intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2021-06-24i915: Handle the case where legacy mmap is not available, v2.Maarten Lankhorst
We will remove support for the legacy mmap ioctl, so handle that case without rewriting all tests. When the gem_mmap ioctl is not available, transparently fallback to mmap_offset. Changes since v1: - Skip gem_tiled_wc too, as it requires on legacy mmap behavior. (Ashutosh) - Remove fallback for __gem_mmap__gtt, it's already mmap_offset. (Ashutosh) Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2021-01-11lib/i915: Split gem_create.c from ioctl_wrappers.cAndrzej Turko
In preparation for a variation on the exisiting GEM_CREATE API, split the ioctl from out of the large ioctl_wrappers.c Signed-off-by: Andrzej Turko <andrzej.turko@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-12-12lib: Pass device fd to gem_mmappable_aperture_size()Chris Wilson
In order to find the correct aperture size for the test, we want to pass the test's device into the query. Reported-by: Bruce Chang <yu.bruce.chang@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Bruce Chang <yu.bruce.chang@intel.com> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-02-24lib/i915: Restrict mmap types to GTT if no MMAP_OFFSET supportJanusz Krzysztofik
Commit b0da8bb705c0 ("lib/i915: for_each_mmap_offset_type()") introduced a macro that makes it easy to repeat a test body within a loop for each mmap-offset mapping type supported by v4 of i915 MMAP_GTT API. However, when run on an older version of the driver, those subtests are believed to be still repeated for each known mmap-offset mapping type while effectively exercising GTT mapping type only. As that may be confusing, fix it. It has been assumed that the modified macro is still suitable for use inside gem_mmap_offset test itself. Would that not be case, gem_mmap_offset could redefine the macro back to its initial form for internal use. v2: Move extra condition to a separate function and call it via for_each_if(), in case we need to fix it again in future (Chris) v3: Fix blind copy-paste Suggested-by: Michał Winiarski <michal.winiarski@intel.com> Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-02-07lib/i915: for_each_mmap_offset_type()Chris Wilson
Pull the increasingly replicated for loop over the possible mmap offset types into a library helper. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Dixit Ashutosh <ashutosh.dixit@intel.com> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2020-01-29lib/i915/gem_mman.c: add cpu coherency mapping wrapperZbigniew Kempczyński
For reduce code redundancy adding a wrapper for cpu memory mapping. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Suggested-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-12-11lib/i915/gem_mman: Add support for GEM_MMAP_OFFSET ioctlZbigniew Kempczyński
With introduction of new kernel ioctl we need to cover this in the IGT's. Patch adds mmap functions appropriate for this. Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-11-12i915: Mark up a few more tests that only target GGTTChris Wilson
If a test is only targeting the GGTT API and its corner cases, it can only run if we have a mappable aperture. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Acked-by: Antonio Argenziano <antonio.argenziano@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>