From f9dc6f4420afa274bb41ddafc1109b068003050b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Imre=20Vad=C3=A1sz?= Date: Thu, 26 Nov 2015 23:00:52 +0100 Subject: [PATCH] drm/i915: Use fb->pitches[0] for stride. Remove duplicate kmalloc call. * We can directly use fb->pitches[0] for the stride in intel_fbdev.c. * Remove duplicate kmalloc call for struct fb_info in intel_fbdev.c. --- sys/dev/drm/i915/intel_fbdev.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/dev/drm/i915/intel_fbdev.c b/sys/dev/drm/i915/intel_fbdev.c index c52dbdb873..bb4bf59007 100644 --- a/sys/dev/drm/i915/intel_fbdev.c +++ b/sys/dev/drm/i915/intel_fbdev.c @@ -198,13 +198,13 @@ static int intelfb_create(struct drm_fb_helper *helper, info->par = helper; #endif + fb = &ifbdev->fb->base; + #ifdef __DragonFly__ vga_dev = device_get_parent(dev->dev); - info = kmalloc(sizeof(struct fb_info), M_DRM, M_WAITOK | M_ZERO); info->width = sizes->fb_width; info->height = sizes->fb_height; - info->stride = - ALIGN(sizes->surface_width * ((sizes->surface_bpp + 7) / 8), 64); + info->stride = fb->pitches[0]; info->depth = sizes->surface_bpp; info->paddr = dev_priv->gtt.mappable_base + i915_gem_obj_ggtt_offset(obj); info->is_vga_boot_display = vga_pci_is_boot_display(vga_dev); @@ -214,8 +214,6 @@ static int intelfb_create(struct drm_fb_helper *helper, VM_MEMATTR_WRITE_COMBINING); #endif - fb = &ifbdev->fb->base; - ifbdev->helper.fb = fb; ifbdev->helper.fbdev = info; -- 2.11.4.GIT