--- initial
+++ final
@@ -1,119 +1,119 @@
 static int intel_framebuffer_init(struct drm_device *dev, struct intel_framebuffer *intel_fb, struct drm_mode_fb_cmd2 *mode_cmd, struct drm_i915_gem_object *obj) {
   struct drm_i915_private *dev_priv = to_i915(dev);
   unsigned int tiling = i915_gem_object_get_tiling(obj);
   int ret;
   u32 pitch_limit, stride_alignment;
   struct drm_format_name_buf format_name;
   WARN_ON(!mutex_is_locked(&dev->struct_mutex));
   if (mode_cmd->flags & DRM_MODE_FB_MODIFIERS) {
     /*
      * If there's a fence, enforce that
      * the fb modifier and tiling mode match.
      */
     if (tiling != I915_TILING_NONE && tiling != intel_fb_modifier_to_tiling(mode_cmd->modifier[0])) {
       DRM_DEBUG("tiling_mode doesn't match fb modifier\n");
       return -EINVAL;
     }
   } else {
     if (tiling == I915_TILING_X) {
       mode_cmd->modifier[0] = I915_FORMAT_MOD_X_TILED;
     } else if (tiling == I915_TILING_Y) {
       DRM_DEBUG("No Y tiling for legacy addfb\n");
       return -EINVAL;
     }
   }
   /* Passed in modifier sanity checking. */
   switch (mode_cmd->modifier[0]) {
   case I915_FORMAT_MOD_Y_TILED:
   case I915_FORMAT_MOD_Yf_TILED:
     if (INTEL_GEN(dev_priv) < 9) {
       DRM_DEBUG("Unsupported tiling 0x%llx!\n", mode_cmd->modifier[0]);
       return -EINVAL;
     }
   case DRM_FORMAT_MOD_NONE:
   case I915_FORMAT_MOD_X_TILED: break;
   default: DRM_DEBUG("Unsupported fb modifier 0x%llx!\n", mode_cmd->modifier[0]); return -EINVAL;
   }
   /*
    * gen2/3 display engine uses the fence if present,
    * so the tiling mode must match the fb modifier exactly.
    */
   if (INTEL_INFO(dev_priv)->gen < 4 && tiling != intel_fb_modifier_to_tiling(mode_cmd->modifier[0])) {
     DRM_DEBUG("tiling_mode must match fb modifier exactly on gen2/3\n");
     return -EINVAL;
   }
   stride_alignment = intel_fb_stride_alignment(dev_priv, mode_cmd->modifier[0], mode_cmd->pixel_format);
   if (mode_cmd->pitches[0] & (stride_alignment - 1)) {
     DRM_DEBUG("pitch (%d) must be at least %u byte aligned\n", mode_cmd->pitches[0], stride_alignment);
     return -EINVAL;
   }
   pitch_limit = intel_fb_pitch_limit(dev_priv, mode_cmd->modifier[0], mode_cmd->pixel_format);
   if (mode_cmd->pitches[0] > pitch_limit) {
     DRM_DEBUG("%s pitch (%u) must be at less than %d\n", mode_cmd->modifier[0] != DRM_FORMAT_MOD_NONE ? "tiled" : "linear", mode_cmd->pitches[0], pitch_limit);
     return -EINVAL;
   }
   /*
    * If there's a fence, enforce that
    * the fb pitch and fence stride match.
    */
   if (tiling != I915_TILING_NONE && mode_cmd->pitches[0] != i915_gem_object_get_stride(obj)) {
     DRM_DEBUG("pitch (%d) must match tiling stride (%d)\n", mode_cmd->pitches[0], i915_gem_object_get_stride(obj));
     return -EINVAL;
   }
   /* Reject formats not supported by any plane early. */
   switch (mode_cmd->pixel_format) {
   case DRM_FORMAT_C8:
   case DRM_FORMAT_RGB565:
   case DRM_FORMAT_XRGB8888:
   case DRM_FORMAT_ARGB8888: break;
   case DRM_FORMAT_XRGB1555:
     if (INTEL_GEN(dev_priv) > 3) {
       DRM_DEBUG("unsupported pixel format: %s\n", drm_get_format_name(mode_cmd->pixel_format, &format_name));
       return -EINVAL;
     }
     break;
   case DRM_FORMAT_ABGR8888:
     if (!IS_VALLEYVIEW(dev_priv) && !IS_CHERRYVIEW(dev_priv) && INTEL_GEN(dev_priv) < 9) {
       DRM_DEBUG("unsupported pixel format: %s\n", drm_get_format_name(mode_cmd->pixel_format, &format_name));
       return -EINVAL;
     }
     break;
   case DRM_FORMAT_XBGR8888:
   case DRM_FORMAT_XRGB2101010:
   case DRM_FORMAT_XBGR2101010:
     if (INTEL_GEN(dev_priv) < 4) {
       DRM_DEBUG("unsupported pixel format: %s\n", drm_get_format_name(mode_cmd->pixel_format, &format_name));
       return -EINVAL;
     }
     break;
   case DRM_FORMAT_ABGR2101010:
     if (!IS_VALLEYVIEW(dev_priv) && !IS_CHERRYVIEW(dev_priv)) {
       DRM_DEBUG("unsupported pixel format: %s\n", drm_get_format_name(mode_cmd->pixel_format, &format_name));
       return -EINVAL;
     }
     break;
   case DRM_FORMAT_YUYV:
   case DRM_FORMAT_UYVY:
   case DRM_FORMAT_YVYU:
   case DRM_FORMAT_VYUY:
     if (INTEL_GEN(dev_priv) < 5) {
       DRM_DEBUG("unsupported pixel format: %s\n", drm_get_format_name(mode_cmd->pixel_format, &format_name));
       return -EINVAL;
     }
     break;
   default: DRM_DEBUG("unsupported pixel format: %s\n", drm_get_format_name(mode_cmd->pixel_format, &format_name)); return -EINVAL;
   }
   /* FIXME need to adjust LINOFF/TILEOFF accordingly. */
   if (mode_cmd->offsets[0] != 0) return -EINVAL;
-  drm_helper_mode_fill_fb_struct(&intel_fb->base, mode_cmd);
+  drm_helper_mode_fill_fb_struct(dev, &intel_fb->base, mode_cmd);
   intel_fb->obj = obj;
   ret = intel_fill_fb_info(dev_priv, &intel_fb->base);
   if (ret) return ret;
   ret = drm_framebuffer_init(dev, &intel_fb->base, &intel_fb_funcs);
   if (ret) {
     DRM_ERROR("framebuffer init failed %d\n", ret);
     return ret;
   }
   intel_fb->obj->framebuffer_references++;
   return 0;
 }<sep>@@
expression E1, E2;
@@
 drm_helper_mode_fill_fb_struct(
+                               dev,
                                E1, E2);