summaryrefslogtreecommitdiff
path: root/lib/igt_draw.c
AgeCommit message (Collapse)Author
2016-01-29lib/igt_draw: use igt_drm_format_to_bpp()Paulo Zanoni
Don't reimplement the function. Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-10-12Replace __gem_mmap__{cpu,gtt,wc}() + igt_assert() with gem_mmap__{cpu,gtt,wc}()Ville Syrjälä
gem_mmap__{cpu,gtt,wc}() already has the assert built in, so replace __gem_mmap__{cpu,gtt,wc}() + igt_assert() with it. Mostly done with coccinelle, with some manual help: @@ identifier I; expression E1, E2, E3, E4, E5, E6; @@ ( - I = __gem_mmap__gtt(E1, E2, E3, E4); + I = gem_mmap__gtt(E1, E2, E3, E4); ... - igt_assert(I); | - I = __gem_mmap__cpu(E1, E2, E3, E4, E5); + I = gem_mmap__cpu(E1, E2, E3, E4, E5); ... - igt_assert(I); | - I = __gem_mmap__wc(E1, E2, E3, E4, E5); + I = gem_mmap__wc(E1, E2, E3, E4, E5); ... - igt_assert(I); ) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-09Make gem_mmap__{cpu,gtt,wc}() assert on failureVille Syrjälä
Rename the current gem_mmap__{cpu,gtt,wc}() functions into __gem_mmap__{cpu,gtt,wc}(), and add back wrappers with the original name that assert that the pointer is valid. Most callers will expect a valid pointer and shouldn't have to bother with failures. To avoid changing anything (yet), sed 's/gem_mmap__/__gem_mmap__/g' over the entire codebase. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-09-08lib: various documentation fixesThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-14lib/igt_draw: break if we already wrote every pixelPaulo Zanoni
Due to the nature of accessing a tiled buffer in an untiled way, we used to loop through the whole buffer all the time. Add a small mechanism to just break in case we know we already wrote every pixel we should have written. On kms_frontbuffer_tracknig/fbc-2p-primscrn-pri-shrfb-draw-pwrite (with a 3200x1800 primary screen and a 1920x1080 secondary screen), I could reduce the runtime from ~7.53s to ~6.01s. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-14lib/igt_draw: fix pwrite_tiled()Paulo Zanoni
Don't forget to flush in case we're in the last iteration of the loop. This fixes failures of kms_frontbuffer_tracking when used with --use-small-modes on eDP monitors. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-08-14lib/igt_draw: add support for RGB565 and XRGB2101010Paulo Zanoni
We need to test those pixel formats on the FBC code, so let's make sure the drawing library works on them first. v2: Update the gtkdoc (Daniel). Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-27doc: Remove i-g-t/intel prefixes and capitalize section titlesDamien Lespiau
Looks better! Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-26lib/igt_draw: move to the GTT domain before using GTT mmapsPaulo Zanoni
With this, we don't need to worry about what happened to the buffer before. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-05-14docs: various documentation fixesThomas Wood
Fix various typos, add missing parameter documentation, include the igt_draw section and update the list of ignored headers. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-05-07lib: add igt_drawPaulo Zanoni
For all those IGT tests that need an easy way to draw rectangles on buffers using different methods. Current planned users: FBC and PSR CRC tests. There is also a tests/kms_draw_crc program to check if the library is sane. v2: - Move the test from lib/tests to tests/ (Daniel). - Add igt_require() to filter out the swizzling/tiling methods we don't support (Daniel). - Simplify reloc handling on the BLT case (Daniel). - Document enum igt_draw_method (Daniel). - Document igt_draw_get_method_name() (Paulo). v3: - Add IGT_DRAW_MMAP_WC (Chris). - Implement the other trivial swizzling methods (Chris). - Remove the gem_sync() calls (Chris). Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>