tests/kms_flip: test a fb backed by a bo too big/small for its own good
authorOscar Mateo <oscar.mateo@intel.com>
Fri, 16 May 2014 13:07:12 +0000 (14:07 +0100)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 16 May 2014 14:45:14 +0000 (17:45 +0300)
commit542c2b5ed5a2a5beee5912b44f9155ade532dca3
tree5a27cdab4091f5fb4d455dc7d03d308bd00af66e
parent5bdd4d9b5e371735e0d76339989a9af9bd046702
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>
tests/kms_flip.c