imamnurby/smpl_train_seed8 huggingface dataset:
--- initial
+++ final
@@ -1,44 +1,44 @@
 static void psbfb_copyarea_accel(struct fb_info *info, const struct fb_copyarea *a) {
   struct psb_fbdev *fbdev = info->par;
   struct psb_framebuffer *psbfb = &fbdev->pfb;
   struct drm_device *dev = psbfb->base.dev;
   struct drm_framebuffer *fb = fbdev->psb_fb_helper.fb;
   struct drm_psb_private *dev_priv = dev->dev_private;
   uint32_t offset;
   uint32_t stride;
   uint32_t src_format;
   uint32_t dst_format;
   if (!fb) return;
   offset = psbfb->gtt->offset;
   stride = fb->pitches[0];
-  switch (fb->depth) {
+  switch (fb->format->depth) {
   case 8:
     src_format = PSB_2D_SRC_332RGB;
     dst_format = PSB_2D_DST_332RGB;
     break;
   case 15:
     src_format = PSB_2D_SRC_555RGB;
     dst_format = PSB_2D_DST_555RGB;
     break;
   case 16:
     src_format = PSB_2D_SRC_565RGB;
     dst_format = PSB_2D_DST_565RGB;
     break;
   case 24:
   case 32:
     /* this is wrong but since we don't do blending its okay */
     src_format = PSB_2D_SRC_8888ARGB;
     dst_format = PSB_2D_DST_8888ARGB;
     break;
   default:
     /* software fallback */
     drm_fb_helper_cfb_copyarea(info, a);
     return;
   }
   if (!gma_power_begin(dev, false)) {
     drm_fb_helper_cfb_copyarea(info, a);
     return;
   }
   psb_accel_2d_copy(dev_priv, offset, stride, src_format, offset, stride, dst_format, a->sx, a->sy, a->dx, a->dy, a->width, a->height);
   gma_power_end(dev);
 }<sep>@@
struct drm_framebuffer *fb;
@@
- fb->depth
+ fb->format->depth

@@
struct drm_framebuffer *fb;
@@
- (fb->format->depth)
+ fb->format->depth
--- initial
+++ final
@@ -1,74 +1,74 @@
 static int amdgpufb_create(struct drm_fb_helper *helper, struct drm_fb_helper_surface_size *sizes) {
   struct amdgpu_fbdev *rfbdev = (struct amdgpu_fbdev *)helper;
   struct amdgpu_device *adev = rfbdev->adev;
   struct fb_info *info;
   struct drm_framebuffer *fb = NULL;
   struct drm_mode_fb_cmd2 mode_cmd;
   struct drm_gem_object *gobj = NULL;
   struct amdgpu_bo *abo = NULL;
   int ret;
   unsigned long tmp;
   mode_cmd.width = sizes->surface_width;
   mode_cmd.height = sizes->surface_height;
   if (sizes->surface_bpp == 24) sizes->surface_bpp = 32;
   mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp, sizes->surface_depth);
   ret = amdgpufb_create_pinned_object(rfbdev, &mode_cmd, &gobj);
   if (ret) {
     DRM_ERROR("failed to create fbcon object %d\n", ret);
     return ret;
   }
   abo = gem_to_amdgpu_bo(gobj);
   /* okay we have an object now allocate the framebuffer */
   info = drm_fb_helper_alloc_fbi(helper);
   if (IS_ERR(info)) {
     ret = PTR_ERR(info);
     goto out_unref;
   }
   info->par = rfbdev;
   info->skip_vt_switch = true;
   ret = amdgpu_framebuffer_init(adev->ddev, &rfbdev->rfb, &mode_cmd, gobj);
   if (ret) {
     DRM_ERROR("failed to initialize framebuffer %d\n", ret);
     goto out_destroy_fbi;
   }
   fb = &rfbdev->rfb.base;
   /* setup helper */
   rfbdev->helper.fb = fb;
   memset_io(abo->kptr, 0x0, amdgpu_bo_size(abo));
   strcpy(info->fix.id, "amdgpudrmfb");
-  drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth);
+  drm_fb_helper_fill_fix(info, fb->pitches[0], fb->format->depth);
   info->flags = FBINFO_DEFAULT | FBINFO_CAN_FORCE_OUTPUT;
   info->fbops = &amdgpufb_ops;
   tmp = amdgpu_bo_gpu_offset(abo) - adev->mc.vram_start;
   info->fix.smem_start = adev->mc.aper_base + tmp;
   info->fix.smem_len = amdgpu_bo_size(abo);
   info->screen_base = abo->kptr;
   info->screen_size = amdgpu_bo_size(abo);
   drm_fb_helper_fill_var(info, &rfbdev->helper, sizes->fb_width, sizes->fb_height);
   /* setup aperture base/size for vesafb takeover */
   info->apertures->ranges[0].base = adev->ddev->mode_config.fb_base;
   info->apertures->ranges[0].size = adev->mc.aper_size;
   /* Use default scratch pixmap (info->pixmap.flags = FB_PIXMAP_SYSTEM) */
   if (info->screen_base == NULL) {
     ret = -ENOSPC;
     goto out_destroy_fbi;
   }
   DRM_INFO("fb mappable at 0x%lX\n", info->fix.smem_start);
   DRM_INFO("vram apper at 0x%lX\n", (unsigned long)adev->mc.aper_base);
   DRM_INFO("size %lu\n", (unsigned long)amdgpu_bo_size(abo));
