Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm/radeon Forgot this file for r...



details:   https://anonhg.NetBSD.org/src/rev/ee8ac73a3e48
branches:  trunk
changeset: 797693:ee8ac73a3e48
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Fri Jul 25 12:48:34 2014 +0000

description:
Forgot this file for radeondrmkmsfb.

diffstat:

 sys/external/bsd/drm2/dist/drm/radeon/radeon_fb.c |  34 +++++++++++++++++-----
 1 files changed, 26 insertions(+), 8 deletions(-)

diffs (62 lines):

diff -r 9d66126d6878 -r ee8ac73a3e48 sys/external/bsd/drm2/dist/drm/radeon/radeon_fb.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/radeon_fb.c Fri Jul 25 12:47:18 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/radeon_fb.c Fri Jul 25 12:48:34 2014 +0000
@@ -37,6 +37,10 @@
 
 #include <linux/vga_switcheroo.h>
 
+#ifdef __NetBSD__
+#include "radeondrmkmsfb.h"
+#endif
+
 /* object hierarchy -
    this contains a helper + a radeon fb
    the helper contains a pointer to radeon framebuffer baseclass.
@@ -243,12 +247,22 @@
        }
 
        (void)memset(rbo->kptr, 0, radeon_bo_size(rbo));
-       ret = radeon_genfb_attach(rdev->ddev, helper, sizes, rbo);
-       if (ret) {
-               DRM_ERROR("failed to attach genfb: %d\n", ret);
+
+    {
+       static const struct radeonfb_attach_args zero_rfa;
+       struct radeonfb_attach_args rfa = zero_rfa;
+
+       rfa.rfa_fb_helper = helper;
+       rfa.rfa_fb_sizes = *sizes;
+       rfa.rfa_fb_ptr = rbo->kptr;
+
+       helper->fbdev = config_found_ia(rdev->ddev->dev, "radeonfbbus", &rfa,
+           NULL);
+       if (helper->fbdev == NULL) {
+               DRM_ERROR("failed to attach genfb\n");
                goto out_unref;
        }
-       helper->genfb_attached = true;
+    }
        fb = &rfbdev->rfb.base;
        rfbdev->helper.fb = fb;
 #else
@@ -346,12 +360,16 @@
        struct fb_info *info;
 #endif
        struct radeon_framebuffer *rfb = &rfbdev->rfb;
+#ifdef __NetBSD__
+       int ret;
+#endif
 
 #ifdef __NetBSD__
-       if (rfbdev->helper.genfb_attached) {
-               /* XXX detach genfb for real...  */
-               (void)config_detach_children(dev->dev, DETACH_FORCE);
-       }
+       /* XXX errno NetBSD->Linux */
+       ret = -config_detach(rfbdev->helper.fbdev, DETACH_FORCE);
+       if (ret)
+               DRM_ERROR("failed to detach radeonfb: %d\n", ret);
+       rfbdev->helper.fbdev = NULL;
 #else
        if (rfbdev->helper.fbdev) {
                info = rfbdev->helper.fbdev;



Home | Main Index | Thread Index | Old Index