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/nouveau Work around const in ...



details:   https://anonhg.NetBSD.org/src/rev/559d3a577360
branches:  trunk
changeset: 1028367:559d3a577360
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 10:49:21 2021 +0000

description:
Work around const in container_of. Ifdef out vga switcheroo.

diffstat:

 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_connector.c |  15 ++++++++++---
 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_connector.h |   4 ++-
 2 files changed, 14 insertions(+), 5 deletions(-)

diffs (74 lines):

diff -r 0980be2761df -r 559d3a577360 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_connector.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_connector.c        Sun Dec 19 10:49:13 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_connector.c        Sun Dec 19 10:49:21 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_connector.c,v 1.6 2021/12/18 23:45:32 riastradh Exp $  */
+/*     $NetBSD: nouveau_connector.c,v 1.7 2021/12/19 10:49:21 riastradh Exp $  */
 
 /*
  * Copyright (C) 2008 Maarten Maathuis.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_connector.c,v 1.6 2021/12/18 23:45:32 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_connector.c,v 1.7 2021/12/19 10:49:21 riastradh Exp $");
 
 #include <acpi/button.h>
 
@@ -104,7 +104,7 @@
                                 const struct drm_connector_state *state,
                                 struct drm_property *property, u64 *val)
 {
-       struct nouveau_conn_atom *asyc = nouveau_conn_atom(state);
+       const struct nouveau_conn_atom *asyc = nouveau_conn_atom_const(state);
        struct nouveau_display *disp = nouveau_display(connector->dev);
        struct drm_device *dev = connector->dev;
 
@@ -424,7 +424,7 @@
        if (nv_connector->aux.transfer) {
                drm_dp_cec_unregister_connector(&nv_connector->aux);
                drm_dp_aux_unregister(&nv_connector->aux);
-               kfree(nv_connector->aux.name);
+               kfree(__UNCONST(nv_connector->aux.name));
        }
        kfree(connector);
 }
@@ -458,12 +458,19 @@
                        if (!nv_encoder->i2c)
                                break;
 
+#ifdef __NetBSD__
+                       __USE(switcheroo_ddc);
+                       __USE(dev);
+#else
                        if (switcheroo_ddc)
                                vga_switcheroo_lock_ddc(dev->pdev);
+#endif
                        if (nvkm_probe_i2c(nv_encoder->i2c, 0x50))
                                found = nv_encoder;
+#ifndef __NetBSD__
                        if (switcheroo_ddc)
                                vga_switcheroo_unlock_ddc(dev->pdev);
+#endif
 
                        break;
                }
diff -r 0980be2761df -r 559d3a577360 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_connector.h
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_connector.h        Sun Dec 19 10:49:13 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_connector.h        Sun Dec 19 10:49:21 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_connector.h,v 1.3 2021/12/18 23:45:32 riastradh Exp $  */
+/*     $NetBSD: nouveau_connector.h,v 1.4 2021/12/19 10:49:21 riastradh Exp $  */
 
 /*
  * Copyright (C) 2008 Maarten Maathuis.
@@ -49,6 +49,8 @@
 
 #define nouveau_conn_atom(p)                                                   \
        container_of((p), struct nouveau_conn_atom, state)
+#define nouveau_conn_atom_const(p)                                             \
+       const_container_of((p), struct nouveau_conn_atom, state)
 
 struct nouveau_conn_atom {
        struct drm_connector_state state;



Home | Main Index | Thread Index | Old Index