-  DRM_INFO("fb depth is %d\n", fb->depth);
+  DRM_INFO("fb depth is %d\n", fb->format->depth);
   DRM_INFO("   pitch is %d\n", fb->pitches[0]);
   vga_switcheroo_client_fb_set(adev->ddev->pdev, info);
   return 0;
 out_destroy_fbi:
   drm_fb_helper_release_fbi(helper);
 out_unref:
   if (abo) {}
   if (fb && ret) {
     drm_gem_object_unreference_unlocked(gobj);
     drm_framebuffer_unregister_private(fb);
     drm_framebuffer_cleanup(fb);
     kfree(fb);
   }
   return ret;
 }<sep>@@
struct drm_framebuffer *fb;
@@
- fb->depth
+ fb->format->depth

@@
struct drm_framebuffer *fb;
@@
- (fb->format->depth)
+ fb->format->depth
--- initial
+++ final
@@ -1,53 +1,53 @@
 static int astfb_create(struct drm_fb_helper *helper, struct drm_fb_helper_surface_size *sizes) {
   struct ast_fbdev *afbdev = container_of(helper, struct ast_fbdev, helper);
   struct drm_device *dev = afbdev->helper.dev;
   struct drm_mode_fb_cmd2 mode_cmd;
   struct drm_framebuffer *fb;
   struct fb_info *info;
   int size, ret;
   void *sysram;
   struct drm_gem_object *gobj = NULL;
   struct ast_bo *bo = NULL;
   mode_cmd.width = sizes->surface_width;
   mode_cmd.height = sizes->surface_height;
   mode_cmd.pitches[0] = mode_cmd.width * ((sizes->surface_bpp + 7) / 8);
   mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp, sizes->surface_depth);
   size = mode_cmd.pitches[0] * mode_cmd.height;
   ret = astfb_create_object(afbdev, &mode_cmd, &gobj);
   if (ret) {
     DRM_ERROR("failed to create fbcon backing object %d\n", ret);
     return ret;
   }
   bo = gem_to_ast_bo(gobj);
   sysram = vmalloc(size);
   if (!sysram) return -ENOMEM;
   info = drm_fb_helper_alloc_fbi(helper);
   if (IS_ERR(info)) {
     ret = PTR_ERR(info);
     goto err_free_vram;
   }
   info->par = afbdev;
   ret = ast_framebuffer_init(dev, &afbdev->afb, &mode_cmd, gobj);
   if (ret) goto err_release_fbi;
   afbdev->sysram = sysram;
   afbdev->size = size;
   fb = &afbdev->afb.base;
   afbdev->helper.fb = fb;
   strcpy(info->fix.id, "astdrmfb");
   info->flags = FBINFO_DEFAULT | FBINFO_CAN_FORCE_OUTPUT;
   info->fbops = &astfb_ops;
   info->apertures->ranges[0].base = pci_resource_start(dev->pdev, 0);
   info->apertures->ranges[0].size = pci_resource_len(dev->pdev, 0);
