Date: Thu, 31 Oct 2013 14:39:05 +0000 (UTC) From: Aleksandr Rybalko <ray@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r257451 - in user/ed/newcons/sys/dev/drm2: . i915 radeon Message-ID: <201310311439.r9VEd5fh025537@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ray Date: Thu Oct 31 14:39:04 2013 New Revision: 257451 URL: http://svnweb.freebsd.org/changeset/base/257451 Log: Change drm2 to attach fbd as device. Radeon driver not ready yet. Sponsored by: The FreeBSD Foundation Modified: user/ed/newcons/sys/dev/drm2/drm_fb_helper.c user/ed/newcons/sys/dev/drm2/i915/i915_drv.c user/ed/newcons/sys/dev/drm2/radeon/radeon_drv.c Modified: user/ed/newcons/sys/dev/drm2/drm_fb_helper.c ============================================================================== --- user/ed/newcons/sys/dev/drm2/drm_fb_helper.c Thu Oct 31 14:11:14 2013 (r257450) +++ user/ed/newcons/sys/dev/drm2/drm_fb_helper.c Thu Oct 31 14:39:04 2013 (r257451) @@ -932,6 +932,7 @@ int drm_fb_helper_single_fb_probe(struct int gamma_size = 0; #if defined(__FreeBSD__) struct vt_kms_softc *sc; + device_t kdev; #endif memset(&sizes, 0, sizeof(struct drm_fb_helper_surface_size)); @@ -1033,7 +1034,9 @@ int drm_fb_helper_single_fb_probe(struct #if defined(__FreeBSD__) if (new_fb) { - register_framebuffer(info); + kdev = fb_helper->dev->device; + device_add_child(kdev, "fbd", device_get_unit(kdev)); + bus_generic_attach(kdev); } #else if (new_fb) { Modified: user/ed/newcons/sys/dev/drm2/i915/i915_drv.c ============================================================================== --- user/ed/newcons/sys/dev/drm2/i915/i915_drv.c Thu Oct 31 14:11:14 2013 (r257450) +++ user/ed/newcons/sys/dev/drm2/i915/i915_drv.c Thu Oct 31 14:39:04 2013 (r257451) @@ -40,6 +40,8 @@ __FBSDID("$FreeBSD$"); #include <dev/drm2/drm_pciids.h> #include <dev/drm2/i915/intel_drv.h> +#include "fb_if.h" + /* drv_PCI_IDs comes from drm_pciids.h, generated from drm_pciids.txt. */ static drm_pci_id_list_t i915_pciidlist[] = { i915_PCI_IDS @@ -380,6 +382,25 @@ i915_attach(device_t kdev) return (drm_attach(kdev, i915_pciidlist)); } +static struct fb_info * +i915_fb_helper_getinfo(device_t kdev) +{ + struct intel_fbdev *ifbdev; + drm_i915_private_t *dev_priv; + struct drm_device *dev; + struct fb_info *info; + + dev = device_get_softc(kdev); + dev_priv = dev->dev_private; + ifbdev = dev_priv->fbdev; + if (ifbdev == NULL) + return (NULL); + + info = ifbdev->helper.fbdev; + + return (info); +} + const struct intel_device_info * i915_get_device_id(int device) { @@ -400,6 +421,10 @@ static device_method_t i915_methods[] = DEVMETHOD(device_suspend, i915_suspend), DEVMETHOD(device_resume, i915_resume), DEVMETHOD(device_detach, drm_detach), + + /* Framebuffer service methods */ + DEVMETHOD(fb_getinfo, i915_fb_helper_getinfo), + DEVMETHOD_END }; Modified: user/ed/newcons/sys/dev/drm2/radeon/radeon_drv.c ============================================================================== --- user/ed/newcons/sys/dev/drm2/radeon/radeon_drv.c Thu Oct 31 14:11:14 2013 (r257450) +++ user/ed/newcons/sys/dev/drm2/radeon/radeon_drv.c Thu Oct 31 14:39:04 2013 (r257451) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include <dev/drm2/drm_pciids.h> +#include "fb_if.h" /* * KMS wrapper. @@ -488,6 +489,28 @@ radeon_resume(device_t kdev) return (-ret); } +static struct fb_info * +radeon_fb_helper_getinfo(device_t kdev) +{ +#if 0 /* XXX */ + struct drm_device *dev; + struct radeon_mode_info *mode_info; + struct radeon_fbdev *rfbdev; + struct radeon_device *rdev; + struct fb_info *info; + + + dev = device_get_softc(kdev); + rdev = dev->dev_private; + mode_info = &rdev->mode_info; + rfbdev = mode_info->rfbdev; + info = rfbdev->helper.fbdev; + return (info); +#else + return (NULL); +#endif +} + static device_method_t radeon_methods[] = { /* Device interface */ DEVMETHOD(device_probe, radeon_probe), @@ -495,6 +518,10 @@ static device_method_t radeon_methods[] DEVMETHOD(device_suspend, radeon_suspend), DEVMETHOD(device_resume, radeon_resume), DEVMETHOD(device_detach, drm_detach), + + /* Framebuffer service methods */ + DEVMETHOD(fb_getinfo, radeon_fb_helper_getinfo), + DEVMETHOD_END };
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310311439.r9VEd5fh025537>