tests/kms_flip: test a fb backed by a bo too big/small for its own good
This is a "review by igt test" for a bug located in
i915_gem_object_pin_to_display_plane and fixed by:
commit
392013bdd4b6128795e33c84bd6d6d3fd66ff0a3
Author: Oscar Mateo <oscar.mateo@intel.com>
Date: Fri May 16 11:23:12 2014 +0100
drm/i915: Gracefully handle obj not bound to GGTT in is_pin_display
Otherwise, we do a NULL pointer dereference.
I've seen this happen while handling an error in
i915_gem_object_pin_to_display_plane():
If i915_gem_object_set_cache_level() fails, we call is_pin_display()
to handle the error. At this point, the object is still not pinned
to GGTT and maybe not even bound, so we have to check before we
dereference its GGTT vma.
v2: Chris Wilson says restoring the old value is easier, but that
is_pin_display is useful as a theory of operation. Take the solomonic
decision: at least this way is_pin_display is a little more robust
(until Chris can kill it off).
v2: Avoid code duplication by using igt_create_fb_with_bo_size() as
requested by Ville Syrjälä (original author of the "too big" test idea).
Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>