-  drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth);
+  drm_fb_helper_fill_fix(info, fb->pitches[0], fb->format->depth);
   drm_fb_helper_fill_var(info, &afbdev->helper, sizes->fb_width, sizes->fb_height);
   info->screen_base = sysram;
   info->screen_size = size;
   info->pixmap.flags = FB_PIXMAP_SYSTEM;
   DRM_DEBUG_KMS("allocated %dx%d\n", fb->width, fb->height);
   return 0;
 err_release_fbi:
   drm_fb_helper_release_fbi(helper);
 err_free_vram:
   vfree(sysram);
   return ret;
 }<sep>@@
struct drm_framebuffer *fb;
@@
- fb->depth
+ fb->format->depth

@@
struct drm_framebuffer *fb;
@@
- (fb->format->depth)
+ fb->format->depth
--- initial
+++ final
@@ -1,61 +1,61 @@
 static int bochsfb_create(struct drm_fb_helper *helper, struct drm_fb_helper_surface_size *sizes) {
   struct bochs_device *bochs = container_of(helper, struct bochs_device, fb.helper);
   struct fb_info *info;
   struct drm_framebuffer *fb;
   struct drm_mode_fb_cmd2 mode_cmd;
   struct drm_gem_object *gobj = NULL;
   struct bochs_bo *bo = NULL;
   int size, ret;
   if (sizes->surface_bpp != 32) return -EINVAL;
   mode_cmd.width = sizes->surface_width;
   mode_cmd.height = sizes->surface_height;
   mode_cmd.pitches[0] = mode_cmd.width * ((sizes->surface_bpp + 7) / 8);
   mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp, sizes->surface_depth);
   size = mode_cmd.pitches[0] * mode_cmd.height;
   /* alloc, pin & map bo */
   ret = bochsfb_create_object(bochs, &mode_cmd, &gobj);
   if (ret) {
     DRM_ERROR("failed to create fbcon backing object %d\n", ret);
     return ret;
   }
   bo = gem_to_bochs_bo(gobj);
   ret = ttm_bo_reserve(&bo->bo, true, false, NULL);
   if (ret) return ret;
   ret = bochs_bo_pin(bo, TTM_PL_FLAG_VRAM, NULL);
   if (ret) {
     DRM_ERROR("failed to pin fbcon\n");
     ttm_bo_unreserve(&bo->bo);
     return ret;
   }
   ret = ttm_bo_kmap(&bo->bo, 0, bo->bo.num_pages, &bo->kmap);
   if (ret) {
     DRM_ERROR("failed to kmap fbcon\n");
     ttm_bo_unreserve(&bo->bo);
     return ret;
   }
   ttm_bo_unreserve(&bo->bo);
   /* init fb device */
   info = drm_fb_helper_alloc_fbi(helper);
   if (IS_ERR(info)) return PTR_ERR(info);
   info->par = &bochs->fb.helper;
   ret = bochs_framebuffer_init(bochs->dev, &bochs->fb.gfb, &mode_cmd, gobj);
   if (ret) {
     drm_fb_helper_release_fbi(helper);
     return ret;
   }
   bochs->fb.size = size;
   /* setup helper */
   fb = &bochs->fb.gfb.base;
   bochs->fb.helper.fb = fb;
   strcpy(info->fix.id, "bochsdrmfb");
   info->flags = FBINFO_DEFAULT;
   info->fbops = &bochsfb_ops;
