20 Commits

Author SHA1 Message Date
Chris Wilson
9df77d5664 lib/igt_fb: Ignore RGB888
None of our display hardware supports the packed 24-bit format, so stop
trying to use it and causing test failures.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78873&list_id=465068
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-06 12:11:08 +01:00
Chris Wilson
db4cc747fa lib/igt_fb: Add debug output for creating fb
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-06 12:11:08 +01:00
Thomas Wood
3aac97107e lib/igt_fb: ensure igt_create_fb parameters are consistent
Make sure the parameters in the prototype and implementation of
igt_create_fb match and are complete so that the documentation is
correct.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-09-05 16:52:51 +01:00
Thomas Wood
4cb1946697 lib: move create_stereo_fb from testdisplay to igt_fb
Move create_stereo_fb from testdisplay to igt_create_stereo_fb in igt_fb
so that it can be used in other tests.

v2: update for new igt_create_fb API
    add parameters for format and tiling
    remove some old debug code

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-09-05 16:52:51 +01:00
Daniel Vetter
71ac5de5a4 lib/intel_* Use igt checks and macros
Various stuff all over. Most done with the igt.cocci spatch, but
with a few fixups by hand. And add igt_core.h includes where needed.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-26 15:16:01 +02:00
Damien Lespiau
50166d2a20 lib/fb: Assert, instead of silently failing, when creating fbs
We were either returning 0, or a negative value cast to an unsigned int
for errors and the clients of that API weren't exactly checking
anything.

We're in luck, we can take shortcuts in a testing library to just assert
when an expected error occurs.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-08-21 15:02:04 +01:00
Damien Lespiau
54397cafed lib/fb: Replace straight igt_fail() by asserts with debug messages
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-08-21 15:00:08 +01:00
Damien Lespiau
378e61e4d8 lib: Change the fb creation functions to take fully qualified tiling formats
In the future, we'll need more than X tiling here. So give a full enum
instead of bool meaning X-tiled.

It's fine to do this change without updating the users just yet as
'true' happens to be I915_TILING_X.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-08-21 14:54:01 +01:00
Damien Lespiau
0db75bb3f9 lib: Don't take a reference to the surface in get_cairo_surface()
We don't need to keep a reference to the surface, the cairo context will
keep a reference to it until we destroy it.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-29 12:13:41 +01:00
Damien Lespiau
72357f3de0 lib: NULLify ->cairo_surface once unmapped
Just a matter of not leaving dangling pointers around.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-29 12:13:41 +01:00
Damien Lespiau
4aadbc817b lib: Split the GTT mapping out of get_cairo_surface()
This is preparation work for when we need a different way to get a
linear buffer we can use with cairo.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-29 12:13:41 +01:00
Oscar Mateo
5bdd4d9b5e lib/igt_fb: igt_create_fb_with_bo_size
Useful for testing bigger/smaller fb-wrapped buffer objects.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-05-16 17:45:14 +03:00
Daniel Vetter
1503d17cc5 lib/igt_core: Document testrunner interface a bit
Also fix up one gtkdoc fumble in igt_fb. We should use symbolic
defines if possible instead of just listening the magic 0, 77, 78
values for exit codes, but that's a separate patch.

Cc: tim.gore@intel.com
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-13 11:29:34 +02:00
Daniel Vetter
cc730c418f lib/kmstest: Fix up tiled buffer creation
When extracting a raw __gem_set_tiling helper I've fumbled this in

commit 590f6101402b51bca54f69c002380bda967484ea
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Wed Oct 9 20:50:50 2013 +0200

    lib/drmtest: extract rawer __gem_set_tiling

Fix things up so that we properly propaget the error again.

Now to make this all properly work we also need to make kms_flip a
notch more robust against such failures ...

This only blows up on gen2/3 with the pan tests which want a too wide
framebuffer for tiling.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-13 19:08:17 +02:00
Daniel Vetter
3d9e63f2ad lib/igt_fb: api documentation
Also realign function parameters and replace abort() with igt_fail()
while at it.

v2: Forgotten to add a nice intro.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-26 18:50:28 +01:00
Daniel Vetter
7568edf4b1 lib/igt_fb: setup font in igt_get_cairo_ctx
We always want the same boring one, so extract it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-26 18:50:28 +01:00
Daniel Vetter
ae461e67e8 lib/igt_fb: drop kmstest_ prefix from static functions
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-26 18:50:28 +01:00
Daniel Vetter
c6c2b2bb70 lib/igt_kms/bf: doc skeleton
igt_kms docs are just skeleton and also added igt_fb to make sure the
linking works correctly.

Next up: Actually documenting igt_fb.

Also fix that depency spelling fumble I've copied around to a few too
many places.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-26 18:50:28 +01:00
Daniel Vetter
9aea7ae541 lib/igt_fb: switch to igt_ prefix from kmstest_
Shorter and more in line with our general igt_ prefix for everything
which isn't somehow intel or i915-gem or otherwise hw specific - these
helpers here are all fully generic framebuffer handling functions
based on kms + cairo.

Well, the actual buffer alloc is done with i915 gem, but meh ;-)

Two special cases:
- bpp_depth_to_drm_format and drm_format_to_bpp completely lacked
  prefixes, so just add igt_.
- write_fb was a bit misleading given that we have gem_write for
  uploading to buffers. Rename that to write_fb_to_png to make it
  crystal clear what this thing does even without looking at docs.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-26 18:50:27 +01:00
Daniel Vetter
57d7db8cf8 lib: extract igt_fb library
Stuff all the framebuffer creation, cairo and drm fourcc format
handling in there. This gives us a very clear cut in the headers where
igt_fb.c only needs to include igt_fb.h, and igt_kms.c includes both
(well igt_kms.h pulls in igt_fb.h since we always need this).

The aim here is to add api docs for igt_fb since that part of the kms
library seems fairly stable already, while all the mode setting and
iteration is still a bit in flux.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-26 18:50:27 +01:00