i965/dri: Disallow image with INVALID modifier
authorBen Widawsky <ben@bwidawsk.net>
Tue, 21 Mar 2017 18:59:33 +0000 (11:59 -0700)
committerBen Widawsky <ben@bwidawsk.net>
Tue, 21 Mar 2017 21:48:03 +0000 (14:48 -0700)
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/intel_screen.c

index af9c9a45f3c4be63790a956eef125ee0193d97cb..b77933e100eda543060e8ae662ad098dd5cb0918 100644 (file)
@@ -541,6 +541,9 @@ intel_create_image_common(__DRIscreen *dri_screen,
    uint64_t modifier = select_best_modifier(&screen->devinfo, modifiers, count);
    assert(modifier == DRM_FORMAT_MOD_INVALID);
 
+   if (modifier == DRM_FORMAT_MOD_INVALID && modifiers)
+      return NULL;
+
    /* Historically, X-tiled was the default, and so lack of modifier means
     * X-tiled.
     */