-  drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth);
+  drm_fb_helper_fill_fix(info, fb->pitches[0], fb->format->depth);
   drm_fb_helper_fill_var(info, &bochs->fb.helper, sizes->fb_width, sizes->fb_height);
   info->screen_base = bo->kmap.virtual;
   info->screen_size = size;
   drm_vma_offset_remove(&bo->bo.bdev->vma_manager, &bo->bo.vma_node);
   info->fix.smem_start = 0;
   info->fix.smem_len = size;
   return 0;
 }<sep>@@
struct drm_framebuffer *fb;
@@
- fb->depth
+ fb->format->depth

@@
struct drm_framebuffer *fb;
@@
- (fb->format->depth)
+ fb->format->depth
--- initial
+++ final
@@ -1,58 +1,58 @@
 static int cirrusfb_create(struct drm_fb_helper *helper, struct drm_fb_helper_surface_size *sizes) {
   struct cirrus_fbdev *gfbdev = container_of(helper, struct cirrus_fbdev, helper);
   struct cirrus_device *cdev = gfbdev->helper.dev->dev_private;
   struct fb_info *info;
   struct drm_framebuffer *fb;
   struct drm_mode_fb_cmd2 mode_cmd;
   void *sysram;
   struct drm_gem_object *gobj = NULL;
   struct cirrus_bo *bo = NULL;
   int size, ret;
   mode_cmd.width = sizes->surface_width;
   mode_cmd.height = sizes->surface_height;
   mode_cmd.pitches[0] = mode_cmd.width * ((sizes->surface_bpp + 7) / 8);
   mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp, sizes->surface_depth);
   size = mode_cmd.pitches[0] * mode_cmd.height;
   ret = cirrusfb_create_object(gfbdev, &mode_cmd, &gobj);
   if (ret) {
     DRM_ERROR("failed to create fbcon backing object %d\n", ret);
     return ret;
   }
   bo = gem_to_cirrus_bo(gobj);
   sysram = vmalloc(size);
   if (!sysram) return -ENOMEM;
   info = drm_fb_helper_alloc_fbi(helper);
   if (IS_ERR(info)) return PTR_ERR(info);
   info->par = gfbdev;
   ret = cirrus_framebuffer_init(cdev->dev, &gfbdev->gfb, &mode_cmd, gobj);
   if (ret) return ret;
   gfbdev->sysram = sysram;
   gfbdev->size = size;
   fb = &gfbdev->gfb.base;
   if (!fb) {
     DRM_INFO("fb is NULL\n");
     return -EINVAL;
   }
   /* setup helper */
   gfbdev->helper.fb = fb;
   strcpy(info->fix.id, "cirrusdrmfb");
   info->flags = FBINFO_DEFAULT;
   info->fbops = &cirrusfb_ops;
-  drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth);
+  drm_fb_helper_fill_fix(info, fb->pitches[0], fb->format->depth);
   drm_fb_helper_fill_var(info, &gfbdev->helper, sizes->fb_width, sizes->fb_height);
   /* setup aperture base/size for vesafb takeover */
   info->apertures->ranges[0].base = cdev->dev->mode_config.fb_base;
   info->apertures->ranges[0].size = cdev->mc.vram_size;
   info->fix.smem_start = cdev->dev->mode_config.fb_base;
   info->fix.smem_len = cdev->mc.vram_size;
   info->screen_base = sysram;
   info->screen_size = size;
   info->fix.mmio_start = 0;
   info->fix.mmio_len = 0;
   DRM_INFO("fb mappable at 0x%lX\n", info->fix.smem_start);
   DRM_INFO("vram aper at 0x%lX\n", (unsigned long)info->fix.smem_start);
   DRM_INFO("size %lu\n", (unsigned long)info->fix.smem_len);
