intel: teach layout about scanout
diff --git a/icd/intel/img.c b/icd/intel/img.c
index c4d1ee3..8411475 100644
--- a/icd/intel/img.c
+++ b/icd/intel/img.c
@@ -75,6 +75,7 @@
 
 XGL_RESULT intel_img_create(struct intel_dev *dev,
                             const XGL_IMAGE_CREATE_INFO *info,
+                            bool scanout,
                             struct intel_img **img_ret)
 {
     struct intel_img *img;
@@ -91,7 +92,7 @@
     img->depth = info->extent.depth;
     img->array_size = info->arraySize;
     img->samples = info->samples;
-    intel_layout_init(layout, dev, info);
+    intel_layout_init(layout, dev, info, scanout);
 
     if (layout->bo_stride > intel_max_resource_size / layout->bo_height) {
         intel_dev_log(dev, XGL_DBG_MSG_ERROR, XGL_VALIDATION_LEVEL_0,
@@ -122,7 +123,7 @@
         s8_info.format.channelFormat = XGL_CH_FMT_R8;
         assert(info->format.numericFormat == XGL_NUM_FMT_DS);
 
-        intel_layout_init(img->s8_layout, dev, &s8_info);
+        intel_layout_init(img->s8_layout, dev, &s8_info, scanout);
 
         img->s8_offset = u_align(img->total_size, 4096);
         img->total_size = img->s8_offset +
@@ -161,7 +162,8 @@
 {
     struct intel_dev *dev = intel_dev(device);
 
-    return intel_img_create(dev, pCreateInfo, (struct intel_img **) pImage);
+    return intel_img_create(dev, pCreateInfo, false,
+            (struct intel_img **) pImage);
 }
 
 XGL_RESULT XGLAPI intelGetImageSubresourceInfo(
diff --git a/icd/intel/img.h b/icd/intel/img.h
index 956631c..1a20b7c 100644
--- a/icd/intel/img.h
+++ b/icd/intel/img.h
@@ -67,6 +67,7 @@
 
 XGL_RESULT intel_img_create(struct intel_dev *dev,
                             const XGL_IMAGE_CREATE_INFO *info,
+                            bool scanout,
                             struct intel_img **img_ret);
 
 void intel_img_destroy(struct intel_img *img);
diff --git a/icd/intel/layout.c b/icd/intel/layout.c
index 7109666..de1f41e 100644
--- a/icd/intel/layout.c
+++ b/icd/intel/layout.c
@@ -45,6 +45,7 @@
 struct intel_layout_params {
    const struct intel_gpu *gpu;
    const XGL_IMAGE_CREATE_INFO *info;
+   bool scanout;
 
    bool compressed;
 
@@ -462,6 +463,15 @@
    const XGL_FORMAT format = layout->format;
    unsigned valid_tilings = LAYOUT_TILING_ALL;
 
+   /*
+    * From the Sandy Bridge PRM, volume 1 part 2, page 32:
+    *
+    *     "Display/Overlay   Y-Major not supported.
+    *                        X-Major required for Async Flips"
+    */
+   if (params->scanout)
+       valid_tilings &= LAYOUT_TILING_X;
+
    if (info->tiling == XGL_LINEAR_TILING)
        valid_tilings &= LAYOUT_TILING_NONE;
 
@@ -1255,13 +1265,15 @@
  */
 void intel_layout_init(struct intel_layout *layout,
                        const struct intel_dev *dev,
-                       const XGL_IMAGE_CREATE_INFO *info)
+                       const XGL_IMAGE_CREATE_INFO *info,
+                       bool scanout)
 {
    struct intel_layout_params params;
 
    memset(&params, 0, sizeof(params));
    params.gpu = dev->gpu;
    params.info = info;
+   params.scanout = scanout;
 
    /* note that there are dependencies between these functions */
    layout_init_aux(layout, &params);
diff --git a/icd/intel/layout.h b/icd/intel/layout.h
index 2a16a08..473aa32 100644
--- a/icd/intel/layout.h
+++ b/icd/intel/layout.h
@@ -125,7 +125,8 @@
 
 void intel_layout_init(struct intel_layout *layout,
                        const struct intel_dev *dev,
-                       const XGL_IMAGE_CREATE_INFO *info);
+                       const XGL_IMAGE_CREATE_INFO *info,
+                       bool scanout);
 
 bool
 intel_layout_update_for_imported_bo(struct intel_layout *layout,