11 Commits

Author SHA1 Message Date
Paulo Zanoni
12c1eb653f lib/igt_draw: use igt_drm_format_to_bpp()
Don't reimplement the function.

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-29 16:29:30 -02:00
Ville Syrjälä
f52e7ec787 Replace __gem_mmap__{cpu,gtt,wc}() + igt_assert() with gem_mmap__{cpu,gtt,wc}()
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-12 19:57:58 +03:00
Ville Syrjälä
b8a77dd6c8 Make gem_mmap__{cpu,gtt,wc}() assert on failure
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-10-09 19:16:26 +03:00
Thomas Wood
f0381d1abe lib: various documentation fixes
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-08 16:15:16 +01:00
Paulo Zanoni
9113c9aa9b lib/igt_draw: break if we already wrote every pixel
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-14 15:28:27 -03:00
Paulo Zanoni
9194f4efdf lib/igt_draw: fix pwrite_tiled()
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-14 15:28:07 -03:00
Paulo Zanoni
caaf3b869f lib/igt_draw: add support for RGB565 and XRGB2101010
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-08-14 15:27:19 -03:00
Damien Lespiau
6ebd8c2dc3 doc: Remove i-g-t/intel prefixes and capitalize section titles
Looks better!

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 16:04:07 +01:00
Paulo Zanoni
e86557ca9f lib/igt_draw: move to the GTT domain before using GTT mmaps
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-06-26 17:36:47 -03:00
Thomas Wood
6141aa2dad docs: various documentation fixes
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-14 17:00:40 +01:00
Paulo Zanoni
cf9f48e704 lib: add igt_draw
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>
2015-05-07 15:11:49 -03:00