-  DRM_INFO("fb depth is %d\n", fb->depth);
+  DRM_INFO("fb depth is %d\n", fb->format->depth);
   DRM_INFO("   pitch is %d\n", fb->pitches[0]);
   return 0;
 }<sep>@@
struct drm_framebuffer *fb;
@@
- fb->depth
+ fb->format->depth

@@
struct drm_framebuffer *fb;
@@
- (fb->format->depth)
+ fb->format->depth
--- initial
+++ final
@@ -1,58 +1,58 @@
 static int nv04_crtc_do_mode_set_base(struct drm_crtc *crtc, struct drm_framebuffer *passed_fb, int x, int y, bool atomic) {
   struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
   struct drm_device *dev = crtc->dev;
   struct nouveau_drm *drm = nouveau_drm(dev);
   struct nv04_crtc_reg *regp = &nv04_display(dev)->mode_reg.crtc_reg[nv_crtc->index];
   struct drm_framebuffer *drm_fb;
   struct nouveau_framebuffer *fb;
   int arb_burst, arb_lwm;
   NV_DEBUG(drm, "index %d\n", nv_crtc->index);
   /* no fb bound */
   if (!atomic && !crtc->primary->fb) {
     NV_DEBUG(drm, "No FB bound\n");
     return 0;
   }
   /* If atomic, we want to switch to the fb we were passed, so
    * now we update pointers to do that.
    */
   if (atomic) {
     drm_fb = passed_fb;
     fb = nouveau_framebuffer(passed_fb);
   } else {
     drm_fb = crtc->primary->fb;
     fb = nouveau_framebuffer(crtc->primary->fb);
   }
   nv_crtc->fb.offset = fb->nvbo->bo.offset;
-  if (nv_crtc->lut.depth != drm_fb->depth) {
-    nv_crtc->lut.depth = drm_fb->depth;
+  if (nv_crtc->lut.depth != drm_fb->format->depth) {
+    nv_crtc->lut.depth = drm_fb->format->depth;
     nv_crtc_gamma_load(crtc);
   }
   /* Update the framebuffer format. */
   regp->CRTC[NV_CIO_CRE_PIXEL_INDEX] &= ~3;
-  regp->CRTC[NV_CIO_CRE_PIXEL_INDEX] |= (drm_fb->depth + 1) / 8;
+  regp->CRTC[NV_CIO_CRE_PIXEL_INDEX] |= (drm_fb->format->depth + 1) / 8;
   regp->ramdac_gen_ctrl &= ~NV_PRAMDAC_GENERAL_CONTROL_ALT_MODE_SEL;
-  if (drm_fb->depth == 16) regp->ramdac_gen_ctrl |= NV_PRAMDAC_GENERAL_CONTROL_ALT_MODE_SEL;
+  if (drm_fb->format->depth == 16) regp->ramdac_gen_ctrl |= NV_PRAMDAC_GENERAL_CONTROL_ALT_MODE_SEL;
   crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_PIXEL_INDEX);
   NVWriteRAMDAC(dev, nv_crtc->index, NV_PRAMDAC_GENERAL_CONTROL, regp->ramdac_gen_ctrl);
   regp->CRTC[NV_CIO_CR_OFFSET_INDEX] = drm_fb->pitches[0] >> 3;
   regp->CRTC[NV_CIO_CRE_RPC0_INDEX] = XLATE(drm_fb->pitches[0] >> 3, 8, NV_CIO_CRE_RPC0_OFFSET_10_8);
   regp->CRTC[NV_CIO_CRE_42] = XLATE(drm_fb->pitches[0] / 8, 11, NV_CIO_CRE_42_OFFSET_11);
   crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_RPC0_INDEX);
   crtc_wr_cio_state(crtc, regp, NV_CIO_CR_OFFSET_INDEX);
   crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_42);
   /* Update the framebuffer location. */
   regp->fb_start = nv_crtc->fb.offset & ~3;
   regp->fb_start += (y * drm_fb->pitches[0]) + (x * drm_fb->bits_per_pixel / 8);
   nv_set_crtc_base(dev, nv_crtc->index, regp->fb_start);
   /* Update the arbitration parameters. */
   nouveau_calc_arb(dev, crtc->mode.clock, drm_fb->bits_per_pixel, &arb_burst, &arb_lwm);
   regp->CRTC[NV_CIO_CRE_FF_INDEX] = arb_burst;
   regp->CRTC[NV_CIO_CRE_FFLWM__INDEX] = arb_lwm & 0xff;
   crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_FF_INDEX);
   crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_FFLWM__INDEX);
   if (drm->device.info.family >= NV_DEVICE_INFO_V0_KELVIN) {
     regp->CRTC[NV_CIO_CRE_47] = arb_lwm >> 8;
     crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_47);
   }
   return 0;
 }<sep>@@
