summaryrefslogtreecommitdiffstats
path: root/sys/dev/drm2
diff options
context:
space:
mode:
authorray <ray@FreeBSD.org>2013-10-08 11:51:20 +0000
committerray <ray@FreeBSD.org>2013-10-08 11:51:20 +0000
commit36deab7b3b65f35dc1bd29e82810fe4540adaf08 (patch)
tree1aa6de990fcc61730fab521019903b8958d15ec5 /sys/dev/drm2
parentb11a0aa7682cca3b3f87769a89baa4ba9c78095f (diff)
downloadFreeBSD-src-36deab7b3b65f35dc1bd29e82810fe4540adaf08.zip
FreeBSD-src-36deab7b3b65f35dc1bd29e82810fe4540adaf08.tar.gz
Enable fill of fb_info for i915kms driver.
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/dev/drm2')
-rw-r--r--sys/dev/drm2/i915/intel_fb.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/sys/dev/drm2/i915/intel_fb.c b/sys/dev/drm2/i915/intel_fb.c
index e41a49f..eba4ca9 100644
--- a/sys/dev/drm2/i915/intel_fb.c
+++ b/sys/dev/drm2/i915/intel_fb.c
@@ -41,8 +41,8 @@ static int intelfb_create(struct intel_fbdev *ifbdev,
struct drm_device *dev = ifbdev->helper.dev;
#if 0
struct drm_i915_private *dev_priv = dev->dev_private;
- struct fb_info *info;
#endif
+ struct fb_info *info;
struct drm_framebuffer *fb;
struct drm_mode_fb_cmd2 mode_cmd;
struct drm_i915_gem_object *obj;
@@ -86,6 +86,14 @@ static int intelfb_create(struct intel_fbdev *ifbdev,
}
info->par = ifbdev;
+#else
+ info = malloc(sizeof(struct fb_info), DRM_MEM_KMS, M_WAITOK | M_ZERO);
+ info->fb_size = size;
+
+ info->fb_pbase = dev->agp->base + obj->gtt_offset;
+ info->fb_vbase = (vm_offset_t)pmap_mapdev_attr(info->fb_pbase, size,
+ PAT_WRITE_COMBINING);
+
#endif
ret = intel_framebuffer_init(dev, &ifbdev->ifb, &mode_cmd, obj);
@@ -95,8 +103,8 @@ static int intelfb_create(struct intel_fbdev *ifbdev,
fb = &ifbdev->ifb.base;
ifbdev->helper.fb = fb;
-#if 0
ifbdev->helper.fbdev = info;
+#if 0
strcpy(info->fix.id, "inteldrmfb");
@@ -135,9 +143,8 @@ static int intelfb_create(struct intel_fbdev *ifbdev,
/* Use default scratch pixmap (info->pixmap.flags = FB_PIXMAP_SYSTEM) */
#endif
-
- DRM_DEBUG_KMS("allocated %dx%d fb: 0x%08x, bo %p\n",
- fb->width, fb->height,
+ DRM_DEBUG_KMS("allocated %dx%d (s %dbits) fb: 0x%08x, bo %p\n",
+ fb->width, fb->height, fb->depth,
obj->gtt_offset, obj);
DRM_UNLOCK(dev);
OpenPOWER on IntegriCloud