svn commit: r257451 - in user/ed/newcons/sys/dev/drm2: . i915 radeon
Aleksandr Rybalko
ray at FreeBSD.org
Thu Oct 31 14:39:05 UTC 2013
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
};
More information about the svn-src-user
mailing list