struct drm_framebuffer *fb;
@@
- fb->depth
+ fb->format->depth

@@
struct drm_framebuffer *fb;
@@
- (fb->format->depth)
+ fb->format->depth
--- initial
+++ final
@@ -1,59 +1,59 @@
 int drm_fbdev_cma_create_with_funcs(struct drm_fb_helper *helper, struct drm_fb_helper_surface_size *sizes, const struct drm_framebuffer_funcs *funcs) {
   struct drm_fbdev_cma *fbdev_cma = to_fbdev_cma(helper);
   struct drm_mode_fb_cmd2 mode_cmd = {0};
   struct drm_device *dev = helper->dev;
   struct drm_gem_cma_object *obj;
   struct drm_framebuffer *fb;
   unsigned int bytes_per_pixel;
   unsigned long offset;
   struct fb_info *fbi;
   size_t size;
   int ret;
   DRM_DEBUG_KMS("surface width(%d), height(%d) and bpp(%d)\n", sizes->surface_width, sizes->surface_height, sizes->surface_bpp);
   bytes_per_pixel = DIV_ROUND_UP(sizes->surface_bpp, 8);
   mode_cmd.width = sizes->surface_width;
   mode_cmd.height = sizes->surface_height;
   mode_cmd.pitches[0] = sizes->surface_width * bytes_per_pixel;
   mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp, sizes->surface_depth);
   size = mode_cmd.pitches[0] * mode_cmd.height;
   obj = drm_gem_cma_create(dev, size);
   if (IS_ERR(obj)) return -ENOMEM;
   fbi = drm_fb_helper_alloc_fbi(helper);
   if (IS_ERR(fbi)) {
     ret = PTR_ERR(fbi);
     goto err_gem_free_object;
   }
   fbdev_cma->fb = drm_fb_cma_alloc(dev, &mode_cmd, &obj, 1, funcs);
   if (IS_ERR(fbdev_cma->fb)) {
     dev_err(dev->dev, "Failed to allocate DRM framebuffer.\n");
     ret = PTR_ERR(fbdev_cma->fb);
     goto err_fb_info_destroy;
   }
   fb = &fbdev_cma->fb->fb;
   helper->fb = fb;
   fbi->par = helper;
   fbi->flags = FBINFO_FLAG_DEFAULT;
   fbi->fbops = &drm_fbdev_cma_ops;
