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 Improve ifdef'ing out fb_info...



details:   https://anonhg.NetBSD.org/src/rev/c5e1faad05f9
branches:  trunk
changeset: 1028183:c5e1faad05f9
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 09:46:33 2021 +0000

description:
Improve ifdef'ing out fb_info stuff. Undo unintended local diff.


Author: Maya Rashish <maya%NetBSD.org@localhost>

diffstat:

 sys/external/bsd/drm2/dist/drm/drm_fb_helper.c |  36 +++++++++++++-------------
 1 files changed, 18 insertions(+), 18 deletions(-)

diffs (142 lines):

diff -r eb1c9f3748b3 -r c5e1faad05f9 sys/external/bsd/drm2/dist/drm/drm_fb_helper.c
--- a/sys/external/bsd/drm2/dist/drm/drm_fb_helper.c    Sun Dec 19 09:46:24 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_fb_helper.c    Sun Dec 19 09:46:33 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_fb_helper.c,v 1.21 2021/12/19 01:53:39 riastradh Exp $     */
+/*     $NetBSD: drm_fb_helper.c,v 1.22 2021/12/19 09:46:33 riastradh Exp $     */
 
 /*
  * Copyright (c) 2006-2009 Red Hat Inc.
@@ -30,7 +30,7 @@
  *      Jesse Barnes <jesse.barnes%intel.com@localhost>
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_fb_helper.c,v 1.21 2021/12/19 01:53:39 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_fb_helper.c,v 1.22 2021/12/19 09:46:33 riastradh Exp $");
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
@@ -144,6 +144,7 @@
  * fbdev shadow buffer and call drm_fbdev_generic_setup() instead.
  */
 
+#ifndef __NetBSD__
 static void drm_fb_helper_restore_lut_atomic(struct drm_crtc *crtc)
 {
        uint16_t *r_base, *g_base, *b_base;
@@ -163,16 +164,9 @@
  * drm_fb_helper_debug_enter - implementation for &fb_ops.fb_debug_enter
  * @info: fbdev registered by the helper
  */
-#ifndef __NetBSD__
 int drm_fb_helper_debug_enter(struct fb_info *info)
 {
-       return drm_fb_helper_debug_enter_fb(info->par);
-}
-#endif
-
-int
-drm_fb_helper_debug_enter_fb(struct drm_fb_helper *helper)
-{
+       struct drm_fb_helper *helper = info->par;
        const struct drm_crtc_helper_funcs *funcs;
        struct drm_mode_set *mode_set;
 
@@ -206,7 +200,6 @@
  * drm_fb_helper_debug_leave - implementation for &fb_ops.fb_debug_leave
  * @info: fbdev registered by the helper
  */
-#ifndef __NetBSD__
 int drm_fb_helper_debug_leave(struct fb_info *info)
 {
        struct drm_fb_helper *helper = info->par;
@@ -1692,7 +1685,6 @@
        info->var.xres = fb_width;
        info->var.yres = fb_height;
 }
-#endif
 
 /**
  * drm_fb_helper_fill_info - initializes fbdev information
@@ -1723,6 +1715,7 @@
 
 }
 EXPORT_SYMBOL(drm_fb_helper_fill_info);
+#endif
 
 /*
  * This is a continuation of drm_setup_crtcs() that sets up anything related
@@ -1734,12 +1727,12 @@
 static void drm_setup_crtcs_fb(struct drm_fb_helper *fb_helper)
 {
        struct drm_client_dev *client = &fb_helper->client;
+#ifndef __NetBSD__             /* XXX fb info */
        struct drm_connector_list_iter conn_iter;
-#ifndef __NetBSD__             /* XXX fb info */
        struct fb_info *info = fb_helper->fbdev;
+       struct drm_connector *connector;
 #endif
        unsigned int rotation, sw_rotations = 0;
-       struct drm_connector *connector;
        struct drm_mode_set *modeset;
 
        mutex_lock(&client->modeset_mutex);
@@ -2026,18 +2019,24 @@
        return 0;
 }
 
+#endif /* __NetBSD__ */
+
 static void drm_fbdev_cleanup(struct drm_fb_helper *fb_helper)
 {
+#ifndef __NetBSD__             /* XXX fb info */
        struct fb_info *fbi = fb_helper->fbdev;
+#endif
        void *shadow = NULL;
 
        if (!fb_helper->dev)
                return;
 
+#ifndef __NetBSD__             /* XXX fb info */
        if (fbi && fbi->fbdefio) {
                fb_deferred_io_cleanup(fbi);
                shadow = fbi->screen_buffer;
        }
+#endif
 
        drm_fb_helper_fini(fb_helper);
 
@@ -2053,6 +2052,8 @@
        kfree(fb_helper);
 }
 
+
+#ifndef __NetBSD__             /* XXX fb info */
 /*
  * fb_ops.fb_destroy is called by the last put_fb_info() call at the end of
  * unregister_framebuffer() or fb_release().
@@ -2127,6 +2128,7 @@
 
 #ifdef __NetBSD__              /* XXX fb info */
        __USE(fb);
+       __USE(vaddr);
 #else
        fbi = drm_fb_helper_alloc_fbi(fb_helper);
        if (IS_ERR(fbi))
@@ -2173,14 +2175,12 @@
 {
        struct drm_fb_helper *fb_helper = drm_fb_helper_from_client(client);
 
+#ifndef __NetBSD__             /* XXX fb info */
        if (fb_helper->fbdev)
-#ifndef __NetBSD__             /* XXX fb info */
-       {
                /* drm_fbdev_fb_destroy() takes care of cleanup */
                drm_fb_helper_unregister_fbi(fb_helper);
-       }
+       else
 #endif
-       else
                drm_fbdev_release(fb_helper);
 }
 



Home | Main Index | Thread Index | Old Index