-  drm_fb_helper_fill_fix(fbi, fb->pitches[0], fb->depth);
+  drm_fb_helper_fill_fix(fbi, fb->pitches[0], fb->format->depth);
   drm_fb_helper_fill_var(fbi, helper, sizes->fb_width, sizes->fb_height);
   offset = fbi->var.xoffset * bytes_per_pixel;
   offset += fbi->var.yoffset * fb->pitches[0];
   dev->mode_config.fb_base = (resource_size_t)obj->paddr;
   fbi->screen_base = obj->vaddr + offset;
   fbi->fix.smem_start = (unsigned long)(obj->paddr + offset);
   fbi->screen_size = size;
   fbi->fix.smem_len = size;
   if (funcs->dirty) {
     ret = drm_fbdev_cma_defio_init(fbi, obj);
     if (ret) goto err_cma_destroy;
   }
   return 0;
 err_cma_destroy:
   drm_framebuffer_unregister_private(&fbdev_cma->fb->fb);
   drm_fb_cma_destroy(&fbdev_cma->fb->fb);
 err_fb_info_destroy:
   drm_fb_helper_release_fbi(helper);
 err_gem_free_object:
   drm_gem_object_unreference_unlocked(&obj->base);
   return ret;
 }<sep>@@
struct drm_framebuffer *fb;
@@
- fb->depth
+ fb->format->depth

@@
struct drm_framebuffer *fb;
@@
- (fb->format->depth)
+ fb->format->depth
--- initial
+++ final
@@ -1,67 +1,67 @@
 void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper, uint32_t fb_width, uint32_t fb_height) {
   struct drm_framebuffer *fb = fb_helper->fb;
   info->pseudo_palette = fb_helper->pseudo_palette;
   info->var.xres_virtual = fb->width;
   info->var.yres_virtual = fb->height;
   info->var.bits_per_pixel = fb->bits_per_pixel;
   info->var.accel_flags = FB_ACCELF_TEXT;
   info->var.xoffset = 0;
   info->var.yoffset = 0;
   info->var.activate = FB_ACTIVATE_NOW;
   info->var.height = -1;
   info->var.width = -1;
-  switch (fb->depth) {
+  switch (fb->format->depth) {
   case 8:
     info->var.red.offset = 0;
     info->var.green.offset = 0;
     info->var.blue.offset = 0;
     info->var.red.length = 8; /* 8bit DAC */
     info->var.green.length = 8;
     info->var.blue.length = 8;
     info->var.transp.offset = 0;
     info->var.transp.length = 0;
     break;
   case 15:
     info->var.red.offset = 10;
     info->var.green.offset = 5;
     info->var.blue.offset = 0;
     info->var.red.length = 5;
     info->var.green.length = 5;
     info->var.blue.length = 5;
     info->var.transp.offset = 15;
     info->var.transp.length = 1;
     break;
   case 16:
     info->var.red.offset = 11;
     info->var.green.offset = 5;
     info->var.blue.offset = 0;
     info->var.red.length = 5;
     info->var.green.length = 6;
     info->var.blue.length = 5;
     info->var.transp.offset = 0;
     break;
   case 24:
     info->var.red.offset = 16;
     info->var.green.offset = 8;
     info->var.blue.offset = 0;
     info->var.red.length = 8;
     info->var.green.length = 8;
     info->var.blue.length = 8;
     info->var.transp.offset = 0;
     info->var.transp.length = 0;
     break;
   case 32:
     info->var.red.offset = 16;
     info->var.green.offset = 8;
     info->var.blue.offset = 0;
     info->var.red.length = 8;
     info->var.green.length = 8;
     info->var.blue.length = 8;
     info->var.transp.offset = 24;
     info->var.transp.length = 8;
     break;
   default: break;
   }
   info->var.xres = fb_width;
   info->var.yres = fb_height;
 }<sep>@@
struct drm_framebuffer *fb;
@@
- fb->depth
+ fb->format->depth

@@
struct drm_framebuffer *fb;
@@
- (fb->format->depth)
+ fb->format->depth
--- initial
+++ final
@@ -1,30 +1,30 @@
 int drm_mode_getfb(struct drm_device *dev, void *data, struct drm_file *file_priv) {
   struct drm_mode_fb_cmd *r = data;
   struct drm_framebuffer *fb;
   int ret;
   if (!drm_core_check_feature(dev, DRIVER_MODESET)) return -EINVAL;
   fb = drm_framebuffer_lookup(dev, r->fb_id);
   if (!fb) return -ENOENT;
   r->height = fb->height;
   r->width = fb->width;
-  r->depth = fb->depth;
+  r->depth = fb->format->depth;
   r->bpp = fb->bits_per_pixel;
   r->pitch = fb->pitches[0];
   if (fb->funcs->create_handle) {
     if (drm_is_current_master(file_priv) || capable(CAP_SYS_ADMIN) || drm_is_control_client(file_priv)) {
       ret = fb->funcs->create_handle(fb, file_priv, &r->handle);
     } else {
       /* GET_FB() is an unprivileged ioctl so we must not
        * return a buffer-handle to non-master processes! For
        * backwards-compatibility reasons, we cannot make
        * GET_FB() privileged, so just return an invalid handle
        * for non-masters. */
       r->handle = 0;
       ret = 0;
     }
   } else {
     ret = -ENODEV;
   }
   drm_framebuffer_unreference(fb);
   return ret;
 }<sep>@@
struct drm_framebuffer *fb;
@@
- fb->depth
+ fb->format->depth

@@
struct drm_framebuffer *fb;
@@
- (fb->format->depth)
+ fb->format->depth
--- initial
+++ final
@@ -1,25 +1,23 @@
 void drm_helper_mode_fill_fb_struct(struct drm_device *dev, struct drm_framebuffer *fb, const struct drm_mode_fb_cmd2 *mode_cmd) {
   const struct drm_format_info *info;
   int i;
   info = drm_format_info(mode_cmd->pixel_format);
   if (!info || !info->depth) {
     struct drm_format_name_buf format_name;
     DRM_DEBUG_KMS("non-RGB pixel format %s\n", drm_get_format_name(mode_cmd->pixel_format, &format_name));
-    fb->depth = 0;
     fb->bits_per_pixel = 0;
   } else {
-    fb->depth = info->depth;
     fb->bits_per_pixel = info->cpp[0] * 8;
   }
   fb->dev = dev;
   fb->format = info;
   fb->width = mode_cmd->width;
   fb->height = mode_cmd->height;
   for (i = 0; i < 4; i++) {
     fb->pitches[i] = mode_cmd->pitches[i];
     fb->offsets[i] = mode_cmd->offsets[i];
   }
   fb->modifier = mode_cmd->modifier[0];
   fb->pixel_format = mode_cmd->pixel_format;
   fb->flags = mode_cmd->flags;
 }<sep>@@
struct drm_framebuffer *fb;
expression E;
@@
 drm_helper_mode_fill_fb_struct(...) {
...
-   fb->depth = E;
...
 }
--- initial
+++ final
@@ -1,9 +1,9 @@
 static int tegra_debugfs_framebuffers(struct seq_file *s, void *data) {
   struct drm_info_node *node = (struct drm_info_node *)s->private;
   struct drm_device *drm = node->minor->dev;
   struct drm_framebuffer *fb;
   mutex_lock(&drm->mode_config.fb_lock);
-  list_for_each_entry(fb, &drm->mode_config.fb_list, head) { seq_printf(s, "%3d: user size: %d x %d, depth %d, %d bpp, refcount %d\n", fb->base.id, fb->width, fb->height, fb->depth, fb->bits_per_pixel, drm_framebuffer_read_refcount(fb)); }
+  list_for_each_entry(fb, &drm->mode_config.fb_list, head) { seq_printf(s, "%3d: user size: %d x %d, depth %d, %d bpp, refcount %d\n", fb->base.id, fb->width, fb->height, fb->format->depth, fb->bits_per_pixel, drm_framebuffer_read_refcount(fb)); }
   mutex_unlock(&drm->mode_config.fb_lock);
   return 0;
 }<sep>@@
struct drm_framebuffer *fb;
@@
- fb->depth
+ fb->format->depth

@@
struct drm_framebuffer *fb;
@@
- (fb->format->depth)
+ fb->format->depth